shreexFlows - Outflows
    Updated 2022-12-21
    with flows as (
    select
    block_timestamp::date as day1,
    case
    when currency='ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF' then 'axlUSDT'
    when currency='ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4' then 'axlUSDC'
    end as currency,
    count(*) as transfers,
    sum(amount/pow(10,6)) as volume
    from terra.core.ez_transfers where transfer_type='IBC_Transfer_In' and currency in ('ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4','ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF')
    -- when currency='ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4' then 'axlUSDC'
    -- when currency='ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF' then 'axlUSDT' end as stablecoin,
    GROUP BY day1,currency
    ORDER BY day1
    ) ,
    outflows as (
    select
    block_timestamp::date as day1,
    case
    when currency='ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF' then 'axlUSDT'
    when currency='ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4' then 'axlUSDC'
    end as currency,
    count(*) as transfers,
    sum(amount/pow(10,6)) as volume
    from terra.core.ez_transfers where transfer_type='IBC_Transfer_Off' and currency in ('ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4','ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF')
    -- when currency='ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4' then 'axlUSDC'
    -- when currency='ibc/CBF67A2BCF6CAE343FDF251E510C8E18C361FC02B23430C121116E0811835DEF' then 'axlUSDT' end as stablecoin,
    GROUP BY day1,currency
    ORDER BY day1
    )
    select
    f.day1,
    f.currency,
    f.transfers as inflow_txs,
    o.transfers as outflow_txs,
    inflow_txs-outflow_txs as flow_total,
    Run a query to Download Data