shreextopsh
    Updated 2022-07-22
    with withdraws as (
    select
    transaction_result:events[7]:value:fields[1] as address,
    transaction_result:events[7]:value:fields[0] as nft_id,
    -'1' as withdraws

    from flow.core.fact_transactions where transaction_result:events[7]:value:eventType:qualifiedIdentifier='TopShot.Withdraw'
    ORDER BY 1
    LIMIT 5
    UNION ALL
    select
    transaction_result:events[8]:value:fields[1] as address,
    transaction_result:events[8]:value:fields[0] as nft_id,
    '1' as deposits
    from flow.core.fact_transactions where transaction_result:events[8]:value:eventType:qualifiedIdentifier='TopShot.Deposit')

    select
    address,
    sum(flow) from withdraws
    group by 1
    ORDER BY 2
    LIMIT 5
    Run a query to Download Data