Query editor
WITH deposit AS (SELECTdate_trunc('hour', evt_block_time) AS hour,SUM(amount / 1e18) AS deposit_ethFROM aztec_caa_sale_ethereum.continuousclearingauction_evt_bidsubmittedWHERE evt_block_time >= CAST('{{after this time}}' AS timestamp)GROUP BY 1),withdraw AS (SELECTdate_trunc('hour', evt_block_time) AS hour,SUM(currencyRefunded / 1e18) AS withdraw_ethFROM aztec_caa_sale_ethereum.continuousclearingauction_evt_bidexitedWHERE evt_block_time >= CAST('{{after this time}}' AS timestamp)GROUP BY 1),combined AS (SELECTCOALESCE(d.hour, w.hour) AS hour,COALESCE(d.deposit_eth, 0) AS deposit_eth,COALESCE(w.withdraw_eth, 0) AS withdraw_eth,COALESCE(d.deposit_eth, 0) - COALESCE(w.withdraw_eth, 0) AS net_ethFROM deposit dFULL OUTER JOIN withdraw wON d.hour = w.hour)SELECThour,deposit_eth,withdraw_eth,net_eth,SUM(net_eth) OVER (ORDER BY hour ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cumulative_net_ethFROM combinedORDER BY hour;