Afonso_DiazUsers Activity
    Updated 2025-03-25
    with

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

    contracts as (
    select
    decimals,
    address,
    symbol
    from
    avalanche.core.dim_contracts
    where
    address != '0xa845cbe370b99addab67afe442f2cf5784d4dc29'

    union all

    select
    18, '0xa845cbe370b99addab67afe442f2cf5784d4dc29', 'aiAVAX'
    ),

    main as (
    select
    tx_hash,
    block_timestamp,
    decoded_log:asset as token_address,
    symbol,
    decoded_log:shares / pow(10, decimals) as amount,
    amount * token_price_usd as amount_usd,
    QueryRunArchived: QueryRun has been archived