adambalaWho's That Going Across My Bridge (Redux)
    Updated 2022-04-24
    select

    date_trunc('day',block_timestamp) as date,
    case when EVENT_ATTRIBUTES:packet_data:denom ilike '%uusd%' then 'UST'
    else'LUNA' end as coin,
    sum(EVENT_ATTRIBUTES:packet_data:amount/1000000) as volume,
    count(distinct EVENT_ATTRIBUTES:packet_data:sender) as bridger,
    count(distinct tx_id) as transaction_num,
    sum(volume) over (order by date) as cumulative,
    'injective to terra' as title
    from terra.msg_events
    where EVENT_ATTRIBUTES:packet_data:sender ilike 'inj%'
    group by 1,2,7

    union all

    select
    date_trunc('day',block_timestamp) as date,
    case when EVENT_ATTRIBUTES:packet_data:denom ilike '%uusd%' then 'UST'
    else'LUNA' end as coin,sum(EVENT_ATTRIBUTES:packet_data:amount/1000000) as volume,
    count(distinct EVENT_ATTRIBUTES:packet_data:receiver) as bridger, count(distinct tx_id) as transaction_num,
    sum(volume) over (order by date) as cumulative,
    ' terra to injective'as title
    from terra.msg_events
    where EVENT_ATTRIBUTES:packet_data:receiver ilike 'inj%'
    group by 1,2,7
    Run a query to Download Data