Query editor
WITHtrades AS (SELECTevt_block_time AS block_time,evt_block_number AS block_number,IF(isBuy, 'Buy', 'Sell') AS type,coreAmount,IF(isBuy,CAST(coreAmount AS INT256),- CAST(coreAmount AS INT256)) AS coreAmountDelta,(ethAmount / 1e18) / coreAmount AS corePriceETH,ethAmount / 1e18 AS volumeETH,protocolEthAmount / 1e18 AS feeETH,supply,trader,evt_tx_hashFROMcipher_arbitrum.Cipher_evt_TradeWHEREsubject = {{address}}AND ethAmount > CAST(0 AS UINT256)AND coreAmount > CAST(0 AS UINT256)),firstTraderOccurrences AS (SELECTtrader,MIN(block_time) AS firstTradeTimestampFROMtradesGROUP BYtrader),tradesWithFirstUserOccurence AS (SELECTtrades.*,supply * corePriceETH AS mcapETH,trades.trader,SUM(coreAmount) OVER (ORDER BYblock_number) AS cumulative_coresTraded,SUM(volumeETH) OVER (ORDER BYblock_number) AS cumulative_volumeETH,SUM(feeETH) OVER (ORDER BYblock_number) AS cumulative_feeETH,SUM(COALESCE(COUNT(DISTINCT (firstTraderOccurrences.trader)),0)) OVER (ORDER BYblock_number) AS cumulative_numberOfTraders