Query editor
-- SuperVega Beta Trading Competition leaderboard — ranks traders by TOTAL PROFIT-- (USDC received from their options; premiums paid are NOT subtracted).---- Profit is credited to the TRADER (option owner), not the tx caller. Auto-exercise-- is fired by the keeper, so OptionToken.Exercised.caller is the exerciser contract,-- NOT the trader. Correct attribution (verified disjoint — no double count):-- 1) EntryExercised.received keyed by owner (auto-exercise) [emitter = exerciser]-- 2) Claimed.quote_out keyed by recipient (post-rebalance) [emitter = option token]-- 3) OptionToken.Exercised.payout keyed by caller, EXCLUDING exerciser callers (manual)---- ── LIVE competition window (9:00 AM UTC boundaries) ──-- 2026-07-07 09:00 → 2026-08-01 09:00 (through the 31 Jul monthly expiry).-- Board starts at $0 and accrues over the window.WITH bounds AS (SELECT TIMESTAMP '2026-07-07 09:00:00' AS comp_start,TIMESTAMP '2026-08-01 09:00:00' AS comp_end),depl AS (SELECT element_at(data,1) AS option_token, element_at(data,3) AS exerciserFROM starknet.eventsWHERE element_at(keys,1)=0x01a524c8138b89479b4211c85519557e5c4e11fa64bef2a5870329b0d64c0a75AND cardinality(data)>=6 AND block_time>=TIMESTAMP '2026-04-01'),option_tokens AS (SELECT DISTINCT option_token AS a FROM depl),exercisers AS (SELECT DISTINCT exerciser AS a FROM depl),wallets AS (SELECT data[3] AS l2,arbitrary(lower('0x' || substr(to_hex(data[2]), length(to_hex(data[2])) - 39))) AS evmFROM starknet.eventsWHERE from_address = 0x0404e345a86c9c6cbd8cbdb33adc8c40e288fbffd29de72897e0b651e5c90cdbAND keys[1] = 0x0347f3a34b919109f055acc8440a003ecda76b4c63c101bbc99b9d00296db557GROUP BY data[3]),income_events AS (SELECT e.keys[3] AS buyer,(varbinary_to_uint256(e.data[4])*power(2,128)+varbinary_to_uint256(e.data[3]))/1e6 AS income_usdFROM starknet.events eJOIN exercisers x ON x.a = e.from_addressCROSS JOIN bounds bWHERE e.keys[1]=0x011edcc3453f7efdada453555d258aa5cd64f08a3e87265f78491925b04a7262AND e.block_time >= b.comp_start AND e.block_time < b.comp_endUNION ALLSELECT e.keys[3] AS buyer,(varbinary_to_uint256(e.data[4])*power(2,128)+varbinary_to_uint256(e.data[3]))/1e6 AS income_usdFROM starknet.events eJOIN option_tokens o ON o.a = e.from_addressCROSS JOIN bounds bWHERE e.keys[1]=0x035cc0235f835cc84da50813dc84eb10a75e24a21d74d6d86278c0f037cb7429AND e.block_time >= b.comp_start AND e.block_time < b.comp_endUNION ALLSELECT e.keys[2] AS buyer,(varbinary_to_uint256(e.data[9])*power(2,128)+varbinary_to_uint256(e.data[8]))/1e6 AS income_usdFROM starknet.events eJOIN option_tokens o ON o.a = e.from_addressLEFT JOIN exercisers x ON x.a = e.keys[2]CROSS JOIN bounds bWHERE e.keys[1]=0x0109ac49d05d059c1a7250eb71799f8652ae52ca110671699d505e48c3d2c2beAND x.a IS NULLAND e.block_time >= b.comp_start AND e.block_time < b.comp_end),