Hessishpli - ucd 2
    Updated 2025-03-03
    with dep_tx as
    (select
    case when CONTRACT_ADDRESS = '0x924f1bf31b19a7f9695f3fc6c69c2ba668ea4a0a' then 'USDC' else 'USDT'
    end as token,
    CAST(ethereum.public.udf_hex_to_int(data) AS NUMERIC) / 1e6 AS amount,
    ORIGIN_FROM_ADDRESS
    TX_HASH,
    BLOCK_TIMESTAMP
    from monad.testnet.fact_event_logs
    where block_timestamp::date >= '2025-02-19' and
    ORIGIN_FUNCTION_SIGNATURE = '0x47e7ef24'
    and CONTRACT_ADDRESS in ('0x924f1bf31b19a7f9695f3fc6c69c2ba668ea4a0a','0x9ebcd0ab11d930964f8ad66425758e65c53a7df1')
    and ORIGIN_TO_ADDRESS = '0xbcf1415bd456edb3a94c9d416f9298ecf9a2cdd0'),

    wit_tx as
    (select
    case when CONTRACT_ADDRESS = '0x924f1bf31b19a7f9695f3fc6c69c2ba668ea4a0a' then 'USDC' else 'USDT'
    end as token,
    CAST(ethereum.public.udf_hex_to_int(data) AS NUMERIC) / 1e6 AS amount,
    '0x'||SUBSTRING(TOPICS[2], 27) as receiver,
    TX_HASH,
    BLOCK_TIMESTAMP
    from monad.testnet.fact_event_logs
    where block_timestamp::date >= '2025-02-19' and
    ORIGIN_FUNCTION_SIGNATURE = '0x4f065632'
    and CONTRACT_ADDRESS in ('0x924f1bf31b19a7f9695f3fc6c69c2ba668ea4a0a','0x9ebcd0ab11d930964f8ad66425758e65c53a7df1')
    and ORIGIN_TO_ADDRESS = '0xbcf1415bd456edb3a94c9d416f9298ecf9a2cdd0'),

    final as (select
    BLOCK_TIMESTAMP::date as date,
    'deposit' as action,
    sum(amount) as volume
    from dep_tx
    where token = 'USDC'
    group by all

    QueryRunArchived: QueryRun has been archived