Query editor
witheth_price as (SELECTday,priceFROM(SELECTDATE_TRUNC('day', minute) day,price,RANK() OVER (PARTITION BYDATE_TRUNC('day', minute)ORDER BYminute desc) raFROMprices.usdwheresymbol = 'ETH'and contract_address is nulland blockchain is nulland minute >= DATE('2023-06-01')) AWHEREra = 1),base_data as (SELECTA.day,DATE_TRUNC('month', A.day) month,SUM(stader_reward * price) stader_revenue,SUM(operator_reward * price) operator_rewards,SUM(user_reward * price) user_rewardsFROMquery_3327113 ALEFT JOIN eth_price B ON A.day = B.day -- Socialising Pool RewardsGROUP BY1,2UNIONSELECTA.day,DATE_TRUNC('month', A.day) month,SUM(stader_reward * price) stader_revenue,SUM(operator_reward * price) operator_rewards,SUM(user_reward * price) user_rewardsFROMquery_3488635 ALEFT JOIN eth_price B ON A.day = B.day -- CL Rewards DataGROUP BY1,2UNIONSELECTA.day,DATE_TRUNC('month', A.day) month,SUM(stader_reward * price) stader_revenue,SUM(operator_reward * price) operator_rewards,SUM(user_reward * price) user_rewards