Query editor
WITH monthly_chain_agg AS (SELECTDATE_TRUNC('month', block_time) AS month,blockchain,COUNT(*) AS swaps,COUNT(DISTINCT taker) AS users,SUM(amount_usd) AS volumeFROM (SELECT * FROM sushiswap_agg.tradesUNION ALLSELECT * FROM dune.sushi_labs.result_rp_trades_spellbook_pr)GROUP BY 1, 2)SELECTmonth,blockchain,swaps,users,volume,SUM(swaps) OVER (PARTITION BY blockchain ORDER BY month) AS swaps_cumulative,SUM(users) OVER (PARTITION BY blockchain ORDER BY month) AS users_cumulative,SUM(volume) OVER (PARTITION BY blockchain ORDER BY month) AS volume_cumulativeFROM monthly_chain_aggORDER BY month, blockchain;