From b5508b521b72f3f62e3262f5c4804419b38fe897 Mon Sep 17 00:00:00 2001 From: jaxperro Date: Wed, 8 Jul 2026 11:59:36 -0400 Subject: [PATCH] sharps: _open_split folds by the data-api redeemable flag, not price-pinning Audit of the two biggest All-Time-vs-PM divergences (oliman2, leegunner) proved the fold-in RIGHT and PM's leaderboard wrong: live per-position sums reproduce our numbers to the dollar (oliman2 +181,594 closed -160,644 abandoned = ~+19k true vs leaderboard 112k; leegunner +323,707 -58,762 = ~274k true vs 347k). redeemable is exact (set on resolution for winners AND losers); pinning misfolded a few unresolved longshots. Co-Authored-By: Claude Fable 5 --- live/validate_timing.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/live/validate_timing.py b/live/validate_timing.py index b3ec5b68..3f1179b0 100644 --- a/live/validate_timing.py +++ b/live/validate_timing.py @@ -117,9 +117,15 @@ def _open_split(w): if not pg: break for p in pg: - cp = p.get("curPrice", 0) or 0 cpnl = p.get("cashPnl") or 0 - if cp <= 0.001 or cp >= 0.999: # decided, just unredeemed + # decided = the data-api's own on-chain resolution flag (redeemable + # is True once the condition reports payouts, winners AND losers — + # verified on oliman2's $10.9k Bad Bunny loser). Price-pinning was + # the old proxy; it misfolded pinned-but-UNRESOLVED longshots as + # realized (measured −$27/−$434 on oliman2/leegunner — small, but + # the 2026-07-08 audit proved the flag exact: closed+redeemable + # decomposition reproduces PM's per-position books to the dollar). + if p.get("redeemable"): resolved.append({"realized_pnl": cpnl, "iv": p.get("initialValue") or 0, "ts": p.get("timestamp") or 0})