Query editor
WITH stake_unstake_events AS (SELECTevt_block_time AS time,CASEWHEN tr."from" = 0x0000000000000000000000000000000000000000 THEN CAST(tr.value AS INT256)ELSE -CAST(tr.value AS INT256)END AS amount_changeFROMerc20_ethereum.evt_Transfer trWHEREcontract_address = 0xA663B02CF0a4b149d2aD41910CB81e23e1c41c32 -- sFRAXAND (tr."from" = 0x0000000000000000000000000000000000000000OR tr."to" = 0x0000000000000000000000000000000000000000))-- Manual rowSELECTTIMESTAMP '2023-10-01 00:00:00' AS time, -- Launch date1105253 AS cumulative_sFRAX -- staked pre-launchUNION-- Computed rowsSELECTtime,ROUND(SUM(amount_change) OVER (ORDER BY time ASC) / 1e18,0) + 1105253 AS cumulative_sFRAXFROMstake_unstake_eventsWHERE time >= TIMESTAMP '2023-10-01 00:00:00'ORDER BYtime DESC;