Query editor
-- Sui transaction-block composition: three mutually exclusive categories.-- Same perps/vaults/position package list and gas-null rule as query 9074704.-- Successful and failed transactions included; system flag takes precedence.-- Each point is an exact 24h window ending at the displayed UTC hour.-- 31 days are scanned to warm up the first day of the 30-day chart.WITH bounds AS (SELECT DATE_TRUNC('hour', CURRENT_TIMESTAMP) AS window_end), base AS (SELECTDATE_TRUNC('hour', FROM_UNIXTIME(t.timestamp_ms / 1000)) AS hour,t.is_system_txn,COALESCE((t.packages LIKE '%3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7%' OR t.packages LIKE '%e54757433d663835bda85cfc89c6c44bc8d952e941affa5ae57bba0baa226c1b%')OR (t.packages LIKE '%bab1b714c5533a46ee27a9c124d6f9281ca54831fc288d4d0c133dae3a57254a%' OR t.packages LIKE '%2b741712605799d9627a8a04d429cc03c14047d0eeab30af6788d3c24f8e889d%' OR t.packages LIKE '%a7a4d5abbf6f352d9f9525159215a829e2c39487f1afea3ac9b981972329d05f%')OR t.packages LIKE '%9196fffe0341b2f0ca7424926b22d9e9e35b4807a1f625fc20eeea1382d08dec%',false) AS is_afFROM sui.transactions t CROSS JOIN bounds bWHERE t.date >= CURRENT_DATE - INTERVAL '32' DAYAND t.total_gas_cost IS NOT NULLAND t.timestamp_ms >= CAST(TO_UNIXTIME(b.window_end - INTERVAL '31' DAY) * 1000 AS BIGINT)AND t.timestamp_ms < CAST(TO_UNIXTIME(b.window_end) * 1000 AS BIGINT)), hourly AS (SELECThour,COUNT(*) AS all_tx,COUNT(*) FILTER (WHERE is_system_txn = false AND is_af) AS af_tx,COUNT(*) FILTER (WHERE is_system_txn = true) AS system_tx,COUNT(*) FILTER (WHERE is_system_txn = false AND NOT is_af) AS other_tx,COUNT(*) FILTER (WHERE is_system_txn IS NULL) AS unknown_txFROM base GROUP BY 1), rolling AS (SELECThour + INTERVAL '1' HOUR AS time,SUM(all_tx) OVER w AS all_tx_24h,SUM(af_tx) OVER w AS af_tx_24h,SUM(system_tx) OVER w AS system_tx_24h,SUM(other_tx) OVER w AS other_tx_24h,SUM(unknown_tx) OVER w AS unknown_tx_24hFROM hourlyWINDOW w AS (ORDER BY hour RANGE BETWEEN INTERVAL '23' HOUR PRECEDING AND CURRENT ROW))SELECTtime,100.0 * af_tx_24h / NULLIF(all_tx_24h, 0) AS "Aftermath Perps + AFLP",100.0 * system_tx_24h / NULLIF(all_tx_24h, 0) AS "System transactions",100.0 * other_tx_24h / NULLIF(all_tx_24h, 0) AS "Other non-system transactions",af_tx_24h,system_tx_24h,other_tx_24h,all_tx_24h,unknown_tx_24h,all_tx_24h - af_tx_24h - system_tx_24h - other_tx_24h AS classification_gap_24h,100.0 * af_tx_24h / NULLIF(af_tx_24h + other_tx_24h, 0) AS af_non_system_share_24h_pctFROM rolling CROSS JOIN bounds bWHERE time >= b.window_end - INTERVAL '30' DAYORDER BY time;