Updated 2024-11-08
    with

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

    wbtc_pricet as (
    select
    hour::date as date,
    avg(price) as token_price_usd
    from
    ethereum.price.ez_prices_hourly
    where
    token_address = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599'
    group by 1
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    decoded_log:token::string as token_address,
    decoded_log:shares::bigint as amount_unadj,
    decoded_log:staker::string as user,
    'Stake' as event_name
    from
    core.core.ez_decoded_event_logs
    where
    origin_to_address = '0x00b67e4805138325ce871d5e27dc15f994681bc1'
    and tx_succeeded
    QueryRunArchived: QueryRun has been archived