fix(kalshi-res): exclude Exotics, add event category cache - #1690
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The previous Kalshi poller had two critical issues making the comparison unfair:
All categories mapped to "other" — Kalshi
/marketsAPI returns nocategoryfield. Every market was hitting thedefault: "other"branch.Exotics (auto-generated parlays) dominated data — The 1000 most recently settled Kalshi markets were 100%
KXMV*multivariate parlays that Kalshi auto-settles algorithmically in 0–200 seconds. These are not prediction market questions and have no equivalent on Polymarket. Their inclusion was pulling Kalshi's p50 to ~3 minutes, which would have read as "Kalshi resolves 20x faster than Polymarket" — technically true but comparing algorithmic settlement to UMA's 2h challenge window.Fix
pollFinalizednow fetches event category lazily via/events/{event_ticker}(in-memory cache, one HTTP call per unique event, ~50–150 events per poll cycle)Exoticsare excluded (and marked recorded to skip on next poll)VPS
Deploy separately after merge (rebuild needed).