KaskoazulAcross my bridge Osmosis
    Updated 2022-04-16

    with OUTFLOW as (
    select me.block_timestamp::date as fecha,
    sum(amount) as daily_UST,
    sum(daily_UST) over (order by fecha) as cum_UST,
    count(distinct me.tx_id) as daily_txs,
    count(distinct sender) as daily_users_out
    from terra.msg_events me
    inner join terra.transfer_events te
    on me.tx_id = te.tx_id
    where me.event_type = 'ibc_transfer'
    and me.event_attributes:receiver like 'osmo%'
    and currency in ('UST')
    group by 1
    ),

    INFLOW as (
    select me.block_timestamp::date as fecha,
    sum(amount) as daily_UST,
    sum(daily_UST) over (order by fecha) as cum_UST,
    count(distinct me.tx_id) as daily_txs,
    count(distinct recipient) as daily_users_in
    from terra.msg_events me
    inner join terra.transfer_events te
    on me.tx_id = te.tx_id
    where me.event_type = 'ibc_transfer'
    and te.sender = 'terra1kq2rzz6fq2q7fsu75a9g7cpzjeanmk68wplle5'
    and currency in ('UST')
    group by 1
    )

    select o.fecha,
    o.daily_UST as daily_UST_OUT,
    o.cum_UST as cum_UST_OUT,
    o.daily_txs as daily_txs_OUT,
    o.daily_users_out,
    Run a query to Download Data