Repository navigation
feat(perps): swaps subaccount type + 2026-11-23 spec sync (#588) — 22.16.0 - #589
Merged
Merged
Conversation
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.
Closes #588
Reconciles the 2026-11-23 nightly spec drift (OpenAPI 3.37.0 content-changed, perps OpenAPI, perps SCM/Klear). Release 22.16.0 (minor, additive) folded in.
Spec diff
specs/perps_openapi.yaml:SubaccountTypeenum gainsswaps(cross-margined swaps wallet; subaccount number is its swaps code). User-facing: REST responses withsubaccount_type: "swaps"failed validation before this.specs/openapi.yaml:GET /historical/fillstickernow documented as a comma-separated list of up to 100 tickers (type unchanged, stillstr). Description changes for weather point / concert cancellation / flight disruption create (6h lead time, 7-day concert window, per-account daily limits, location time zone, cover semantics).specs/perps_scm_openapi.yaml(newer than the issue's checksum; synced to latest): description-only — obligationmaintenance_margin_centicentsis the margin change settled, detail delta sign, obligation history cardinality.kalshi/_generated/models.py: regenerated, no diff. Paths 123 → 123, no new endpoints.Changes
SubaccountTypeLiteral+="swaps"(shared byMarginPosition,MarginSubaccountBalance,MarginRiskPosition,MarginFundingHistoryEntry, and perps WS orderbook delta / fill / user-order payloads). Unknown values still rejected.fills/fills_allticker note; weather/concert create docstrings anddocs/resources/markets.md; KlearObligationEntryfield docs anddocs/perps.md.pyproject.toml,kalshi/__init__.py, CHANGELOG.Blast radius (by hand; GitNexus not installed)
SubaccountTypeLiteralmay see a new unhandled case (typing-only, runtime-safe).EXCLUSIONSchanges. Docstring-only edits elsewhere.Tests
swapsparses on all four REST models and the three WS payloads; unknown value still raises.-W error::UserWarning) ✅ — see counts in the comment below/CI.