NavidCopy of Copy of Untitled Query
    Updated 2022-12-03
    with buys as (
    select
    date(block_timestamp) as day,
    receiver as address,
    amount/pow(10,decimal) as volume
    from
    axelar.core.fact_transfers
    where
    currency='uaxl' and tx_succeeded
    and transfer_type in ('AXELAR','IBC_TRANSFER_IN')
    ), sells as (
    select
    date(block_timestamp) as day,
    sender as address,
    amount/pow(10,decimal) as volume
    from
    axelar.core.fact_transfers
    where
    currency='uaxl' and tx_succeeded
    and transfer_type in ('AXELAR','IBC_TRANSFER_OUT')
    ), axelar_balance as (
    select
    b.day,
    b.address,
    ifnull(sum(b.volume),0) - ifnull(sum(s.volume),0) as volu,
    sum(volu) over (partition by b.address order by b.day asc) as volume
    from
    buys b join sells s on b.day=s.day and b.address=s.address
    group by 1, 2
    ), osmosis_balance as (
    select
    date(date) as day,
    sum(balance/pow(10,decimal)) as volume
    from
    osmosis.core.fact_daily_balances
    where
    Run a query to Download Data