samAverage Fee copy
    Updated 2024-10-29
    -- forked from Masi / Average Fee @ https://flipsidecrypto.xyz/Masi/q/wBtwOp-kR1NO/average-fee



    -- Credit to hess

    with chains as (select date(block_timestamp) as date,
    'Arbitrum' as chain,
    'WETH' as symbol,
    tx_fee
    from arbitrum.core.fact_transactions
    where block_timestamp::date >= '2024-09-01' and block_timestamp < '2024-10-01'
    and status = 'SUCCESS'

    UNION
    select date(block_timestamp) as date,
    'Optimism' as chain,
    'WETH' as symbol,
    tx_fee
    from optimism.core.fact_transactions
    where block_timestamp::date >= '2024-09-01' and block_timestamp < '2024-10-01'
    and status = 'SUCCESS'

    UNION
    select date(block_timestamp) as date,
    'Polygon' as chain,
    'WMATIC' as symbol,
    tx_fee
    from polygon.core.fact_transactions
    where block_timestamp::date >= '2024-09-01' and block_timestamp < '2024-10-01'
    and status = 'SUCCESS'

    UNION
    select date(block_timestamp) as date,
    'Avalanche' as chain,
    'WAVAX' as symbol,
    QueryRunArchived: QueryRun has been archived