Sbhn_NP$ARB Holders
    Updated 2023-05-25
    with inflow as (
    select receiver,
    sum(amount/pow(10,decimal)) as volume_in
    from osmosis.core.fact_transfers
    where currency = 'ibc/10E5E5B06D78FFBB61FD9F89209DEE5FD4446ED0550CBB8E3747DA79E10D9DC6'
    and receiver is not null
    and amount is not null
    group by 1
    ),

    outflow as (
    select sender,
    sum(amount/pow(10,decimal)) as volume_out
    from osmosis.core.fact_transfers
    where currency = 'ibc/10E5E5B06D78FFBB61FD9F89209DEE5FD4446ED0550CBB8E3747DA79E10D9DC6'
    and sender is not null
    and amount is not null
    group by 1
    ),

    agg as (
    select sender as holder,
    volume_in-volume_out as balance
    from inflow join outflow on sender=receiver
    where volume_in>volume_out)

    select holder,
    balance
    from agg
    where balance>0
    order by 2 desc

    Run a query to Download Data