Afonso_DiazGrouping Transactions(volume usd) copy
    Updated 2024-05-29
    with

    pricet as (
    select
    hour::date as date,
    avg(price) as price_usd
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'WETH'
    group by 1
    ),

    t as (
    select
    tx_hash,
    block_timestamp,
    'Deposit' as action,
    decoded_log:assets/1e18 as amount,
    decoded_log:owner as user
    from ethereum.core.ez_decoded_event_logs
    where origin_function_signature = '0x2d2da806'
    and origin_to_address = '0x48afbbd342f64ef8a9ab1c143719b63c2ad81710'
    and tx_status = 'SUCCESS'
    and event_name = 'Deposit'

    union all

    select
    tx_hash,
    block_timestamp,
    'Withdraw' as action,
    decoded_log:assets/1e18 as amount,
    decoded_log:owner as user
    from ethereum.core.ez_decoded_event_logs
    where origin_function_signature = '0xba087652'
    and origin_to_address = '0x48afbbd342f64ef8a9ab1c143719b63c2ad81710'
    and tx_status = 'SUCCESS'
    QueryRunArchived: QueryRun has been archived