Query editor
-- Monthly Ethereum blob fees, post-Dencun.-- Uses the same daily-first aggregation pattern as the verified annual query.-- Pairs with the pre-Dencun calldata query to produce the full Dencun transition chart.WITH blob_txs AS (SELECTt.block_date,t.hash,CAST(CARDINALITY(t.blob_versioned_hashes) AS DOUBLE) * 131072.0 AS blob_gas_used_dblFROM ethereum.transactions tWHERE t.block_date >= DATE '2024-03-13'AND CARDINALITY(t.blob_versioned_hashes) > 0),blob_prices AS (SELECTblock_date,tx_hash,CAST(MAX(blob_gas_price) AS DOUBLE) AS blob_gas_price_dblFROM ethereum.logsWHERE block_date >= DATE '2024-03-13'AND blob_gas_price > 0GROUP BY block_date, tx_hash),eth_price AS (SELECTDATE(minute) AS day,AVG(price) AS eth_usdFROM prices.usdWHERE symbol = 'ETH'AND blockchain IS NULLAND minute >= TIMESTAMP '2024-03-13 00:00:00'GROUP BY DATE(minute)),daily_blobs AS (SELECTb.block_date,SUM(b.blob_gas_used_dbl * COALESCE(p.blob_gas_price_dbl, 0)) / 1e18 AS blob_fees_ethFROM blob_txs bLEFT JOIN blob_prices pON b.hash = p.tx_hashAND b.block_date = p.block_dateGROUP BY b.block_date),daily_usd AS (SELECTd.block_date,d.blob_fees_eth,d.blob_fees_eth * e.eth_usd AS blob_fees_usdFROM daily_blobs dLEFT JOIN eth_price e ON d.block_date = e.day)SELECTDATE_TRUNC('month', block_date) AS month,ROUND(SUM(blob_fees_eth), 2) AS fees_eth,ROUND(SUM(blob_fees_usd), 0) AS fees_usd