Skip to content

Reconcile MVE price ranges + perps market_id drift (v19.0.0) - #530

Merged
TexasCoding merged 1 commit into
mainfrom
fix/529-spec-drift-mve-price-ranges-perps-market-id
Oct 6, 2026
Merged

TexasCoding merged 1 commit into
mainfrom
fix/529-spec-drift-mve-price-ranges-perps-market-id

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #529.

Reconciles the nightly strict spec-drift failures and releases as v19.0.0 (breaking).

Changes

  • Breaking: MultivariateEventCollection.price_level_structure (required str) and price_ranges (required list of {start, end, step} dicts, null coerces to []), matching spec-required fields. Same shape as Market.price_ranges.
  • Added: optional market_id on perps CreateMarginOrderRequest / AmendMarginOrderRequest and orders.create / orders.amend kwargs (sync + async); omitted from the body when unset. SDK keeps ticker required for now even though the perps spec now accepts market_id as an alternative.
  • Re-vendored specs/openapi.yaml, specs/asyncapi.yaml, specs/perps_openapi.yaml.
  • Version bump 18.0.0 → 19.0.0 (pyproject, __version__, CHANGELOG), migration note in docs/migration.md, docs for multivariate and perps.

Blast radius (manual; GitNexus unavailable)

  • kalshi/models/multivariate.py::MultivariateEventCollection — used by multivariate_collections.list/get (sync + async) response parsing; constructors in tests/fixtures updated.
  • kalshi/perps/models/orders.py request models and kalshi/perps/resources/orders.py _build_create_body / _build_amend_body and the sync/async create / amend overloads. New kwarg is keyword-only and optional, so existing callers are unaffected.

Gates

  • uv run ruff check . — pass
  • uv run mypy kalshi/ — pass (160 files)
  • uv run pytest tests/ --ignore=tests/integration -q — 4627 passed, 3 skipped
  • uv run pytest tests/test_contracts.py -q -W error::UserWarning (nightly strict) — 842 passed

Closes #529. Adds required MultivariateEventCollection.price_level_structure
and price_ranges, and optional perps market_id on create/amend order requests
and kwargs (sync + async), after nightly strict contract failures. Re-vendors
OpenAPI/AsyncAPI/perps specs (core info.version remains 3.32.0).
@TexasCoding
TexasCoding merged commit 08e793e into main Oct 6, 2026
6 checks passed
@TexasCoding
TexasCoding deleted the fix/529-spec-drift-mve-price-ranges-perps-market-id branch November 1, 2026 12:33
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-10-06)

1 participant