Query editor
with eth_transactions as (SELECTdate_trunc('day',block_time) as time,(percentile_cont(0.5) within group (order by gas_price))/1e9 as med_eth_gas_price,(percentile_cont(0.5) within group (order by gas_price*gas_used)/1e18) as med_eth_tx_costFROM ethereum.transactionswhere success = 'True'And block_time >= (date_trunc('day',CURRENT_TIMESTAMP) - '180 days'::INTERVAL)group by timeorder by time),arb_transactions as(SELECTdate_trunc('day',block_time) as time,(percentile_cont(0.5) within group (order by gas_price))/1e9 as med_arb_gas_price,(percentile_cont(0.5) within group (order by gas_price*gas_used)/1e18) as med_arb_tx_costFROM arbitrum.transactionswhere success = 'True'ANd block_time >= (date_trunc('day',CURRENT_TIMESTAMP) - '180 days'::INTERVAL)group by timeorder by time),op_transactions as (SELECTdate_trunc('day',block_time) as time,(percentile_cont(0.5) within group (order by gas_price))/1e9 as med_op_gas_price,(percentile_cont(0.5) within group (order by l1_fee_scalar*l1_gas_used*l1_gas_price )/1e18) as med_opl1_gas_price,(percentile_cont(0.5) within group (order by gas_price*gas_used)/1e18) as med_op_tx_costFROM optimism.transactionswhere success = 'True'ANd block_time >= (date_trunc('day',CURRENT_TIMESTAMP) - '180 days'::INTERVAL)group by timeorder by time),prices as (selectdate_trunc('day',minute) as time,avg(price) as price from prices.usdwhere minute >= (date_trunc('day',CURRENT_TIMESTAMP) - '180 days'::INTERVAL)and symbol = 'WETH'group by timeorder by time)SELECTeth_transactions.time, med_eth_gas_price,med_arb_gas_price,med_op_gas_price,( med_eth_tx_cost*price) as eth_tx_cost,( med_arb_tx_cost*price) as arb_tx_cost,( med_op_tx_cost*price)+ (med_opl1_gas_price*price) as op_tx_cost,