Query editor
WITHt AS (SELECT1 AS n,evt_block_timeFROMliquity_ethereum.BorrowerOperations_evt_TroveCreatedUNION ALLSELECT-1 AS n,evt_block_timeFROMliquity_ethereum.BorrowerOperations_evt_TroveUpdatedWHERE_coll = CAST(0 AS UINT256)UNION ALLSELECT-1 AS n,evt_block_timeFROMliquity_ethereum.TroveManager_evt_TroveUpdatedWHERE_coll = CAST(0 AS UINT256)),h AS (SELECTDATE_TRUNC('hour', evt_block_time) AS hour,SUM(n) AS troveCountChangeFROMtGROUP BY1)SELECThour,SUM(troveCountChange) OVER (ORDER BYhour) AS numberOfTrovesFROMhORDER BY1/* v1 codewith t as (select 1 as n, "evt_block_time"from liquity."BorrowerOperations_evt_TroveCreated"union allselect -1 as n, "evt_block_time"from liquity."BorrowerOperations_evt_TroveUpdated"where "_coll" = 0union allselect -1 as n, "evt_block_time"from liquity."TroveManager_evt_TroveUpdated"where "_coll" = 0