Skip to content

fix: cap Kalshi pagination and serialize status=all#874

Merged
realfishsam merged 3 commits into
mainfrom
fix/issue-724-725-kalshi-unbounded
Jun 8, 2026
Merged

fix: cap Kalshi pagination and serialize status=all#874
realfishsam merged 3 commits into
mainfrom
fix/issue-724-725-kalshi-unbounded

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

  • Cap Kalshi's default event pagination at 10 pages so the default fetch path can't bypass the safety ceiling.
  • Run status=all event fetches sequentially instead of launching three concurrent paginations.

Tests

  • npm test --workspace=pmxt-core -- --runInBand test/pipeline/kalshi-pagination.test.ts

Fixes #724
Fixes #725

@realfishsam

Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Caps Kalshi pagination and serializes status=all, reducing risk of unbounded pagination while preserving all-status market/event queries.

Blast Radius

Kalshi fetcher and pagination tests; affects Kalshi listing calls.
Changed files reviewed: core/src/exchanges/kalshi/fetcher.ts, core/test/pipeline/kalshi-pagination.test.ts

Consumer Verification

Before (base branch):
Base branch (origin/main) does not include these changes. I reviewed the diff against the base and did not run full live-exchange before/after reproduction in this daily batch.

After (PR branch):
PR branch build PASS; authenticated local sidecar smoke PASS using POST /api/mock/fetchMarkets with x-pmxt-access-token, response snippet: {"success":true,"data":[{"marketId":"mock-m0","eventId":"mock-event-0","title":"Which party wins the 2026 harborland election?","description":"incididunt magna metus ut cupidatat aliquip dolore quis incididunt id do aenean aenean non dolor dolore tempor pharetra lorem fugiat aenean est voluptate ...

Test Results

  • Build: PASS (npm run build --workspace=pmxt-core)
  • Unit tests: PASS (npm test --workspace=pmxt-core -- --runInBand)
  • Server starts: PASS
  • E2E smoke: PASS (POST /api/mock/fetchMarkets; live venue-specific calls were not made)
  • Dependency install: skipped (existing workspace deps reused)

Findings

No blocking findings.

PMXT Pipeline Check

  • Field propagation (3-layer): N/A
  • OpenAPI sync: N/A
  • Financial precision: OK
  • Type safety: ISSUE
  • Auth safety: N/A

Semver Impact

patch -- bug fix/internal compatibility change unless SDK consumers rely on newly added APIs

Risk

The branch was built, core-tested, and authenticated-smoke-tested through the sidecar. Full live-exchange before/after behavior remains unverified for this daily batch; credentialed venue calls and venue API drift should be treated as residual risk unless covered by tests in this PR.

@realfishsam realfishsam merged commit 807b237 into main Jun 8, 2026
12 checks passed
realfishsam added a commit that referenced this pull request Jun 8, 2026
Covers everything between 2.48.6 and HEAD plus the hosted-trading-mode
work on this branch — Added (7 bullets: hosted trading mode end-to-end,
Escrow namespace, hosted error hierarchy, 2 e2e drivers, 87 new
dispatch + error-mapping tests, feed listing surface), Changed (9
bullets: SDK 2.18.0 version bumps, new model fields, drift parity
sweep, dep refreshes), Fixed (12 bullets covering both the
hosted-mode bugs caught by the live $5 buy + sell and the unrelated
fixes that landed on main since 2.48.6 — #871 #870 #873 #874 #875 #876
#877 #879 #663 #872 + the three this branch adds), Docs (2 bullets).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant