mlhUntitled Query
    Updated 2022-09-07
    with volume_in as (select TX_RECEIVER,
    sum(deposit / power(10, 24)) as volume_ins
    FROM near.core.fact_transfers
    group by 1
    ),
    volume_out as (select TX_SIGNER,
    sum(deposit / power(10, 24)) as volume_outs
    from near.core.fact_transfers
    group by 1
    )
    SELECT TX_RECEIVER,
    volume_ins - volume_outs as near_balance
    FROM volume_in
    join volume_in t2 on t1.TX_RECEIVER = t2.TX_SIGNER
    and t2.volume_ins - t1.volume_outs >0

    GROUP BY 1, 2
    order by 2 DESC

    limit 10

    Run a query to Download Data