JonasoL2s: on-chain (2)
    Updated 2024-08-26
    with

    A as( select 'ETH' as tag, '⚫️ Ethereum' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from ethereum.stats.ez_core_metrics_hourly
    union all select 'L2s' as tag, '🔵 Arbitrum' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from arbitrum.stats.ez_core_metrics_hourly
    union all select 'L2s' as tag, '🔴 Optimism' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from optimism.stats.ez_core_metrics_hourly
    union all select 'L2s' as tag, '🔵 Base' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from base.stats.ez_core_metrics_hourly
    union all select 'L2s' as tag, '🟡 Blast' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from blast.stats.ez_core_metrics_hourly
    union all select 'L1s' as tag, '🟣 Polygon' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from polygon.stats.ez_core_metrics_hourly
    union all select 'L1s' as tag, '🔴 Avalanche' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from avalanche.stats.ez_core_metrics_hourly
    union all select 'L1s' as tag, '🟡 BNB Chain' as chain, BLOCK_TIMESTAMP_HOUR, TRANSACTION_COUNT_SUCCESS, TOTAL_FEES_USD from bsc.stats.ez_core_metrics_hourly
    ),


    B as(
    select date_trunc('month',BLOCK_TIMESTAMP_HOUR) as time, tag,
    sum(TRANSACTION_COUNT_SUCCESS) as txs, sum(TOTAL_FEES_USD) as fees
    from A
    where tag not in ('ETH')
    and year(BLOCK_TIMESTAMP_HOUR) >= '2024'
    group by 1,2)

    select *
    from B
    order by time desc, tag desc
    QueryRunArchived: QueryRun has been archived