KaskoazulWho's That Going Across My Bridge
    Updated 2022-04-16
    with OUTFLOW as (
    select block_timestamp::date as fecha,
    sum(event_amount) as daily_UST_OUT,
    sum(daily_UST_OUT) over (order by fecha) as cum_UST_OUT,
    count(tx_id) as daily_txs_OUT,
    count(distinct event_from) as daily_users_OUT
    from terra.transfers
    where event_to_address_name = 'ethereum bridge'
    and event_currency = 'UST'
    and msg_type = 'bank/MsgSend'
    group by fecha
    order by fecha
    ),
    INFLOW as (
    select block_timestamp::date as fecha,
    sum(event_amount) as daily_UST_IN,
    sum(daily_UST_IN) over (order by fecha) as cum_UST_IN,
    count(tx_id) as daily_txs_IN,
    count(distinct event_to) as daily_users_IN
    from terra.transfers
    where event_from_address_name = 'ethereum bridge'
    and event_currency = 'UST'
    and msg_type = 'bank/MsgSend'
    group by fecha
    order by fecha
    )
    select o.fecha,
    o.daily_UST_OUT,
    o.cum_UST_OUT,
    o.daily_txs_OUT,
    o.daily_UST_OUT / o.daily_txs_OUT as avg_OUT_size,
    o.daily_users_OUT,
    o.daily_txs_OUT / o.daily_users_OUT as tx_user_OUT,
    i.daily_UST_IN,
    i.cum_UST_IN,
    i.daily_txs_IN,
    Run a query to Download Data