Query editor
WITH daily_fees AS (SELECTblock_date AS date,COUNT(*) AS tx_count,-- % of txs using EIP-1559 (type 2)CAST(COUNT(*) FILTER (WHERE type = '2') AS DOUBLE) / COUNT(*) * 100 AS pct_eip1559,-- Gas price (covers all tx types — total per-gas cost to sender)APPROX_PERCENTILE(CAST(gas_price AS DOUBLE), 0.50) / 1e9 AS gasprice_p50_gwei,APPROX_PERCENTILE(CAST(gas_price AS DOUBLE), 0.90) / 1e9 AS gasprice_p90_gwei,APPROX_PERCENTILE(CAST(gas_price AS DOUBLE), 0.99) / 1e9 AS gasprice_p99_gwei,-- Priority fee / tip (above base fee — the actual urgency signal)APPROX_PERCENTILE(CAST(priority_fee_per_gas AS DOUBLE), 0.50) / 1e9 AS prio_p50_gwei,APPROX_PERCENTILE(CAST(priority_fee_per_gas AS DOUBLE), 0.90) / 1e9 AS prio_p90_gwei,APPROX_PERCENTILE(CAST(priority_fee_per_gas AS DOUBLE), 0.99) / 1e9 AS prio_p99_gwei,-- Urgency tail: % paying meaningful tip above floorCAST(COUNT(*) FILTER (WHERE priority_fee_per_gas > 5e8) AS DOUBLE)/ COUNT(*) * 100 AS pct_above_0_5_gwei,CAST(COUNT(*) FILTER (WHERE priority_fee_per_gas > 1e9) AS DOUBLE)/ COUNT(*) * 100 AS pct_above_1_gwei,-- User stated willingness (max tip set by sender)APPROX_PERCENTILE(CAST(max_priority_fee_per_gas AS DOUBLE), 0.90) / 1e9 AS max_prio_p90_gweiFROM bnb.transactionsWHERE block_date BETWEEN DATE '2025-01-01' AND DATE '2026-06-30'GROUP BY block_date),daily_blocks AS (SELECTdate,(to_unixtime(MAX(time)) - to_unixtime(MIN(time))) / NULLIF(COUNT(*) - 1, 0) AS avg_block_time_sec,AVG(CAST(gas_used AS DOUBLE) / NULLIF(gas_limit, 0)) * 100 AS avg_gas_util_pct,AVG(CAST(base_fee_per_gas AS DOUBLE)) / 1e9 AS avg_base_fee_gwei,COUNT(*) AS block_countFROM bnb.blocksWHERE date BETWEEN DATE '2025-01-01' AND DATE '2026-06-30'GROUP BY date)SELECTf.date,ROUND(b.avg_block_time_sec, 3) AS block_time_sec,ROUND(b.avg_gas_util_pct, 1) AS gas_util_pct,ROUND(b.avg_base_fee_gwei, 4) AS base_fee_gwei,f.tx_count,ROUND(f.pct_eip1559, 1) AS pct_eip1559,-- Gas priceROUND(f.gasprice_p50_gwei, 4) AS gasprice_p50_gwei,ROUND(f.gasprice_p90_gwei, 4) AS gasprice_p90_gwei,ROUND(f.gasprice_p99_gwei, 4) AS gasprice_p99_gwei,-- Priority fee / tipROUND(f.prio_p50_gwei, 4) AS prio_p50_gwei,ROUND(f.prio_p90_gwei, 4) AS prio_p90_gwei,ROUND(f.prio_p99_gwei, 4) AS prio_p99_gwei,ROUND(f.pct_above_0_5_gwei, 2) AS pct_above_0_5_gwei,ROUND(f.pct_above_1_gwei, 2) AS pct_above_1_gwei,ROUND(f.max_prio_p90_gwei, 4) AS max_prio_p90_gwei,-- Period label driven by empirical block timeCASEWHEN b.avg_block_time_sec > 2 THEN '1_pre_lorentz (3s)'WHEN b.avg_block_time_sec > 1 THEN '2_lorentz (1.5s)'WHEN b.avg_block_time_sec > 0.6 THEN '3_maxwell (0.75s)'