Query editor
WITHeth_contracts AS (SELECT DISTINCT address FROM ethereum.contracts),eth_txns AS (SELECTDATE_TRUNC('month', block_time) AS month,COUNT(*) AS tx_count,SUM(gas_used) AS total_gas_usedFROM ethereum.transactions txLEFT JOIN eth_contracts c ON tx.to = c.addressWHERE c.address IS NULLAND block_time >= TIMESTAMP '2024-01-01'GROUP BY 1),op_contracts AS (SELECT DISTINCT address FROM optimism.contracts),op_txns AS (SELECTDATE_TRUNC('month', block_time) AS month,COUNT(*) AS tx_count,SUM(gas_used) AS total_gas_usedFROM optimism.transactions txLEFT JOIN op_contracts c ON tx.to = c.addressWHERE c.address IS NULLAND block_time >= TIMESTAMP '2024-01-01'GROUP BY 1)SELECTCOALESCE(e.month, o.month) AS month,ROUND(e.total_gas_used * 1.0 / e.tx_count, 2) AS gas_per_tx_ethereum,ROUND(o.total_gas_used * 1.0 / o.tx_count, 2) AS gas_per_tx_optimismFROM eth_txns eFULL OUTER JOIN op_txns o ON e.month = o.monthORDER BY month;