Moeavax fee 1 --
    Updated 2023-03-29
    with
    prc as (
    select
    date(hour)::date date,
    avg(PRICE) as price
    from
    ethereum.core.fact_hourly_token_prices
    where
    SYMBOL ilike 'wavax'
    group by
    1
    )
    select
    date_trunc({{Granularity}}, block_timestamp)::date as days,
    LABEL_TYPE,
    count(distinct TX_hash) as tx_count,
    count(distinct FROM_ADDRESS) as wallets,
    sum(tx_FEE * price) as tot_fees,
    avg(tx_FEE * price) as avg_fees,
    median(tx_FEE * price) as median_fees,
    max(tx_FEE * price) as max_fees,
    tot_fees / wallets as fee_per_sender,
    sum(tot_fees) over (
    partition by
    LABEL_TYPE
    order by
    days rows between unbounded preceding
    and current row
    ) as cum_fees
    from
    avalanche.core.fact_transactions t,
    avalanche.core.dim_labels l,
    prc p
    where
    t.TO_ADDRESS = l.address
    and date = days
    Run a query to Download Data