Query editor
WITH all_transactions AS (SELECTDATE_TRUNC('day', block_time) AS day,'Deposit' AS category,SUM(value) / 1e18 AS ethFROM ethereum.tracesWHERE"to" = 0xD729345aA12c5Af2121D96f87B673987f354496B AND tx_successGROUP BY1UNION ALLSELECTDATE_TRUNC('day', block_time) AS day,'Withdraw' AS category,-SUM(value) / 1e18 AS ethFROM ethereum.tracesWHERE"from" = 0xD729345aA12c5Af2121D96f87B673987f354496B AND call_type = 'call' AND tx_successGROUP BY1), aggregated AS (SELECTday,SUM(eth) FILTER(WHEREcategory = 'Deposit') AS deposits,SUM(eth) FILTER(WHEREcategory = 'Withdraw') AS withdraw,SUM(eth) AS changesFROM all_transactionsGROUP BY1)SELECTday,deposits,withdraw,changes,SUM(deposits) OVER (ORDER BY day) AS cum_deposits,SUM(withdraw) OVER (ORDER BY day) AS cum_withdraw,SUM(deposits) OVER (ORDER BY day) + SUM(withdraw) OVER (ORDER BY day) AS cum_fethFROM aggregatedORDER BYday