Query editor
-- Ethereum mainnet base fee, last 12 months, daily buckets, 30-day moving average (gwei)-- Extra lookback so the moving average is full-width from the first bucket shownWITH buckets AS (SELECTdate_trunc('day', time) AS bucket,min(base_fee_per_gas) / 1e9 AS min_gwei,approx_percentile(base_fee_per_gas, 0.10) / 1e9 AS p10_gwei,approx_percentile(base_fee_per_gas, 0.25) / 1e9 AS p25_gwei,approx_percentile(base_fee_per_gas, 0.50) / 1e9 AS p50_gwei,approx_percentile(base_fee_per_gas, 0.75) / 1e9 AS p75_gwei,approx_percentile(base_fee_per_gas, 0.90) / 1e9 AS p90_gwei,max(base_fee_per_gas) / 1e9 AS max_gwei,count(*) AS blocksFROM ethereum.blocksWHERE date >= current_date - INTERVAL '400' DAYAND time >= now() - INTERVAL '12' MONTH - INTERVAL '30' DAYGROUP BY 1), smoothed AS (SELECT *, avg(p50_gwei) OVER (ORDER BY bucket ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS ma_gweiFROM buckets)SELECT * FROM smoothedWHERE bucket >= now() - INTERVAL '12' MONTHORDER BY bucket