Query editor
-- Theoretical cost of one tx on OP Stack chains, without priority fee:-- total = L1 data fee + L2 base fee + operator fee-- for a tx using 350,000 L2 gas whose signed, RLP-encoded bytes FastLZ-compress to 1,000 bytes-- (Midnight liquidation, 10 collaterals, simple swap callback).-- Aggregation follows dune.com/queries/8834380: min per bucket, then max of those minimums-- over the 12 months ending at the end of {{date}}'s month.---- Sources (pinned commits):-- GasPriceOracle.sol https://github.com/ethereum-optimism/optimism/blob/9837d958623d7e2833e5fc35a765a71ccdaa5c7a/packages/contracts-bedrock/src/L2/GasPriceOracle.sol-- L1Block.sol https://github.com/ethereum-optimism/optimism/blob/9837d958623d7e2833e5fc35a765a71ccdaa5c7a/packages/contracts-bedrock/src/L2/L1Block.sol-- op-geth rollup_cost.go https://github.com/ethereum-optimism/op-geth/blob/79e9d244748a1201fe686ca8a882b5fe7e173348/core/types/rollup_cost.go-- The node (op-geth) charges the fee; GasPriceOracle mirrors it on-chain. Both give the same result:-- checked to the wei against receipt l1Fee on optimism, worldchain, unichain and katana.WITH attrs AS (-- Per-block fee inputs come from the calldata of the L1 attributes deposit tx, which the-- sequencer sends to L1Block at the start of every block (L1Block.sol#L155-L230).SELECT 'optimism' AS chain, t.block_time AS time, b.base_fee_per_gas, t.dataFROM optimism.transactions tJOIN optimism.blocks b ON b.number = t.block_number AND b.date = t.block_dateWHERE t.block_date >= CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTH - INTERVAL '1' YEARAND t.block_date < CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTHAND t.index = 0 -- L1 attributes deposit is always the first tx of a blockAND t.to = 0x4200000000000000000000000000000000000015 -- L1Block predeployAND varbinary_substring(t.data, 1, 4) IN (0x440a5e20, -- setL1BlockValuesEcotone()0x098999be, -- setL1BlockValuesIsthmus()0x3db6be2b -- setL1BlockValuesJovian())UNION ALLSELECT 'worldchain' AS chain, t.block_time AS time, b.base_fee_per_gas, t.dataFROM worldchain.transactions tJOIN worldchain.blocks b ON b.number = t.block_number AND b.date = t.block_dateWHERE t.block_date >= CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTH - INTERVAL '1' YEARAND t.block_date < CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTHAND t.index = 0 -- L1 attributes deposit is always the first tx of a blockAND t.to = 0x4200000000000000000000000000000000000015 -- L1Block predeployAND varbinary_substring(t.data, 1, 4) IN (0x440a5e20, -- setL1BlockValuesEcotone()0x098999be, -- setL1BlockValuesIsthmus()0x3db6be2b -- setL1BlockValuesJovian())UNION ALLSELECT 'unichain' AS chain, t.block_time AS time, b.base_fee_per_gas, t.dataFROM unichain.transactions tJOIN unichain.blocks b ON b.number = t.block_number AND b.date = t.block_dateWHERE t.block_date >= CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTH - INTERVAL '1' YEARAND t.block_date < CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTHAND t.index = 0 -- L1 attributes deposit is always the first tx of a blockAND t.to = 0x4200000000000000000000000000000000000015 -- L1Block predeployAND varbinary_substring(t.data, 1, 4) IN (0x440a5e20, -- setL1BlockValuesEcotone()0x098999be, -- setL1BlockValuesIsthmus()0x3db6be2b -- setL1BlockValuesJovian())UNION ALLSELECT 'katana' AS chain, t.block_time AS time, b.base_fee_per_gas, t.dataFROM katana.transactions tJOIN katana.blocks b ON b.number = t.block_number AND b.date = t.block_dateWHERE t.block_date >= CAST(date_trunc('month', CAST('{{date}}' AS timestamp)) AS date) + INTERVAL '1' MONTH - INTERVAL '1' YEAR