mariyaTotal bridge amount
    Updated 2022-11-25
    select
    'Solana -> Ethereum' as type,
    substring(INPUT_DATA, 202, 1) as chain_id,
    count(DISTINCT tx_hash) as tx_cnt,
    count(DISTINCT from_address) as user_cnt,
    sum(amount_usd) as volume, min (amount_usd) as Min_Volume_Bridge,
    avg (amount_usd) as Avg_Volume_Bridge, median (amount_usd) as Med_Volume_Bridge, max (amount_usd) as Max_Volume_Bridge
    from ethereum.core.fact_transactions join ethereum.core.ez_token_transfers USING(tx_hash)
    where to_address in (lower('0x3ee18b2214aff97000d974cf647e7c347e8fa585'))
    and origin_function_signature = '0xc6878519'
    and chain_id = '1'
    and block_timestamp >= '2022-10-01'
    group by 1,2
    union all
    select
    'Ethereum -> Solana' as type,
    substring(INPUT_DATA, 202, 1) as chain_id,
    count(DISTINCT tx_hash) as tx_cnt,
    count(DISTINCT from_address) as user_cnt,
    sum(amount_usd) as volume, min (amount_usd) as Min_Volume_Bridge,
    avg (amount_usd) as Avg_Volume_Bridge, median (amount_usd) as Med_Volume_Bridge, max (amount_usd) as Max_Volume_Bridge
    from ethereum.core.fact_transactions join ethereum.core.ez_token_transfers USING(tx_hash)
    where to_address in (lower('0x3ee18b2214aff97000d974cf647e7c347e8fa585'))
    and origin_function_signature in ( '0x0f5287b0','0x9981509f')
    and chain_id = '1'
    and block_timestamp >= '2022-10-01'
    group by 1,2

    Run a query to Download Data