boomer77tb & wh users tx count
    Updated 2022-01-19
    with terra_bridge as (select
    msg_value:from_address::string as users, 'tbridge' as bridges,
    count(distinct tx_id) as tx_count
    from terra.msgs
    where msg_value:to_address::string in ('terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc', 'terra1rtn03a9l3qsc0a9verxwj00afs93mlm0yr7chk') and
    tx_status = 'SUCCEEDED'
    group by 1,2),

    wormhole as (select
    msg_value:sender::string as users, 'wormhole' as bridges,
    count (distinct tx_id) as tx_count
    from terra.msgs
    where msg_value:contract::string = 'terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf'
    and msg_value:execute_msg:initiate_transfer:asset:info:token:contract_addr::string is not null and tx_status = 'SUCCEEDED'
    group by 1,2),

    total as (select * from terra_bridge
    union
    select * from wormhole),

    alladdress as (select distinct users from total),
    allusers as (select a.users, b.tx_count as terrabridge_tx, c.tx_count as wormhole_tx,
    (b.tx_count + c.tx_count) as total_tx, case
    when terrabridge_tx is not null and wormhole_tx is not null then 'Both'
    when terrabridge_tx is not null and wormhole_tx is null then 'Terra_Bridge Only'
    when terrabridge_tx is null and wormhole_tx is not null then 'Wormhole Only'
    else null end as bridges_users
    from alladdress a
    left outer join terra_bridge b on a.users = b.users
    left outer join wormhole c on a.users = c.users),

    both as (select * from allusers
    where bridges_users = 'Both'
    order by total_tx desc),

    Run a query to Download Data