binhachonOutbound Traffic - UST
    Updated 2022-03-13
    with bridge_transaction as (
    select
    block_timestamp,
    substr(event_attributes:packet_data:receiver::string, 1, 4) as address_header,
    case
    when address_header = 'axel' then 'Axelar'
    when address_header = 'secr' then 'Secret'
    when address_header = 'osmo' then 'Osmosis'
    when address_header = 'inj1' then 'Injective'
    end as blockchain,
    event_attributes:packet_data:sender::string as sender,
    event_attributes:packet_data:denom::string as denom,
    event_attributes:packet_data:amount::float/1e6 as amount
    from terra.msg_events
    where tx_status = 'SUCCEEDED'
    and address_header in ('axel', 'inj1', 'osmo', 'secr')
    and denom in ('uusd', 'uluna')
    )
    select
    date_trunc('week', block_timestamp) as time,
    blockchain,
    sum(amount) as amount
    from bridge_transaction
    where denom = 'uusd'
    group by time, blockchain
    order by time desc

    Run a query to Download Data