kiacryptoTop USDT holders
    Updated 2022-06-16
    with flow_from as (
    select address_name as "from", sum(amount) as neg_volume
    from solana.core.fact_transfers, solana.core.dim_labels
    where block_timestamp::date >= '2022-01-01' and mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'
    and amount is not null and tx_from = address
    group by 1
    order by 2 desc
    ),
    flow_to as (
    select address_name as "to", sum(amount) as pos_volume
    from solana.core.fact_transfers, solana.core.dim_labels
    where block_timestamp::date >= '2022-01-01' and mint = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'
    and amount is not null and tx_to = address
    group by 1
    order by 2 desc
    )
    select "from", avg(pos_volume - neg_volume) as hold_amount
    from flow_from, flow_to
    where "from" = "to"
    group by 1 having hold_amount > 0
    order by 2 desc
    Run a query to Download Data