Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 43 additions & 44 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

All notable changes to kalshi-sdk will be documented in this file.

## Unreleased
## 22.0.0 — 2026-10-16

Reconciles nightly spec drift (Closes #544). **Breaking** for constructors
of `ObligationEntry` that omit the new required `corporate_action_payments`.
Re-vendored `specs/openapi.yaml` (hash
`3877d38d095f4004e325aaa8766f24dabeb1c2dc3fb8d37b9ccac82ca5734d8a`),
`specs/asyncapi.yaml` (hash
`3c86bae7d89b44baba1119b3a097a54054c1d851e1dcd8ad894c7cb35b9890b6`;
channel description only — no WebSocket payload schema change), and
`specs/perps_scm_openapi.yaml` (hash
`1f58b54b6bef44852b4a9a3fd7ad707668258a2516801a076ffe468a1807806f`).
Core OpenAPI remains 3.34.0.
Reconciles three rounds of nightly spec drift (#540, #542, #544).
**Breaking** for constructors and fixtures of perps `MarginMarket` that omit
the new required `funding_invalid_premium_handling`, and of Klear
`ObligationEntry` that omit the new required `corporate_action_payments`.
Live API callers are unaffected. See `docs/migration.md`.

### Changed (breaking)

- Perps **`MarginMarket.funding_invalid_premium_handling`** (required
`"dampen"` / `"exclude"`). How funding averages a second with no
premium (no orderbook sample, no index price, or a trading halt),
configured at market creation. `dampen` counts that second as a
premium of 0; `exclude` leaves it out of the average. Live
`markets.list` / `markets.get` callers are unaffected; constructors
and fixtures must pass the new field.

- Klear **`ObligationEntry.corporate_action_payments`** (required
`list[CorporateActionPaymentDetail]`, may be empty). Cash and split
corporate-action payments already reflected in settlement PnL; do not
Expand All @@ -25,6 +28,22 @@ Core OpenAPI remains 3.34.0.

### Added

- **`events.get(..., exclude_markets=)`** (sync + async) — optional
boolean query param on `GET /events/{event_ticker}`. When true,
returns event metadata without loading child markets. Use
`GET /markets` with `event_ticker`, `limit`, and `cursor` for
bounded market pages. Cannot be combined with
`with_nested_markets=true` (API returns 400). Default `None` does
not emit the param; explicit `False` serializes as `false`.
(Closes #542).

- Perps **`markets.bulk_orderbooks(*, tickers)`** (sync + async) —
`GET /margin/markets/orderbooks`. Fetches up to 100 margin orderbooks
in one call. `tickers` is required (1–100) and serializes as a
comma-separated query string (`style: form, explode: false`). Returns
`list[MarginOrderbook]` in request order. Public market data (no
auth). A ticker that is not a margin market returns 404.

- **`events.list_multivariate` / `list_all_multivariate(..., tickers=)`**
(sync + async) — optional event-ticker filter on
`GET /events/multivariate`. A `list[str]` or a comma-separated string is
Expand All @@ -43,40 +62,20 @@ Core OpenAPI remains 3.34.0.
- Klear **`AssetClassLiteral`** also accepts `"Equities"`, `"Metals"`,
`"Indices"`, and `"Energy"` (alongside `"Crypto"`).

Reconciles perps spec drift after nightly contract failures (Closes #540).
**Breaking** for constructors of `MarginMarket` that omit the new required
`funding_invalid_premium_handling`. Re-vendored `specs/perps_openapi.yaml`
(hash
`0a1cf0e32c7e0bf4def095c72736593ae07d1616ab3024615fe942a516c40937`).
Core OpenAPI remains 3.34.0.

### Changed (breaking)

- Perps **`MarginMarket.funding_invalid_premium_handling`** (required
`"dampen"` / `"exclude"`). How funding averages a second with no
premium (no orderbook sample, no index price, or a trading halt),
configured at market creation. `dampen` counts that second as a
premium of 0; `exclude` leaves it out of the average. Live
`markets.list` / `markets.get` callers are unaffected; constructors
and fixtures must pass the new field.

### Added

- **`events.get(..., exclude_markets=)`** (sync + async) — optional
boolean query param on `GET /events/{event_ticker}`. When true,
returns event metadata without loading child markets. Use
`GET /markets` with `event_ticker`, `limit`, and `cursor` for
bounded market pages. Cannot be combined with
`with_nested_markets=true` (API returns 400). Default `None` does
not emit the param; explicit `False` serializes as `false`.
(Closes #542).
### Spec notes

- Perps **`markets.bulk_orderbooks(*, tickers)`** (sync + async) —
`GET /margin/markets/orderbooks`. Fetches up to 100 margin orderbooks
in one call. `tickers` is required (1–100) and serializes as a
comma-separated query string (`style: form, explode: false`). Returns
`list[MarginOrderbook]` in request order. Public market data (no
auth). A ticker that is not a margin market returns 404.
- Re-vendored `specs/perps_openapi.yaml` (hash
`0a1cf0e32c7e0bf4def095c72736593ae07d1616ab3024615fe942a516c40937`) for
#540.
- Re-vendored `specs/openapi.yaml` (hash
`3877d38d095f4004e325aaa8766f24dabeb1c2dc3fb8d37b9ccac82ca5734d8a`),
`specs/asyncapi.yaml` (hash
`3c86bae7d89b44baba1119b3a097a54054c1d851e1dcd8ad894c7cb35b9890b6`;
channel description only, no WebSocket payload schema change), and
`specs/perps_scm_openapi.yaml` (hash
`1f58b54b6bef44852b4a9a3fd7ad707668258a2516801a076ffe468a1807806f`) for
#544.
- Core OpenAPI remains 3.34.0.

## 21.1.0 — 2026-10-12

Expand Down
2 changes: 1 addition & 1 deletion docs/migration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migration

## v21.1.0 → Unreleased
## v21.1.0 → v22.0.0

Reconciles perps spec drift (Closes #540). **Breaking** for constructors
of `MarginMarket` that omit the new required
Expand Down
2 changes: 1 addition & 1 deletion kalshi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,4 @@
"Withdrawal",
]

__version__ = "21.1.0"
__version__ = "22.0.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kalshi-sdk"
version = "21.1.0"
version = "22.0.0"
description = "A professional Python SDK for the Kalshi prediction markets and Perps (margin) APIs"
readme = "README.md"
license = { text = "MIT" }
Expand Down
Loading