Skip to content

fix(kalshi-res): watchlist filter + event category cache - #1691

Merged
Flotapponnier merged 3 commits into
devfrom
fix/kalshi-res-category-exotics
Jul 29, 2026
Merged

fix(kalshi-res): watchlist filter + event category cache#1691
Flotapponnier merged 3 commits into
devfrom
fix/kalshi-res-category-exotics

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Replaces the Exotics-via-category-API approach with a cleaner structural fix.

Root cause insight: Exotics (auto-generated multivariate parlays) auto-settle so fast they skip the status=closed state entirely — they go open→finalized in seconds. The pollClosed() endpoint (status=closed) therefore never returns them, so the watched map is naturally Exotics-free.

Fix: pollFinalized() now only emits for markets in watched. Markets not in the watchlist (Exotics + any market outside the lookback window) are marked recorded and skipped. No explicit category filter needed.

Category: still fetched from /events/{event_ticker} (lazy cache) for proper labeling. Category mapping: Sports→sports, Politics/Elections→politics, Crypto/Financials→crypto, rest→other.

Tradeoff: no 30-day historical backfill for Kalshi (can't know which historical markets went through "closed" before harness started). Data accumulates going forward. Polymarket still gets its 7-day on-chain backfill.

Bench YAML methodology note updated accordingly.

…ache

- pollFinalized now fetches category from /events/{event_ticker} (cached)
- Exotics (KXMV* multivariate parlays) excluded: settle algorithmically
  in 0-200s, not comparable to prediction market questions
- Category mapping: Sports->sports, Politics/Elections->politics,
  Crypto/Financials->crypto, rest->other
- settlement_ts used for exact delay (not poll-time proxy)
- Bench YAML methodology + disclaimer updated with anchor asymmetry note
@Flotapponnier
Flotapponnier merged commit 7dfc138 into dev Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant