Query editor
WITH usdc_deposits AS (SELECTDATE_TRUNC('hour', block_time) AS hour,amount_display AS usdc_amountFROM tokens_solana.transfersWHEREtoken_mint_address = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v' -- USDCAND to_owner = '5QsP9vCJZy535n48ZoXNSgFMWyPBegqXBBn4gk6zFkWV' -- Hurupay sale addressAND block_time >= NOW() - INTERVAL '7' day),hourly AS (SELECThour,SUM(usdc_amount) AS total_usdcFROM usdc_depositsGROUP BY hour),stats AS (SELECTAVG(total_usdc) AS avg_24h,SUM(total_usdc) AS last_24h_totalFROM hourlyWHERE hour >= NOW() - INTERVAL '24' hour)SELECTh.hour,h.total_usdc AS hourly_usdc,s.avg_24h AS rolling_24h_avg,SUM(h.total_usdc) OVER (ORDER BY h.hour) AS cumulative_total,s.last_24h_totalFROM hourly hCROSS JOIN stats sORDER BY h.hour DESC