hessprincipal-lime
    Updated 2025-06-09
    with zk_import as ( select * from (
    SELECT
    livequery.live.udf_api (
    'https://api.dune.com/api/v1/query/3865859/results?api_key=nPlMJ4JjTsMZcIo0C6kGSt5rpbcoXujU') as resp)
    ,
    table(FLATTEN(parse_json(resp:data:"result":"rows"))))
    ,
    chains as ( select TO_TIMESTAMP(value:"date") as date,
    value:"chain"::string as chain,
    'WETH' as symbol,
    value:"avg_fee"::string as avg_fee
    from zk_import a join ethereum.core.dim_dates b on a.value:"date" = b.date_day

    UNION

    select date(block_timestamp) as date,
    'Arbitrum' as chain,
    'WETH' as symbol,
    avg(tx_fee) as avg_fee
    from arbitrum.core.fact_transactions
    where block_timestamp::date >= current_date - 30
    and TX_SUCCEEDED = 'TRUE'
    group by 1,2,3

    UNION

    select date(block_timestamp) as date,
    'Optimism' as chain,
    'WETH' as symbol,
    avg(tx_fee) as avg_fee
    from optimism.core.fact_transactions
    where block_timestamp::date >= current_date - 30
    and TX_SUCCEEDED = 'TRUE'
    group by 1,2,3

    UNION
    Last run: 27 days ago
    TYPE
    CHAIN
    Avg Fee (USD)
    1
    Other ChainsEthereum1.068485009
    2
    Other ChainsBSC0.04066097368
    3
    Other ChainsLinea0.03622530351
    4
    Other ChainsPolygon Zkevm0.03622530351
    5
    Other ChainsAvalanche0.03466246433
    6
    Other ChainsZkSync0.02324227837
    7
    Other ChainsBase0.0171862805
    8
    Other ChainsArbitrum0.01208945139
    9
    Other ChainsOptimism0.007066647252
    10
    Other ChainsScroll0.006866423339
    11
    Other ChainsPolygon0.003398369505
    12
    Other ChainsBoba0.0009941833798
    13
    Other ChainsInk0.0004467696131
    14
    Other ChainsKaia0.0003020366069
    15
    Other ChainsSwell0.0001174035421
    16
    SeiSei0.0001130257971
    17
    Other ChainsFlow0.00001215902178
    17
    683B
    239s