Query editor
WITH consensus_rewards AS (SELECTdate_trunc('day', block_date) AS block_date,SUM(reward_change) / 1e9 AS consensus_rewards_ethFROM beacon.validator_day_summariesWHERE block_date >= DATE '2022-09-15'GROUP BY 1),priority_fees AS (SELECTdate_trunc('day', b.date) AS block_date,SUM((CAST(t.gas_price AS DECIMAL(38, 0)) - CAST(b.base_fee_per_gas AS DECIMAL(38, 0)))* CAST(t.gas_used AS DECIMAL(38, 0))) / 1e18 AS priority_fee_ethFROM ethereum.transactions tJOIN ethereum.blocks b ON t.block_number = b.numberWHERE t.success = TRUEAND t.gas_price > b.base_fee_per_gasAND t.block_number >= 15537394 -- PoS blockGROUP BY 1),mev_transfers AS (SELECTdate_trunc('day', b.date) AS block_date,SUM(t.value) / 1e18 AS mev_transfer_ethFROM ethereum.transactions tJOIN ethereum.blocks b ON t.block_number = b.numberWHERE t.success = TRUEAND t."to" = b.minerAND t.value > 0AND t.block_number >= 15537394GROUP BY 1)SELECTCOALESCE(c.block_date, p.block_date, m.block_date) AS block_date,p.priority_fee_eth,m.mev_transfer_eth,COALESCE(p.priority_fee_eth, 0) + COALESCE(m.mev_transfer_eth, 0) AS execution_rewards_eth,c.consensus_rewards_eth,COALESCE(c.consensus_rewards_eth, 0) +COALESCE(p.priority_fee_eth, 0) +COALESCE(m.mev_transfer_eth, 0) AS total_eth_rewardsFROM consensus_rewards cFULL OUTER JOIN priority_fees p ON c.block_date = p.block_dateFULL OUTER JOIN mev_transfers m ON COALESCE(c.block_date, p.block_date) = m.block_dateORDER BY block_date