Skip to content

fix: sync Kalshi spec with upstream API changes#590

Merged
realfishsam merged 1 commit into
mainfrom
fix/542-517-522-433-kalshi-spec
May 24, 2026
Merged

fix: sync Kalshi spec with upstream API changes#590
realfishsam merged 1 commit into
mainfrom
fix/542-517-522-433-kalshi-spec

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #542
Fixes #517
Fixes #522
Fixes #433

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Syncs the Kalshi vendor OpenAPI spec with upstream API changes: adds a subaccount query parameter to the balance endpoint, adds balance_dollars to the balance response schema, adds ts_ms to the order schema, and removes a stale client_order_id field from the fill schema. The generated api.ts is regenerated to match.

Blast Radius

  • core/specs/kalshi/Kalshi.yaml -- vendor spec (source of truth for api.ts generation)
  • core/src/exchanges/kalshi/api.ts -- generated file (regenerated correctly)

Findings

  1. Generated file header leaks local path: api.ts line 2 now reads Auto-generated from /Users/samueltinnerholm/Documents/GitHub/pmxt/.claude/worktrees/agent-a6e1b73d/.... This embeds a user-specific local filesystem path into the committed file. The generation script should use a relative path or a stable placeholder instead.

  2. Removing client_order_id from Fill schema is a breaking change for spec consumers -- any downstream code that relied on client_order_id in the fill response type will break. However, since this reflects an upstream Kalshi API change (the field no longer exists in their response), the spec must track reality.

  3. New fields (balance_dollars, ts_ms, subaccount) are additive -- no normalizer changes needed since these are raw spec fields, not unified types. The normalizer already handles the balance conversion from cents to dollars and does not reference these new fields yet.

PMXT Pipeline Check

  • Field propagation: N/A (vendor spec fields, not unified types)
  • OpenAPI sync: OK (api.ts regenerated from spec)
  • Type safety: OK

Semver Impact

patch -- upstream spec sync; no unified type changes.

Risk

  • The local filesystem path in api.ts should be cleaned up before merge.
  • client_order_id removal is technically breaking for any code parsing raw Kalshi fills, but this reflects upstream reality.

@realfishsam realfishsam merged commit 16aca67 into main May 24, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment