Sbhn_NPvisible-emerald
    Updated 2025-05-19
    with price as (
    select hour::date as datee,
    symbol,
    avg(price) as usdprice
    from crosschain.price.ez_prices_hourly
    where symbol in ('UBTC','EZETH','PZETH')
    group by 1,2
    )

    select date_trunc('month',block_timestamp) as date,
    case when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '223' then 'B2 Network'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '1' then 'Ethereum'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '48900' then 'Zircuit'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '42161' then 'Arbitrum'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '34443' then 'Mode'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '59144' then 'Linea'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '10' then 'Optimism'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '8453' then 'Base'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '81457' then 'Blast'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '1329' then 'Sei'
    when ethereum.public.udf_hex_to_int(substr(topic_1,3,len(topic_1))) = '56' then 'BSC'
    else 'Other' end as source_chain,
    count(distinct concat('0x', right(topic_2,40))) as receivers,
    sum(ethereum.public.udf_hex_to_int(substr(data,3,len(data))) / pow(10,18)) as amount,
    sum((ethereum.public.udf_hex_to_int(substr(data,3,len(data))) / pow(10,18))*usdprice) as amount_usd
    from swell.core.fact_event_logs
    join price on block_timestamp::date =datee and symbol=case when contract_address = '0xa166219df110bda97b91e65d4bb4aae4159978b9' then 'EZETH'
    when contract_address = '0x982abbb04f91acc47ad0cb0a11f29d50c5007934' then 'PZETH'
    when contract_address = '0xfa3198ecf05303a6d96e57a45e6c815055d255b1' then 'UBTC' end
    where topic_0 = '0xba20947a325f450d232530e5f5fce293e7963499d5309a07cee84a269f2f15a6'
    and contract_address in ('0xfa3198ecf05303a6d96e57a45e6c815055d255b1','0x982abbb04f91acc47ad0cb0a11f29d50c5007934','0xa166219df110bda97b91e65d4bb4aae4159978b9')
    and origin_to_address = '0x3a464f746d23ab22155710f44db16dca53e0775e'
    group by 1,2

    Last run: 26 days ago
    DATE
    SOURCE_CHAIN
    RECEIVERS
    AMOUNT
    AMOUNT_USD
    1
    2025-02-01 00:00:00.000Ethereum27640.1750294671921674.03150752
    2
    2025-05-01 00:00:00.000Linea10.006918.152943344
    3
    2025-01-01 00:00:00.000Optimism913177.262122073601024.620560049
    4
    2025-01-01 00:00:00.000BSC607.01888172824138.38358085
    5
    2025-01-01 00:00:00.000Sei7021.39677958472634.678929181
    6
    2024-12-01 00:00:00.000Ethereum761650.9643293575956025.61224948
    7
    2024-12-01 00:00:00.000Zircuit26859.2186667213682151.37961706
    8
    2025-03-01 00:00:00.000Optimism446.18718232112942.580199145
    9
    2024-12-01 00:00:00.000B2 Network125600.06439629659178809.943055
    10
    2025-03-01 00:00:00.000Other19331.04676074166264.342075788
    11
    2025-03-01 00:00:00.000Zircuit253.2977292336687.77237343
    12
    2024-12-01 00:00:00.000Linea86390.0065749451372978.3863895
    13
    2025-01-01 00:00:00.000Blast6114.57419653748810.14539328
    14
    2025-04-01 00:00:00.000Arbitrum105.4553155599528.283029313
    15
    2025-05-01 00:00:00.000Sei10.017144.587054781
    16
    2025-01-01 00:00:00.000Other26220.80865382983983.666038042
    17
    2025-03-01 00:00:00.000Arbitrum4216.07489129832121.099238088
    18
    2025-05-01 00:00:00.000Mode112.56340160533998.08413019
    19
    2024-12-01 00:00:00.000Mode49484.5458192491690825.74899725
    20
    2025-01-01 00:00:00.000B2 Network49750.2107051214725576.82745372
    70
    5KB
    24s