fix(kalshi-res): watchlist filter + event category cache - #1691
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
…ed natural filter
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.
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=closedstate entirely — they go open→finalized in seconds. ThepollClosed()endpoint (status=closed) therefore never returns them, so thewatchedmap is naturally Exotics-free.Fix:
pollFinalized()now only emits for markets inwatched. Markets not in the watchlist (Exotics + any market outside the lookback window) are markedrecordedand 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.