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.-- Taker volume per wallet. Account ids map to wallets through CreatedAccount.WITH accounts AS (SELECTjson_extract_scalar(event_json, '$.account_id') AS account_id,max_by(json_extract_scalar(event_json, '$.user'), timestamp_ms) AS walletFROM sui.eventsWHERE date >= DATE '2026-08-18'-- CreatedAccount is generic over the collateral type, hence LIKEAND event_type LIKE '0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7::events::CreatedAccount<%'GROUP BY 1),fills AS (SELECTjson_extract_scalar(event_json, '$.taker_account_id') AS account_id,(CAST(json_extract_scalar(event_json, '$.quote_asset_delta_bid') AS DOUBLE)+ CAST(json_extract_scalar(event_json, '$.quote_asset_delta_ask') AS DOUBLE)) / 1e18 AS notional_usdFROM sui.eventsWHERE date >= CURRENT_DATE - INTERVAL '30' DAYAND event_type = '0x3ec740df8428aa9c93aaef7f8cc1542ac3194fd014826b51bfe245346d64efc7::events::FilledTakerOrder'),trader_vol AS (SELECTCOALESCE(a.wallet, CONCAT('account ', f.account_id)) AS trader,COUNT(*) AS trade_count,ROUND(SUM(f.notional_usd), 2) AS volume_usdFROM fills fLEFT JOIN accounts a ON a.account_id = f.account_idWHERE f.notional_usd > 0GROUP BY 1)SELECTtrader,trade_count,volume_usd,ROUND(volume_usd / SUM(volume_usd) OVER () * 100, 2) AS volume_share_pctFROM trader_volORDER BY volume_usd DESCLIMIT 20