Sbhn_NPsocial-blue
    Updated 2025-04-04
    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 contract_address = '0xa166219df110bda97b91e65d4bb4aae4159978b9' then 'EZETH'
    when contract_address = '0x982abbb04f91acc47ad0cb0a11f29d50c5007934' then 'PZETH'
    when contract_address = '0xfa3198ecf05303a6d96e57a45e6c815055d255b1' then 'UBTC' end as token,
    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
    from swell.core.fact_event_logs
    where topic_0 = '0xba20947a325f450d232530e5f5fce293e7963499d5309a07cee84a269f2f15a6'
    and contract_address in ('0xfa3198ecf05303a6d96e57a45e6c815055d255b1','0x982abbb04f91acc47ad0cb0a11f29d50c5007934','0xa166219df110bda97b91e65d4bb4aae4159978b9')
    and origin_to_address = '0x3a464f746d23ab22155710f44db16dca53e0775e'
    group by 1,2


    Last run: 23 days ago
    DATE
    TOKEN
    RECEIVERS
    AMOUNT
    1
    2025-02-01 00:00:00.000EZETH443708.02685733
    2
    2024-12-01 00:00:00.000PZETH311105.458386226
    3
    2025-01-01 00:00:00.000PZETH1777.113583656
    4
    2025-04-01 00:00:00.000PZETH10.0542
    5
    2024-12-01 00:00:00.000UBTC143600.103909539
    6
    2024-12-01 00:00:00.000EZETH8462915.623262357
    7
    2025-03-01 00:00:00.000UBTC1110.01792025846
    8
    2025-01-01 00:00:00.000EZETH2740697.626069907
    9
    2025-02-01 00:00:00.000PZETH161393.671164088
    10
    2025-03-01 00:00:00.000PZETH713.708206552
    11
    2025-01-01 00:00:00.000UBTC57250.350744404
    12
    2025-04-01 00:00:00.000UBTC60.0002755051082
    13
    2025-03-01 00:00:00.000EZETH370116.663689137
    14
    2025-02-01 00:00:00.000UBTC1580.04862374773
    15
    2025-04-01 00:00:00.000EZETH213.009046199
    15
    789B
    36s