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 = 0x03CB4438d015B9646d666316b617a694410C216d -- sFRAXAND (tr."from" = 0x0000000000000000000000000000000000000000OR tr."to" = 0x0000000000000000000000000000000000000000)), transform as(SELECTtime,amount_change as amount_changeFROMstake_unstake_eventsWHERE time >= TIMESTAMP '2023-10-10 00:00:00'ORDER BYtime DESC), final as(SELECTdate_trunc('day', time) as time, sum(amount_change) as amount_changeFROM transformgroup by 1)selecttime, amount_change / 1e18 as amount_change, ROUND(SUM(amount_change) OVER (ORDER BY time ASC) / 1e18,0) AS cumulative_sFRAXfrom finalorder by time