Query editor
with eth_blocks as (selectdate_trunc('hour', time) + interval '10' minute * floor(minute(time) / 10) as hour,cast(base_fee_per_gas as double) / 1e9 as base_fee_gwei,exp(cast(coalesce(excess_blob_gas, 0) as double) / 11684671.0) / 1e9 as blob_base_fee_gweifrom ethereum.blockswhere time >= now() - interval '{{timerange_hours}}' hour),sepolia_blocks as (selectdate_trunc('hour', time) + interval '10' minute * floor(minute(time) / 10) as hour,cast(base_fee_per_gas as double) / 1e9 as base_fee_gweifrom sepolia.blockswhere time >= now() - interval '{{timerange_hours}}' hour),gas_series as (select hour, 'ethereum_mainnet_l1_base_fee' as series, base_fee_gwei as gweifrom eth_blocksunion allselect hour, 'sepolia_l1_base_fee' as series, base_fee_gwei as gweifrom sepolia_blocksunion allselecthour,'ink_mainnet_est_l1_threshold_price' as series,base_fee_gwei * 0.001728125+ blob_base_fee_gwei * 0.0197956787109375 as gweifrom eth_blocksunion allselecthour,'ink_sepolia_est_l1_threshold_price' as series,base_fee_gwei * 0.313261328125 as gweifrom sepolia_blocks)selecthour,series,cast(round(avg(gwei), 4) as decimal(18, 4)) as avg_gweifrom gas_seriesgroup by 1, 2order by 1 asc, 2 asc