Query editor
with prices AS (SELECTDATE_TRUNC('day', minute) AS dt, AVG(price) AS priceFROM prices.usdWHERE symbol = 'WETH'GROUP BY 1), arb_l2_fee as (SELECTdate_trunc('day', block_time) as dt, SUM(gas_used * effective_gas_price / 1E18) as fee_ethFROM arbitrum.transactionsGROUP BY 1), arb_l1_cost as (with l1_batches as (-- before Nitro Upgrade-- addSequencerL2BatchFromOrigin / addSequencerL2BatchFromOriginWithGasRefunder emit SequencerBatchDeliveredFromOrigin-- addSequencerL2Batch-- after Nitro Upgrade-- addSequencerL2BatchFromOrigin / addSequencerL2Batch emit SequencerBatchDeliveredSELECTevt_tx_hash AS tx_hash, evt_block_time AS block_time, evt_block_number AS block_numberFROM arbitrum_ethereum.SequencerInbox_evt_SequencerBatchDeliveredFromOriginUNION ALLSELECTevt_tx_hash AS tx_hash, evt_block_time AS block_time, evt_block_number AS block_numberFROM arbitrum_ethereum.SequencerInbox_evt_SequencerBatchDeliveredUNION ALLSELECTcall_tx_hash AS tx_hash, call_block_time AS block_time, call_block_number AS block_numberFROM arbitrum_ethereum.SequencerInbox_call_addSequencerL2BatchWHERE call_success = trueAND call_tx_hash NOT IN (SELECTevt_tx_hashFROM arbitrum_ethereum.SequencerInbox_evt_SequencerBatchDelivered)), l1_batches_info as (SELECTet.block_number AS block_number, et.hash, et.block_time AS time, CAST(et.gas_used AS DOUBLE) * CAST(et.gas_price AS DOUBLE) / 1E18 AS l1_costFROM l1_batches lbJOIN ethereum.transactions et ON lb.tx_hash = et.hashAND success = true)SELECTdate_trunc('day', time) as dt