pine_samiTop TRIAS holders on BSC chain
    Updated 2022-11-18
    with outflow as (
    select FROM_ADDRESS as sender, sum(RAW_AMOUNT/1e18) as outt
    from bsc.core.fact_token_transfers
    where CONTRACT_ADDRESS='0xa4838122c683f732289805fc3c207febd55babdd' and RAW_AMOUNT>0
    group by 1
    ),
    inflow as (
    select TO_ADDRESS as receiver , sum(RAW_AMOUNT/1e18) as intt
    from bsc.core.fact_token_transfers
    where CONTRACT_ADDRESS='0xa4838122c683f732289805fc3c207febd55babdd' and RAW_AMOUNT>0
    group by 1
    ),
    bsc as (
    select (b.intt-a.outt) as balance, a.sender as holder
    from outflow a join inflow b on a.sender=b.receiver
    )
    select holder, sum(balance)
    from bsc
    where balance> 0
    group by 1
    order by 2 DESC
    limit 10




    Run a query to Download Data