HosseinUntitled Query
    Updated 2023-01-04
    with t as (
    select
    receiver as address,
    -sum(amount::number/pow(10, 6)) as volume
    from terra.core.ez_transfers
    where currency = 'uluna'
    and tx_succeeded = 1
    and amount is not null
    group by address
    union all

    select
    sender as address,
    sum(amount::number/pow(10, 6)) as volume
    from terra.core.ez_transfers
    where currency = 'uluna'
    and tx_succeeded = 1
    and amount is not null
    group by address
    )

    select sum(total_balance) as circulation_supply from (
    select address,
    sum(volume::number) as total_balance
    from t
    group by address
    having total_balance > 0
    )
    Run a query to Download Data