Query editor
withtemp as (SELECTdate_trunc('{{time}}', block_date) as date_time,COUNT(tx_hash) as number_of_swaps,SUM(amount_usd) as volume,COUNT(DISTINCT (tx_from)) as active_tradersFROM dex.tradesWHERE blockchain = 'ethereum'and DATE(block_date) >= DATE('2020-06-01')and amount_usd > 0and tx_hash != 0x17db54b928c3d09fbb4a4e5155f9e3eec65f0ab8ec248609d85bb5acfb03b4d5and date_trunc('month',block_time) != date_trunc('month',current_timestamp)GROUP BY date_trunc('{{time}}', block_date)ORDER BY date_trunc('{{time}}', block_date) DESC)SELECT*,SUM(number_of_swaps) OVER (ORDER BYdate_time) as cumulative_swaps,SUM(volume) OVER (ORDER BYdate_time) as cumulative_volumeFROM tempORDER BY date_time DESC