Query editor
/* ──────────────────────────────────────────────────────────────PARAMETERS & DEFINITIONS──────────────────────────────────────────────────────────────── *//* Units & conversions-------------------------------------------------------------• 1 Ggas = 1 000 000 000 gas• 1 Mgas = 1 000 gas• RPG = ETH revenue / Ggas block‑space utilised----------------------------------------------------------------*//* ──────────────────────────────────────────────────────────────0. Raw block‑level data (gas used, fee curves)──────────────────────────────────────────────────────────────── */WITH block_data AS (SELECTDATE_TRUNC('day', bl.time) AS day,bl.number AS block_number,bl.gas_used AS block_gas_used, -- L2 gasbl.parent_beacon_block_root AS blob_id,bl.base_fee_per_gas / 1e9 AS base_fee_per_gas_gweiFROM base.blocks blWHERE bl.time >= DATE '2025-01-01'),/* ──────────────────────────────────────────────────────────────1. Base‑L2 revenue (includes L1 security fees paid by users)──────────────────────────────────────────────────────────────── */base_l2_metrics AS (SELECTDATE_TRUNC('day', t.block_time) AS day,SUM(CAST(t.gas_used AS double) * CAST(t.gas_price AS double) / 1e18)AS l2_total_revenue_eth,SUM(CAST(t.l1_fee AS double) / 1e18) AS l1_revenue_eth,SUM(t.gas_used) AS l2_gas_usedFROM base.transactions tWHERE t.block_time >= DATE '2025-01-01'GROUP BY 1),/* ──────────────────────────────────────────────────────────────2. L1 cost buckets – storage blobs, calldata, state‑roots,blob‑tx execution, etc.──────────────────────────────────────────────────────────────── */blob_submission_fees AS (SELECTDATE_TRUNC('day', b.beacon_slot_time) AS day,SUM(CAST(b.blob_gas_used AS double) * CAST(b.blob_base_fee AS double) / 1e18)AS blob_storage_cost_ethFROM ethereum.blobs bWHERE b.blob_submitter =0x5050f69a9786f081509234f1a7f4684b5e5b76c9AND b.beacon_slot_time >= DATE '2025-01-01'GROUP BY 1),transaction_execution_fees AS (SELECTDATE_TRUNC('day', et.block_time) AS day,