Sbhn_NPconscious-fuchsia
    Updated 2025-04-09
    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
    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'

    Last run: 15 days ago
    RECEIVERS
    AMOUNT
    AMOUNT_USD
    1
    47487681.47634451888789026.9427781
    1
    40B
    6s