mmdrezaMonthly $FLOW Balance of Top 20 Holders Breakdown by Wallet
    Updated 2022-11-27
    with balance_tab as (
    select
    date_trunc('month', block_timestamp) as date,
    event_data:to as users,
    sum(event_data:amount) as volume
    from flow.core.fact_events
    where
    event_contract = 'A.1654653399040a61.FlowToken' and
    event_type = 'TokensDeposited' and
    tx_succeeded = 'TRUE' and
    event_data:to != 'null' and
    event_data:amount is not null
    group by 1,2

    union all

    select
    date_trunc('month', block_timestamp) as date,
    event_data:from as users,
    -sum(event_data:amount) as volume
    from flow.core.fact_events
    where
    event_contract = 'A.1654653399040a61.FlowToken' and
    event_type = 'TokensWithdrawn' and
    tx_succeeded = 'TRUE' and
    event_data:from != 'null' and
    event_data:amount is not null
    group by 1,2
    ),

    main_tab as (
    select
    users,
    sum(volume) as balance
    from balance_tab
    group by 1
    Run a query to Download Data