Query editor
WITH tokenomics AS (SELECT'Initial Airdrop' AS distribution_type,1500000 AS token_amount,TRY_CAST('2021-01-20' AS DATE) AS distribution_dateUNION ALLSELECT'Initial Contributors, Angel Investors, and Foundation' AS distribution_type,36000000 AS token_amount,TRY_CAST('2021-01-01' AS DATE) AS distribution_dateUNION ALLSELECT'Stake DAO Foundation' AS distribution_type,4000000 AS token_amount,NULL AS distribution_dateUNION ALLSELECT'Protocol Users' AS distribution_type,57352941 AS token_amount,NULL AS distribution_dateUNION ALLSELECT'Treasury' AS distribution_type,1147059 AS token_amount,NULL AS distribution_date), inflation AS (SELECT(SELECTMAX(number)FROM ethereum.blocks) - call_block_number AS block_difference,_sdtPerBlock / POWER(10, 18) AS emission_rate_per_blockFROM stakedao_ethereum.masterchef_call_setSdtPerBlock)SELECTdistribution_type,token_amount,CASEWHEN distribution_date IS NULLTHEN 'Undisclosed'ELSE TRY_CAST(distribution_date AS VARCHAR)END AS distribution_date,SUM(block_difference * emission_rate_per_block) AS total_inflationFROM tokenomicsCROSS JOIN inflationGROUP BYdistribution_type,token_amount,3