Query editor
WITHeth_staked AS (select time as day, sum(sum(daily)) over (order by time) as current_staked from (SELECTdate_trunc('day', block_time) as time,SUM(amount_staked) AS dailyFROM staking_ethereum.depositsgroup by 1union allselect date_trunc('day',block_time) as day, count(distinct validator_index)*-1*32 AS dailyfrom ethereum.withdrawalswhere cast(amount as double)>10*1e9group by 1)agroup by 1),validators as (select day, round(current_staked/32,0) as validatorsfrom eth_staked),daily_block_reward AS (SELECT DISTINCTdate_trunc('day', time) AS day,SUM(CASEWHEN number = 1 THEN 72009990.49947989+5 -- Initial supply from table balances_ethereum.genesis_balances plus inital block rewardWHEN number >1 AND number<4370000 THEN 5 --block reward till byazntium upgradeWHEN number >=4370000 AND number<7280000 THEN 3 -- byzantium upgrad which reduced 5 block rewards down to 3WHEN number >=7280000 AND number<15537393 THEN 2 -- pre-merge rewardELSE 0 END) AS block_rewardsFROM ethereum.blocksGROUP BY 1),daily_burn AS (SELECTdate_trunc('day', time) AS day,SUM(CASE WHEN number >=12965000 THEN gas_used * base_fee_per_gas / 1e18 ELSE 0 END) AS burn --london fork, formula of burn from alchemyFROM ethereum.blocksGROUP BY 1),priority_fee as (SELECTdate_trunc('day', block_time) as day,SUM(cast(a.gas_used as double)*(cast(a.gas_price as double)-cast(base_fee_per_gas as double))/1e18) as priority_fee_rewardFROM ethereum.transactions aleft join ethereum.blocks b on block_number = "number"where date(time) >= date('2021-08-05')group by 1),mev as (select day, mev_rewardfrom query_4068868where date(day) >= date('2021-08-05')),-- Post merge issuance formula from Ben Edgington via eth2book (https://eth2book.info/bellatrix/part2/incentives/issuance/#overall-issuance)-- Methodology from @Dataalwaysdaily_rewards_with_staking AS (SELECT