Query editor
/* For gas feeunit: wei1000000000 wei = 1 Gwei1 eth = 1000000000 Gweitx fee = gas_price * gas_usedBase fee = gas_price - Priority_fee_per_gasEIP 1559 - LondonDencun*/WITHD1 AS (SELECTHOUR(block_time) as TIME,APPROX_PERCENTILE(gas_price,0.5)/1000000000 AS Median_gas_priceFROM ethereum.transactionsWHEREblock_time >= (DATE_TRUNC('hour', CURRENT_TIMESTAMP) - interval '24' hour)GROUP BY 1),D7 AS (SELECTHOUR(block_time) as TIME,APPROX_PERCENTILE(gas_price,0.5)/1000000000 AS Median_gas_priceFROM ethereum.transactionsWHEREblock_time >= (DATE_TRUNC('hour', CURRENT_TIMESTAMP) - interval '7' day)GROUP BY 1),D30 AS (SELECTHOUR(block_time) as TIME,APPROX_PERCENTILE(gas_price,0.5)/1000000000 AS Median_gas_priceFROM ethereum.transactionsWHEREblock_time >= (DATE_TRUNC('hour', CURRENT_TIMESTAMP) - interval '30' day)GROUP BY 1)SELECT D7.TIME, D1.Median_gas_price AS D1, D7.Median_gas_price AS D7, D30.Median_gas_price AS D30FROM D7LEFT JOIN D1 on D7.TIME = D1.TIMEFULL OUTER JOIN D30 on D7.TIME= D30.TIMEORDER BY 1