Skip to content

Reconcile OpenAPI 3.29.0 spec drift (v14.0.0) - #512

Merged
TexasCoding merged 1 commit into
mainfrom
fix/spec-drift-510-511
Sep 6, 2026
Merged

Reconcile OpenAPI 3.29.0 spec drift (v14.0.0)#512
TexasCoding merged 1 commit into
mainfrom
fix/spec-drift-510-511

Conversation

@TexasCoding

Copy link
Copy Markdown
Owner

Closes #510. Closes #511.

Reconciles nightly spec-drift against upstream OpenAPI 3.29.0 content (same info.version, paths 95 → 96) plus matching perps/Klear/AsyncAPI updates. Ships as v14.0.0 because perps WS MarginFillPayload and MarginUserOrderPayload gained a required order_source (same constructor-breaking precedent as v13.0.0).

Breaking

  • MarginFillPayload.order_source and MarginUserOrderPayload.order_source (Literal["user", "system"], required). system marks liquidations and margin exit / trailing-stop triggers. Live stream callers are unaffected. Tests/mocks that construct these payloads must pass the source (typically "user").

Added

  • live_data.weather_calibrations(city) — published weather-index configuration timeline.
  • Optional WeatherIndexPoint.receipt_basis.
  • api_keys.list(*, fcm_subtrader_id) and optional fcm_subtrader_id on create() / generate() / ApiKey (mutually exclusive with subaccount). Optional warning on create/generate responses.
  • portfolio.set_target_balance_allocation(..., resting_margin_reservation=) (max / sum).
  • fcm.orders / orders_all: subtrader_id optional when client_order_ids is supplied (max 100).
  • Optional subaccount on historical.positions() / positions_all().
  • Perps margin.fee_tier_rates().
  • Optional MarginMarket.asset_class.
  • Klear FCM margin API keys (list_fcm_api_keys / create_fcm_api_key / generate_fcm_api_key / delete_fcm_api_key).
  • Klear member_funding_payments() / member_funding_payments_all().
  • Klear estimate_maintenance_margin(..., date=, clearing_type=) plus optional breakdown fields.
  • WS subscribe_cfbenchmarks_value_5hz().

Changed (non-breaking)

  • Event.available_on_brokers is optional. The spec dropped the field; constructors that pass it still work.

Spec notes

  • Core OpenAPI 3.29.0: 109 operations / 108 mapped. Still unimplemented on the core client: POST /portfolio/intra_exchange_instance_transfer.
  • Perps OpenAPI: 47 → 48 operations.
  • Perps SCM: 19 → 24 operations. Still unimplemented: GET /margin/large_trader_positions.
  • AsyncAPI 14 → 15 channels (cfbenchmarks_value_5hz). 12 typed subscribe_* helpers.

Verification

  • uv run ruff check . — clean
  • uv run mypy kalshi/ — clean
  • uv run pytest tests/ -m "not integration" --ignore=tests/integration4414 passed, 3 skipped

Closes #510. Closes #511. Adds weather calibrations, FCM-bound API keys,
target-balance resting_margin_reservation, FCM client_order_ids, historical
subaccount, perps fee_tier_rates, Klear FCM API keys and member funding
payments, and WS cfbenchmarks_value_5hz. Breaking: MarginFillPayload and
MarginUserOrderPayload require order_source.
@TexasCoding
TexasCoding merged commit 569fadb into main Sep 6, 2026
6 checks passed
@TexasCoding
TexasCoding deleted the fix/spec-drift-510-511 branch September 6, 2026 13:50
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