Query editor
WITH daily_batches AS (SELECT date_trunc('{{Time interval}}', evt_block_time) as time, count(*) as batchesFROM gnosis_protocol_v2."GPv2Settlement_evt_Settlement"GROUP by time),daily_trades AS (SELECT date_trunc('{{Time interval}}', evt_block_time) as time, count(*) as tradesFROM gnosis_protocol_v2."GPv2Settlement_evt_Trade"GROUP by time)SELECT time, batches, trades, cow_simulation,sum(cow_simulation) over (order by time asc rows between unbounded preceding and current row) as cumulative_cow_simFROM (SELECT b.time as time, batches, trades, batches*100 as cow_simulationFROM daily_batches bJOIN daily_trades tON t.time = b.timeWHERE b.time < date(NOW())) resORDER BY time DESC