Skip to content

fix(spec): MarketPosition.netting_enabled; Klear history ts filters (#569) — 22.8.0 - #570

Merged
TexasCoding merged 2 commits into
mainfrom
fix/569-spec-drift
Nov 4, 2026
Merged

TexasCoding merged 2 commits into
mainfrom
fix/569-spec-drift

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #569

Spec drift (run 41840096378): core spec 3.35.0 → 3.36.0, perps SCM spec params, AsyncAPI description-only.

Changes

  • MarketPosition.netting_enabled: bool | None = None. The spec marks it required; it's kept optional, with an EXCLUSIONS entry of kind server_omits_despite_required.
  • Klear margin, sync and async, page and *_all:
    • obligation_history: keyword-only settlement_start_ts / settlement_end_ts
    • settlement_balance_history: keyword-only start_ts / end_ts
    • Each accepts datetime | str. A naive datetime is treated as UTC and sent as RFC3339. A parameter is only sent when it isn't None.
  • Version 22.8.0, CHANGELOG, docs (docs/perps.md, docs/resources/portfolio.md).
  • kalshi/_generated/ regenerated by the scripts (no diff).

Blast radius (hand-written; GitNexus unavailable)

  • MarketPosition: new optional field. Existing payloads without it still validate, and extra="allow" is unchanged. Users of portfolio.positions see None until the server sends it.
  • Margin methods: only new keyword-only params with default None. Existing calls send exactly the same query as before. The new _rfc3339 helper is local to margin.py. GET requests keep their retry behavior; no POST/PUT/DELETE paths were touched.
  • Nothing was removed or renamed, so this is a minor release.

Gates

ruff pass · mypy pass · unit tests 5088 passed, 3 skipped · strict contract tests 930 passed

@TexasCoding
TexasCoding merged commit f1c353c into main Nov 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nightly spec-drift: strict contract tests failing (since 2026-11-04)

1 participant