From 3bcda91296ac2577ba5fe067b2f158eee499de53 Mon Sep 17 00:00:00 2001 From: Jeff West Date: Fri, 17 Jul 2026 05:35:10 -0500 Subject: [PATCH 1/2] =?UTF-8?q?release:=20v7.1.0=20=E2=80=94=20OpenAPI=203?= =?UTF-8?q?.25.0=20additive=20sync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Minor release for the #475/#476 spec-drift reconcile. Adds MarginMarket.schedule / MarginMarketSchedule, pins docs to OpenAPI 3.25.0, and bumps package version. No breaking public-API changes. --- CHANGELOG.md | 22 ++++++++++++++++++++++ README.md | 4 ++-- ROADMAP.md | 10 ++++++++++ docs/index.md | 6 +++--- docs/migration.md | 21 +++++++++++++++++++++ docs/perps.md | 6 ++++++ kalshi/__init__.py | 2 +- pyproject.toml | 2 +- 8 files changed, 66 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1acecdd..5a16703c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to kalshi-sdk will be documented in this file. +## 7.1.0 — 2026-07-17 + +Syncs the upstream OpenAPI/AsyncAPI specs **3.24.0 → 3.25.0** (Closes #475). +Additive only — no breaking public-API changes. + +### Added + +- **`MarginMarket.schedule`** (perps) — required field on margin market responses. + Typed as `MarginMarketSchedule | None` (null for markets that trade 24/7). + Nested `MarginMarketSchedule` exposes `is_open: bool` and + `next_close_ts` / `next_open_ts` (`int | None`, Unix epoch seconds; null + while the corresponding phase is active). Exported from `kalshi.perps` and + `kalshi.perps.models`. + +### Spec notes + +- Core OpenAPI gained `POST /portfolio/intra_exchange_instance_transfer` + (same path/schema as the perps transfer). The endpoint is still marked + **currently not available** upstream; the core client records it in + `_UNIMPLEMENTED_ENDPOINTS`. Use + `PerpsClient.transfers.transfer_instance()` for the margin product surface. + ## 7.0.0 — 2026-07-10 Syncs the upstream OpenAPI/AsyncAPI specs **3.23.0 → 3.24.0** (Closes #467, #470). diff --git a/README.md b/README.md index eb48b53f..352e2652 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ A professional, spec-first Python SDK for the [Kalshi](https://kalshi.com) predi [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![Type checked: mypy strict](https://img.shields.io/badge/mypy-strict-blue.svg)](https://mypy.readthedocs.io/) -- **Full coverage** of the Kalshi REST API (101 operations across 19 resources, OpenAPI v3.24.0) and WebSocket API (12 typed `subscribe_*` channels + 2 escape-hatch). -- **Perps (margin) API**: standalone `PerpsClient` / `AsyncPerpsClient` + `PerpsWebSocket` for the perpetual-futures exchange (34 REST operations, 6 WS channels), plus a `KlearClient` for the Self-Clearing-Member "Klear" settlement API (9 operations). See [Perps (margin) trading](#perps-margin-trading). +- **Full coverage** of the Kalshi REST API (101 operations across 19 resources, OpenAPI v3.25.0) and WebSocket API (12 typed `subscribe_*` channels + 2 escape-hatch). +- **Perps (margin) API**: standalone `PerpsClient` / `AsyncPerpsClient` + `PerpsWebSocket` for the perpetual-futures exchange (35 REST operations, 6 WS channels), plus a `KlearClient` for the Self-Clearing-Member "Klear" settlement API (11 operations). See [Perps (margin) trading](#perps-margin-trading). - **FIX protocol**: an async-first FIX engine (FIXT.1.1 / FIX50SP2) for both products — order-entry, drop-copy, market-data, post-trade (prediction), and RFQ (prediction) sessions (plus order-group management over the order-entry session) with typed message models, sequence recovery, and order-book / settlement reassembly. `from kalshi import FixClient` / `MarginFixClient`. See [FIX protocol](#fix-protocol-low-latency-trading). - **V2 event-market orders**: `create_v2` / `amend_v2` / `decrease_v2` / `cancel_v2` plus batched variants on `/portfolio/events/orders/*` — the only order-write surface. - **Funding & cost introspection**: `portfolio.deposits()`, `portfolio.withdrawals()`, `account.endpoint_costs()`. diff --git a/ROADMAP.md b/ROADMAP.md index 47681562..d4ef1b85 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,6 +2,16 @@ ## Shipped +- **v7.1.0 (2026-07-17)** — OpenAPI sync v3.24.0 → v3.25.0 (#475 / #476). + Additive: `MarginMarket.schedule` + nested `MarginMarketSchedule` (null for + 24/7 markets). Core `POST /portfolio/intra_exchange_instance_transfer` + recorded unimplemented (currently not available; live on + `PerpsClient.transfers.transfer_instance`). +- **v7.0.0 (2026-07-10)** — OpenAPI sync v3.23.0 → v3.24.0 (#467 / #470 / #472). + **Breaking:** position-transfer `price_cents` → `price` (fixed-point dollars). + Soft-deprecate `exchange.announcements()`. Additive endpoints and fields + (RFQ-scoped quote get, Klear active-obligations plural + settlement-by-asset-class, + `portfolio.balance(exchange_index=)`, etc.). - **v6.0.0 (2026-07-04)** — OpenAPI sync v3.22.0 → v3.23.0 (#463). **Breaking:** removed the multivariate lookup-history endpoint (`lookup_history()` + `LookupPoint`), deleted upstream. Additive: subaccount-scoped API keys diff --git a/docs/index.md b/docs/index.md index c1a1708c..da4348d1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,7 @@ A professional, spec-first Python SDK for the [Kalshi](https://kalshi.com) prediction markets API. -- **Full REST coverage** — 101 operations across 19 resources (OpenAPI v3.24.0), +- **Full REST coverage** — 101 operations across 19 resources (OpenAPI v3.25.0), every kwarg drift-tested against the spec. - **V2 event-market orders** — new `create_v2` / `amend_v2` / `decrease_v2` / `cancel_v2` family on `/portfolio/events/orders/*`. Legacy `/portfolio/orders` @@ -15,9 +15,9 @@ markets API. backpressure strategies, and an in-memory orderbook builder. Async-only — access via `AsyncKalshiClient.ws`. - **Perps (margin) API** — standalone `PerpsClient` / `AsyncPerpsClient` + - `PerpsWebSocket` for the perpetual-futures exchange (34 REST operations, 6 WS + `PerpsWebSocket` for the perpetual-futures exchange (35 REST operations, 6 WS channels), and a `KlearClient` for the Self-Clearing-Member settlement API - (9 operations, Bearer token auth). See [Perps](perps.md). + (11 operations, Bearer token auth). See [Perps](perps.md). - **FIX protocol** — a hand-rolled, async-first FIX engine (FIXT.1.1 / FIX50SP2) for both products: order-entry, drop-copy, market-data, post-trade (prediction), and RFQ (prediction) sessions — plus order-group management over the order-entry diff --git a/docs/migration.md b/docs/migration.md index 6579e7a4..d2cc37bb 100644 --- a/docs/migration.md +++ b/docs/migration.md @@ -1,5 +1,26 @@ # Migration +## v7.0 → v7.1.0 + +Syncs the SDK to OpenAPI/AsyncAPI spec **3.25.0**. **No breaking changes.** + +### Added + +- **`MarginMarket.schedule`** (`MarginMarketSchedule | None`, required key) — + current trading hours for a margin market. `None` means 24/7. Nested fields: + `is_open`, `next_close_ts`, `next_open_ts` (Unix seconds; nullable by phase). + If you construct `MarginMarket` instances by hand in tests, pass + `schedule=None` or a `MarginMarketSchedule(...)`. + +### Deferred + +- Core OpenAPI lists `POST /portfolio/intra_exchange_instance_transfer`, still + marked **currently not available**. The core client does not expose it; use + `PerpsClient.transfers.transfer_instance()` on the margin product. + +See the [changelog](https://github.com/TexasCoding/kalshi-python-sdk/blob/main/CHANGELOG.md) +for the full list. + ## v6 → v7.0.0 Syncs the SDK to OpenAPI/AsyncAPI spec **3.24.0**. One breaking change on the diff --git a/docs/perps.md b/docs/perps.md index adc978ec..f65b6465 100644 --- a/docs/perps.md +++ b/docs/perps.md @@ -96,6 +96,12 @@ Orders create/cancel/decrease/amend are POSTs/DELETEs and are **never retried**. (`DollarDecimal`, a `FixedPointDollars` USD string) and `ts_ms` (the source timestamp in epoch **milliseconds**, `int`). All three are absent from the spec `required` list, so they are `None` when the upstream price is unavailable. +- **Trading schedule** (since the v3.25.0 spec sync / SDK v7.1.0) — `MarginMarket` + carries a **required** `schedule` key typed `MarginMarketSchedule | None`. + `None` means the market trades 24/7. When present, `MarginMarketSchedule` has + `is_open: bool` plus `next_close_ts` / `next_open_ts` (`int | None`, Unix + epoch **seconds**): `next_close_ts` is null while closed, `next_open_ts` is + null while open. - **Subaccounts** (since the v3.21.0 spec sync) — `MarginPosition` (the `portfolio.positions()` rows) carries a **required** `subaccount` (`int`) identifying which subaccount holds the position. diff --git a/kalshi/__init__.py b/kalshi/__init__.py index 46d79536..10a9418e 100644 --- a/kalshi/__init__.py +++ b/kalshi/__init__.py @@ -379,4 +379,4 @@ "Withdrawal", ] -__version__ = "7.0.0" +__version__ = "7.1.0" diff --git a/pyproject.toml b/pyproject.toml index 7a81ba57..ddca4927 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kalshi-sdk" -version = "7.0.0" +version = "7.1.0" description = "A professional Python SDK for the Kalshi prediction markets and Perps (margin) APIs" readme = "README.md" license = { text = "MIT" } From 6abbcd07ef62ef76eb371854bc40a9238ac46a12 Mon Sep 17 00:00:00 2001 From: Jeff West Date: Fri, 17 Jul 2026 05:35:37 -0500 Subject: [PATCH 2/2] docs: pin CLAUDE.md OpenAPI reference to v3.25.0 Missed from the v7.1.0 release commit (case-sensitive path). --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index b03a95b9..fd278b98 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -122,7 +122,7 @@ tests/ ## API Reference -- OpenAPI spec: https://docs.kalshi.com/openapi.yaml (v3.24.0, 101 operations) +- OpenAPI spec: https://docs.kalshi.com/openapi.yaml (v3.25.0, 102 operations; 101 mapped in the core SDK — `POST /portfolio/intra_exchange_instance_transfer` is currently not available upstream) - AsyncAPI spec: https://docs.kalshi.com/asyncapi.yaml (13 WebSocket channels) - Base URL: https://api.elections.kalshi.com/trade-api/v2 - Demo URL: https://demo-api.kalshi.co/trade-api/v2