Query editor
-- Aftermath Perps (iperps). Event types keep the original package id-- 0x3ec740df... across package upgrades, so no package filter is needed.-- Amounts are 1e18 fixed point; one FilledTakerOrder per taker order.-- Distinct perps accounts with a taker or maker fill in the last 24 hours.WITH takers AS (SELECT json_extract_scalar(event_json, '$.taker_account_id') AS account_idFROM sui.eventsWHERE date >= CURRENT_DATE - INTERVAL '1' DAYAND timestamp_ms >= to_unixtime(now() - INTERVAL '24' HOUR) * 1000AND event_type = '0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7::events::FilledTakerOrder'),makers AS (SELECT json_extract_scalar(evt, '$.maker_account_id') AS account_idFROM sui.eventsCROSS JOIN UNNEST(CAST(json_extract(event_json, '$.events') AS ARRAY(JSON))) AS t(evt)WHERE date >= CURRENT_DATE - INTERVAL '1' DAYAND timestamp_ms >= to_unixtime(now() - INTERVAL '24' HOUR) * 1000AND event_type = '0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7::events::FilledMakerOrders')SELECT COUNT(DISTINCT account_id) AS unique_traders_24hFROM (SELECT account_id FROM takersUNION ALLSELECT account_id FROM makers)WHERE account_id IS NOT NULL