Updated 2025-02-26
    with table1 as (select block_timestamp, source_address as user
    from crosschain.defi.ez_bridge_activity
    where platform in ('wormhole')
    and block_timestamp::date>='2024-01-01'
    and source_chain in ('arbitrum','avalanche','base','bsc','bnb','binance smart chain','ethereum','optimism','polygon','avalanche c-chain')),

    table2 as (select block_timestamp, source_address as user
    from crosschain.defi.ez_bridge_activity
    where platform in ('wormhole') and block_timestamp::date>='2024-01-01'
    and source_chain in ('solana')),

    table3 as (select block_timestamp, sender as user
    from aptos.defi.ez_bridge_activity
    where source_chain in ('Aptos','aptos') and platform in ('wormhole')
    and block_timestamp::date>='2024-01-01'),

    table4 as (with tab1 as (select address
    from sei.core.dim_labels
    where label_type='bridge' and label='wormhole'),

    tab2 as (select block_timestamp, tx_id, sender, receiver, amount, currency
    from sei.core.fact_transfers
    where tx_succeeded='TRUE')

    select block_timestamp, sender as user
    from tab1 left join tab2 on tab1.address=tab2.receiver
    where currency='usei' and block_timestamp::date>='2024-01-01')

    select * from table1 union all
    select * from table2 union all
    select * from table3 union all
    select * from table4