Query editor
WITHdeposits AS (SELECTpartition_date as block_date,SUM(amount) / 1e9 AS deposits_eth -- Gwei to ETHFROM beacon.depositsGROUP BY 1 ),withdrawals AS(SELECTblock_date,SUM(amount) / 1e9 AS withdrawals_eth -- Gwei to ETHFROM beacon.withdrawalsGROUP BY block_date ),net_flow AS (SELECTCOALESCE(d.block_date, w.block_date) AS block_date,COALESCE(d.deposits_eth, 0) AS daily_deposits_eth,COALESCE(w.withdrawals_eth, 0) AS daily_withdrawals_ethFROM deposits dFULL OUTER JOIN withdrawals wON d.block_date = w.block_date)SELECTblock_date,daily_deposits_eth,daily_withdrawals_eth,daily_deposits_eth - daily_withdrawals_eth AS daily_net_eth,SUM(daily_deposits_eth) OVER (ORDER BY block_date) AS cumulative_deposits_eth,SUM(daily_withdrawals_eth) OVER (ORDER BY block_date) AS cumulative_withdrawals_eth,SUM(daily_deposits_eth - daily_withdrawals_eth) OVER (ORDER BY block_date) AS cumulative_net_eth,daily_withdrawals_eth * -1 AS signed_daily_withdrawals_ethFROM net_flowORDER BY block_date