Afonso_DiazGrouping txns
    Updated 2025-02-28
    with pricet as (
    select
    hour::date as date,
    symbol,
    avg(price) as price_usd
    from near.price.ez_prices_hourly
    group by 1, 2

    union
    select
    hour::date as date,
    'ETH',
    avg(price) as price_usd
    from ethereum.price.ez_prices_hourly
    where token_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
    group by 1, 2

    union

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

    t as (
    select
    tx_hash,
    block_timestamp,
    actions as action,
    case
    when a.symbol = 'USDC' then amount_raw / pow(10, 18)
    when a.symbol = 'USDC.e' then amount_raw / pow(10, 18)
    QueryRunArchived: QueryRun has been archived