Query editor
WITH Inflows AS (-- Calculate the inflows to the contract and add 7 days for unstake timeSELECTevt_block_time AS Time,value / POWER(10, 18) AS Inflow,DATE_ADD('day', 7, evt_block_time) AS Unstake -- Add 7 days for unstakeFROM erc20_ethereum.evt_TransferWHERE"to" = 0x4655b6a10c83d6beff1dc7116436cfd8b4f8d48a -- Replace with the correct contract addressAND evt_block_time >= TRY_CAST('2024-10-03 16:00:00' AS TIMESTAMP)ORDER BY Time ASC)SELECTDATE_TRUNC('hour', Time) AS Hour, -- Group by hourSUM(Inflow) AS Total_Hourly_Inflow, -- Sum inflow events per hourMAX(Unstake) AS Latest_Unstake -- Show the latest unstake time in each hourFROM InflowsGROUP BY DATE_TRUNC('hour', Time) -- Group by the same expression used in SELECTORDER BY Hour ASC