Updated 2025-01-07
    with

    pricet as (
    select
    hour::date as date,
    token_address,
    avg(price) as token_price_usd
    from
    mantle.price.ez_prices_hourly
    group by 1, 2
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    decoded_log:amount as amount_unadj,
    decoded_log:staker as staker,
    decoded_log:token as token_address,
    amount_unadj / pow (10, b.decimals) as amount,
    amount * token_price_usd as amount_usd,
    b.symbol,
    event_name
    from
    mantle.core.ez_decoded_event_logs
    left join
    pricet on block_timestamp::date = pricet.date and pricet.token_address = decoded_log:token::string
    left join
    mantle.core.dim_contracts b on b.address = decoded_log:token::string
    where
    origin_to_address = '0x5e4acca7a9989007cd74ae4ed1b096c000779dcc'
    and tx_succeeded
    and event_name in ('Deposit', 'Withdraw')
    )

    select
    QueryRunArchived: QueryRun has been archived