Query editor
WITH events as (SELECTuser,CAST(amount AS DOUBLE) as amount,CAST( poolid as INTEGER ) as poolidFROMconvex_ethereum.Booster_evt_Deposited AS dWHERECAST( poolid as INTEGER ) = {{pool}}UNION ALLSELECTuser,- CAST(amount AS DOUBLE),CAST( poolid as INTEGER ) as poolidFROMconvex_ethereum.Booster_evt_Withdrawn AS dWHERECAST( poolid as INTEGER ) = {{pool}})SELECTuser,amount,SUM(amount) OVER(ORDER BY amount DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS "Cumulative amount",ROW_NUMBER() OVER (ORDER BY amount DESC) as rowFROM (SELECTuser,SUM( amount/1e18 ) as amountFROM eventsGROUP BY 1ORDER by 2 DESC)ORDER BY amount DESC