diff --git a/CHANGELOG.md b/CHANGELOG.md
index 82897ba..f5693eb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,64 @@
All notable changes to kalshi-sdk will be documented in this file.
+## 6.0.0 — 2026-07-04
+
+Syncs the upstream OpenAPI/AsyncAPI specs **3.22.0 → 3.23.0** (#463). The
+headline change is **breaking**: Kalshi removed the multivariate lookup-history
+endpoint from the spec, so the SDK removes the corresponding method and model.
+Every other change is additive and backward-compatible.
+
+### Removed (breaking)
+
+- **`lookup_history()`** on `client.multivariate_collections` (sync + async) and
+ the **`LookupPoint`** model (no longer exported from `kalshi` /
+ `kalshi.models`). Upstream removed the backing `GET
+ /multivariate_event_collections/{collection_ticker}/lookup` operation
+ (`GetMultivariateEventCollectionLookupHistory`) and the `LookupPoint` schema in
+ 3.23.0 — the endpoint now 404s. The `lookup_tickers()` sibling (the `PUT` on the
+ same path) is unaffected.
+
+### Added
+
+- **`ApiKey.subaccount`**, **`CreateApiKeyRequest.subaccount`**,
+ **`GenerateApiKeyRequest.subaccount`** (`int | None`) — when set, restricts the
+ API key to a single subaccount. `api_keys.create()` / `generate()` (sync +
+ async) accept a `subaccount` kwarg that threads into the body. The request
+ models bound it to the spec's `0-63` range (`ge=0, le=63`) client-side; the
+ response model stays permissive.
+- **`ApplySubaccountTransferRequest.exchange_index`** (`int | None`) — exchange
+ shard to apply the transfer on (spec `ExchangeIndex`; defaults to 0).
+- **`SubaccountTransfer`** additive fields: `exchange_index` and `transfer_type`
+ (`"cash"`/`"position"`, both required), plus the position-transfer-only
+ `market_ticker` / `side` (`"yes"`/`"no"`) / `count` / `price_cents`.
+- **`MarginPosition.is_portfolio`** and **`MarginRiskPosition.is_portfolio`**
+ (`bool`, required) — true when the position is hedged within a portfolio.
+- **`MarginOrder.order_reason`** (`"liquidation"`/`"take_profit_stop_loss"`,
+ optional) — reason for a system-generated order.
+- **`MarketLifecyclePayload.price_ranges`** (WS `market_lifecycle_v2`) — valid
+ price bands emitted alongside `price_level_structure`.
+- **`subaccounts.transfer_position(...)`** (sync + async) — new
+ `POST /portfolio/subaccounts/positions/transfer` endpoint (spec 3.23.0): moves
+ an open **position** (contracts) between subaccounts, distinct from the
+ cash-only `transfer()`. Returns `ApplySubaccountPositionTransferResponse`
+ (`position_transfer_id`). New models `ApplySubaccountPositionTransferRequest` /
+ `ApplySubaccountPositionTransferResponse` are exported from `kalshi` /
+ `kalshi.models`.
+- **`subaccounts.create(exchange_index=...)`** — `POST /portfolio/subaccounts`
+ gained an optional `CreateSubaccountRequest` body (spec 3.23.0); `create()`
+ now accepts an optional `exchange_index` to target a specific exchange shard.
+ New `CreateSubaccountRequest` model exported from `kalshi` / `kalshi.models`.
+
+### Fixed
+
+- **Defensive optional-ization of fields 3.23.0 removed/relaxed.** The drift
+ suite is spec→SDK only, so a field the spec drops but the SDK still *requires*
+ is a latent `ValidationError` if the server stops emitting it. Three such
+ fields are now `... | None = None`:
+ - `Market.fractional_trading_enabled` (removed from spec),
+ - `MarketPosition.resting_orders_count` (removed from spec),
+ - `MarginPosition.margin_used` (relaxed from required to optional).
+
## 5.0.1 — 2026-06-27
Spec-drift catch-up (#460). Kalshi added fields to the `ExchangeStatus` schema
diff --git a/CLAUDE.md b/CLAUDE.md
index abc9a8d..410e600 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -122,7 +122,7 @@ tests/
## API Reference
-- OpenAPI spec: https://docs.kalshi.com/openapi.yaml (v3.22.0, 101 operations)
+- OpenAPI spec: https://docs.kalshi.com/openapi.yaml (v3.23.0, 101 operations)
- 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
diff --git a/README.md b/README.md
index 2508288..8a6e129 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ A professional, spec-first Python SDK for the [Kalshi](https://kalshi.com) predi
[](LICENSE)
[](https://mypy.readthedocs.io/)
-- **Full coverage** of the Kalshi REST API (101 operations across 19 resources, OpenAPI v3.22.0) and WebSocket API (12 typed `subscribe_*` channels + 2 escape-hatch).
+- **Full coverage** of the Kalshi REST API (101 operations across 19 resources, OpenAPI v3.23.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).
- **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.
diff --git a/ROADMAP.md b/ROADMAP.md
index 5653ec8..4768156 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -2,6 +2,27 @@
## Shipped
+- **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
+ (`api_keys.create/generate(subaccount=)`), subaccount **position** transfers
+ (`subaccounts.transfer_position()` + models), `subaccounts.create(exchange_index=)`,
+ and new response fields on `SubaccountTransfer`, `MarginOrder`,
+ `MarginPosition` / `MarginRiskPosition` (`is_portfolio`), and the WS
+ `market_lifecycle_v2` payload (`price_ranges`). Defensive optional-ization of
+ three fields the spec removed/relaxed (#464, #465 folded in).
+- **v5.0.1 (2026-06-27)** — spec-drift catch-up (#460): additive `ExchangeStatus`
+ fields (`intra_exchange_transfers_active`, `exchange_index_statuses` +
+ `ExchangeIndexStatus`).
+- **v5.0.0 (2026-06-26)** — OpenAPI sync v3.21.0 → v3.22.0 (#454, #458).
+ **Breaking:** removed the V1 order-write endpoints/models (use the `*_v2`
+ family); added RFQ-scoped quote actions.
+- **v4.2.0 (2026-06-19)** — in-place spec-drift reconciliation (#451): additive
+ fields the live OpenAPI/AsyncAPI specs gained after 4.1.0.
+- **v4.1.0 (2026-06-14)** — OpenAPI sync v3.20.0 → v3.21.0: additive new query
+ params, response fields, and four new endpoints.
+- **v4.0.0 (2026-06-09)** — spec-drift reconciliation against OpenAPI 3.20.0
+ (#443); one breaking change on the Self-Clearing-Member (Klear) surface.
- **v3.3.0 (2026-06-06)** — complete **FIX protocol** subsystem (FIXT.1.1 /
FIX50SP2) for both products: `FixClient` (prediction) + `MarginFixClient`
(margin) over a hand-rolled async session engine, with five session types
diff --git a/docs/index.md b/docs/index.md
index e6fa383..3365a8d 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.22.0),
+- **Full REST coverage** — 101 operations across 19 resources (OpenAPI v3.23.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`
diff --git a/docs/migration.md b/docs/migration.md
index afda350..924fbfa 100644
--- a/docs/migration.md
+++ b/docs/migration.md
@@ -1,5 +1,31 @@
# Migration
+## v5 → v6.0.0
+
+**Breaking: multivariate lookup-history is gone.** Kalshi removed the
+`GET /multivariate_event_collections/{ticker}/lookup` endpoint
+(`GetMultivariateEventCollectionLookupHistory`) and the `LookupPoint` schema from
+the OpenAPI spec in 3.23.0, so the SDK removed the matching method and model.
+
+### Removed
+
+| Removed (v5) | Replacement |
+| --------------------------------------------------- | ----------- |
+| `multivariate_collections.lookup_history(...)` (sync + async) | none — the endpoint was deleted upstream |
+| `LookupPoint` model (exported from `kalshi` / `kalshi.models`) | none |
+
+Everything else in 6.0.0 is additive and needs no code changes:
+
+- New optional/required response fields on `ApiKey`, `SubaccountTransfer`,
+ `MarginPosition`, `MarginRiskPosition`, `MarginOrder`, and the WS
+ `market_lifecycle_v2` payload.
+- New `subaccounts.transfer_position(...)` method (`POST
+ /portfolio/subaccounts/positions/transfer`) for moving open positions between
+ subaccounts.
+- `subaccounts.create()` gained an optional `exchange_index` argument.
+
+See the [changelog](../CHANGELOG.md) for the full list.
+
## v4 → v5.0.0
**Breaking: the V1 order-write API is gone.** Kalshi removed the V1 order
@@ -402,16 +428,14 @@ for position in client.portfolio.positions_all():
### Multivariate endpoints emit `DeprecationWarning`
-Per #269, `multivariate.lookup_tickers`, `multivariate.lookup_history`,
-and `multivariate.create_market` (sync + async) carry
-`@typing_extensions.deprecated` decorators citing the spec's "should
-not be used for new integrations" guidance. Use RFQs instead. The
-endpoints still work; calls just emit a `DeprecationWarning` on first
-use.
+Per #269, `multivariate.lookup_tickers` and `multivariate.create_market`
+(sync + async) carry `@typing_extensions.deprecated` decorators citing
+the spec's "should not be used for new integrations" guidance. Use RFQs
+instead. The endpoints still work; calls just emit a `DeprecationWarning`
+on first use.
-`multivariate.lookup_history` also now validates `lookback_seconds`
-locally against the spec enum `{10, 60, 300, 3600}` and raises
-`ValueError` for any other value before the round trip.
+(`multivariate.lookup_history`, also deprecated here in #269, was removed
+entirely in 6.0.0 — see the [v5 → v6.0.0](#v5--v600) section above.)
### `orders.list(event_ticker=...)` accepts lists
diff --git a/docs/perps.md b/docs/perps.md
index adc22bd..5cca425 100644
--- a/docs/perps.md
+++ b/docs/perps.md
@@ -99,6 +99,12 @@ Orders create/cancel/decrease/amend are POSTs/DELETEs and are **never retried**.
- **Subaccounts** (since the v3.21.0 spec sync) — `MarginPosition` (the
`portfolio.positions()` rows) carries a **required** `subaccount` (`int`)
identifying which subaccount holds the position.
+- **Portfolio hedging** (since the v3.23.0 spec sync) — `MarginPosition` and
+ `MarginRiskPosition` carry a **required** `is_portfolio` (`bool`), `True` when
+ the position is hedged within a portfolio so its margin is computed at the
+ portfolio level. `MarginOrder` gained an optional `order_reason`
+ (`"liquidation"` / `"take_profit_stop_loss"`) identifying system-generated
+ orders.
## Funding mechanics
diff --git a/docs/reference.md b/docs/reference.md
index 5efb63a..a5234fa 100644
--- a/docs/reference.md
+++ b/docs/reference.md
@@ -68,8 +68,12 @@ every exception class.
::: kalshi.models.order_groups.UpdateOrderGroupLimitRequest
+::: kalshi.models.subaccounts.CreateSubaccountRequest
+
::: kalshi.models.subaccounts.ApplySubaccountTransferRequest
+::: kalshi.models.subaccounts.ApplySubaccountPositionTransferRequest
+
::: kalshi.models.subaccounts.UpdateSubaccountNettingRequest
## Response models
diff --git a/docs/resources/api-keys.md b/docs/resources/api-keys.md
index cd378bf..5904584 100644
--- a/docs/resources/api-keys.md
+++ b/docs/resources/api-keys.md
@@ -10,10 +10,16 @@ Auth required throughout (you need an existing key to manage keys).
| Method | Endpoint |
|---|---|
| `list()` | `GET /api_keys` |
-| `create(*, name, public_key, scopes=None)` | `POST /api_keys` |
-| `generate(*, name, scopes=None)` | `POST /api_keys/generate` |
+| `create(*, name, public_key, scopes=None, subaccount=None)` | `POST /api_keys` |
+| `generate(*, name, scopes=None, subaccount=None)` | `POST /api_keys/generate` |
| `delete(api_key)` | `DELETE /api_keys/{api_key}` |
+!!! note "Subaccount-scoped keys (spec v3.23.0)"
+ Pass `subaccount=<0-63>` to `create()` / `generate()` to restrict a key to a
+ single subaccount. Omit it (the default) for an account-wide key. The value is
+ bounded to `0-63` client-side; `ApiKey.subaccount` echoes it back on `list()`
+ (`None` for account-wide keys).
+
## List
```python
diff --git a/docs/resources/multivariate.md b/docs/resources/multivariate.md
index 8968273..d4182bf 100644
--- a/docs/resources/multivariate.md
+++ b/docs/resources/multivariate.md
@@ -9,12 +9,17 @@ Public listing, auth-required minting. Attribute name on the client:
`multivariate_collections`.
!!! warning "Deprecated methods"
- `create_market()`, `lookup_tickers()`, and `lookup_history()` are
- deprecated — "This endpoint predates RFQs and should not be used for new
- integrations." Calling them emits a `DeprecationWarning`. Use the
+ `create_market()` and `lookup_tickers()` are deprecated — "This endpoint
+ predates RFQs and should not be used for new integrations." Calling them
+ emits a `DeprecationWarning`. Use the
[Communications (RFQ/Quote)](communications.md) surface instead. `list()` /
`list_all()` / `get()` remain supported.
+!!! danger "Removed in 6.0.0"
+ `lookup_history()` and the `LookupPoint` model were removed — Kalshi deleted
+ the backing `GET /multivariate_event_collections/{ticker}/lookup` endpoint
+ from the spec in 3.23.0.
+
## Quick reference
| Method | Endpoint | Auth |
@@ -23,7 +28,6 @@ Public listing, auth-required minting. Attribute name on the client:
| `get(collection_ticker)` | `GET /multivariate_event_collections/{ticker}` | no |
| `create_market(collection_ticker, *, selected_markets, with_market_payload=False)` | `POST /multivariate_event_collections/{ticker}` | yes |
| `lookup_tickers(collection_ticker, *, selected_markets)` | `PUT /multivariate_event_collections/{ticker}/lookup` | yes |
-| `lookup_history(collection_ticker, *, lookback_seconds)` | `GET /multivariate_event_collections/{ticker}/lookup` (with `lookback_seconds` query param) | no |
## List collections
@@ -77,17 +81,6 @@ if resp.market is not None:
print(resp.market.yes_bid, resp.market.yes_ask)
```
-## Recent lookup history
-
-```python
-history = client.multivariate_collections.lookup_history(
- "KXWEATHER-SPORTS-COMBO",
- lookback_seconds=3600,
-)
-for point in history:
- print(point.last_queried_ts, point.market_ticker, point.event_ticker)
-```
-
## Reference
::: kalshi.resources.multivariate.MultivariateCollectionsResource
diff --git a/docs/resources/subaccounts.md b/docs/resources/subaccounts.md
index e22616f..0606c70 100644
--- a/docs/resources/subaccounts.md
+++ b/docs/resources/subaccounts.md
@@ -7,8 +7,9 @@ primary; `1`–`63` are numbered extras. Auth required throughout.
| Method | Endpoint |
|---|---|
-| `create()` | `POST /portfolio/subaccounts` |
+| `create(*, exchange_index=None)` | `POST /portfolio/subaccounts` |
| `transfer(*, client_transfer_id, from_subaccount, to_subaccount, amount_cents)` | `POST /portfolio/subaccounts/transfer` |
+| `transfer_position(*, client_transfer_id, from_subaccount, to_subaccount, market_ticker, side, count, price_cents)` | `POST /portfolio/subaccounts/positions/transfer` |
| `list_balances()` | `GET /portfolio/subaccounts/balances` |
| `list_transfers(*, cursor=None, limit=None)` | `GET /portfolio/subaccounts/transfers` |
| `list_all_transfers(*, limit=None, max_pages=None)` | walks `list_transfers` |
@@ -20,31 +21,54 @@ primary; `1`–`63` are numbered extras. Auth required throughout.
```python
resp = client.subaccounts.create()
print(resp.subaccount_number)
+
+# Or target a specific exchange shard (spec v3.23.0; defaults to 0):
+resp = client.subaccounts.create(exchange_index=0)
```
-The body is intentionally empty — the SDK sends `json={}` to force a JSON
-content-type so demo doesn't reject the call.
+With no `exchange_index` the SDK sends `json={}` (an empty
+`CreateSubaccountRequest`) to force a JSON content-type so demo doesn't reject
+the call.
-## Transfer between subaccounts
+## Transfer cash between subaccounts
`amount_cents` is **integer cents**. `client_transfer_id` is a UUID — the
-idempotency key for the transfer:
+idempotency key for the transfer. `transfer()` returns `None` (the endpoint's
+response body is empty); list transfers to reconcile:
```python
import uuid
-resp = client.subaccounts.transfer(
+client.subaccounts.transfer(
client_transfer_id=uuid.uuid4(), # or str
from_subaccount=0, # primary
to_subaccount=1,
amount_cents=500, # $5.00
)
-print(resp.transfer_id)
```
`client_transfer_id` accepts a `UUID` or a `str`. On a network failure, retry
-with the same id; the server dedupes. List transfers to reconcile (see
-below).
+with the same id; the server dedupes.
+
+## Transfer a position between subaccounts
+
+Spec v3.23.0 added `transfer_position()` for moving open contracts (not cash)
+between subaccounts. Unlike `transfer()`, it returns a
+`position_transfer_id`. `price_cents` (0–100) sets the cost basis on the
+destination:
+
+```python
+resp = client.subaccounts.transfer_position(
+ client_transfer_id=uuid.uuid4(), # or str
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="KXBTC-25DEC31-B100000",
+ side="yes", # "yes" | "no"
+ count=10, # contracts (> 0)
+ price_cents=55, # per-contract cents, 0–100
+)
+print(resp.position_transfer_id)
+```
## List balances
diff --git a/kalshi/__init__.py b/kalshi/__init__.py
index 80fc680..d663f94 100644
--- a/kalshi/__init__.py
+++ b/kalshi/__init__.py
@@ -38,6 +38,8 @@
Announcement,
ApiKey,
ApiUsageLevelGrant,
+ ApplySubaccountPositionTransferRequest,
+ ApplySubaccountPositionTransferResponse,
ApplySubaccountTransferRequest,
AssociatedEvent,
Balance,
@@ -65,6 +67,7 @@
CreateQuoteResponse,
CreateRFQRequest,
CreateRFQResponse,
+ CreateSubaccountRequest,
CreateSubaccountResponse,
DailySchedule,
DecreaseOrderV2Request,
@@ -109,7 +112,6 @@
IncentiveProgramTypeLiteral,
IndexedBalance,
LiveData,
- LookupPoint,
LookupTickersForMarketInMultivariateEventCollectionRequest,
LookupTickersResponse,
MaintenanceWindow,
@@ -201,6 +203,8 @@
"Announcement",
"ApiKey",
"ApiUsageLevelGrant",
+ "ApplySubaccountPositionTransferRequest",
+ "ApplySubaccountPositionTransferResponse",
"ApplySubaccountTransferRequest",
"AssociatedEvent",
"AsyncBlockTradeProposalsResource",
@@ -236,6 +240,7 @@
"CreateQuoteResponse",
"CreateRFQRequest",
"CreateRFQResponse",
+ "CreateSubaccountRequest",
"CreateSubaccountResponse",
"DailySchedule",
"DecreaseOrderV2Request",
@@ -306,7 +311,6 @@
"KlearClient",
"KlearConfig",
"LiveData",
- "LookupPoint",
"LookupTickersForMarketInMultivariateEventCollectionRequest",
"LookupTickersResponse",
"MaintenanceWindow",
@@ -375,4 +379,4 @@
"Withdrawal",
]
-__version__ = "5.0.1"
+__version__ = "6.0.0"
diff --git a/kalshi/_contract_map.py b/kalshi/_contract_map.py
index f990e54..9caced2 100644
--- a/kalshi/_contract_map.py
+++ b/kalshi/_contract_map.py
@@ -173,6 +173,18 @@ class ContractEntry:
sdk_model="kalshi.models.subaccounts.ApplySubaccountTransferRequest",
spec_schema="ApplySubaccountTransferRequest",
),
+ ContractEntry(
+ sdk_model="kalshi.models.subaccounts.ApplySubaccountPositionTransferRequest",
+ spec_schema="ApplySubaccountPositionTransferRequest",
+ ),
+ ContractEntry(
+ sdk_model="kalshi.models.subaccounts.ApplySubaccountPositionTransferResponse",
+ spec_schema="ApplySubaccountPositionTransferResponse",
+ ),
+ ContractEntry(
+ sdk_model="kalshi.models.subaccounts.CreateSubaccountRequest",
+ spec_schema="CreateSubaccountRequest",
+ ),
ContractEntry(
sdk_model="kalshi.models.subaccounts.UpdateSubaccountNettingRequest",
spec_schema="UpdateSubaccountNettingRequest",
@@ -480,10 +492,6 @@ class ContractEntry:
spec_schema="LookupTickersForMarketInMultivariateEventCollectionResponse",
notes="Spec name is the long-form ...Response; SDK shortens",
),
- ContractEntry(
- sdk_model="kalshi.models.multivariate.LookupPoint",
- spec_schema="LookupPoint",
- ),
]
# WS payload models → AsyncAPI schema components.
@@ -542,8 +550,8 @@ class ContractEntry:
ContractEntry(
sdk_model="kalshi.ws.models.market_lifecycle.MarketLifecyclePayload",
spec_schema="marketLifecycleV2Payload",
- notes="SDK conflates lifecycle + event fields. "
- "Spec has additional_metadata, price_level_structure not in SDK.",
+ notes="SDK conflates lifecycle + event fields; all spec msg fields "
+ "(incl. additional_metadata, price_level_structure, price_ranges) mapped.",
),
ContractEntry(
sdk_model="kalshi.ws.models.event_fee.EventFeeUpdatePayload",
diff --git a/kalshi/models/__init__.py b/kalshi/models/__init__.py
index 7091544..3c1907a 100644
--- a/kalshi/models/__init__.py
+++ b/kalshi/models/__init__.py
@@ -95,7 +95,6 @@
AssociatedEvent,
CreateMarketInMultivariateEventCollectionRequest,
CreateMarketResponse,
- LookupPoint,
LookupTickersForMarketInMultivariateEventCollectionRequest,
LookupTickersResponse,
MultivariateCollectionStatusLiteral,
@@ -166,7 +165,10 @@
StructuredTarget,
)
from kalshi.models.subaccounts import (
+ ApplySubaccountPositionTransferRequest,
+ ApplySubaccountPositionTransferResponse,
ApplySubaccountTransferRequest,
+ CreateSubaccountRequest,
CreateSubaccountResponse,
GetSubaccountBalancesResponse,
GetSubaccountNettingResponse,
@@ -190,6 +192,8 @@
"Announcement",
"ApiKey",
"ApiUsageLevelGrant",
+ "ApplySubaccountPositionTransferRequest",
+ "ApplySubaccountPositionTransferResponse",
"ApplySubaccountTransferRequest",
"AssociatedEvent",
"Balance",
@@ -217,6 +221,7 @@
"CreateQuoteResponse",
"CreateRFQRequest",
"CreateRFQResponse",
+ "CreateSubaccountRequest",
"CreateSubaccountResponse",
"DailySchedule",
"DecreaseOrderV2Request",
@@ -261,7 +266,6 @@
"IncentiveProgramTypeLiteral",
"IndexedBalance",
"LiveData",
- "LookupPoint",
"LookupTickersForMarketInMultivariateEventCollectionRequest",
"LookupTickersResponse",
"MaintenanceWindow",
diff --git a/kalshi/models/api_keys.py b/kalshi/models/api_keys.py
index 4d7b39c..ad74d5d 100644
--- a/kalshi/models/api_keys.py
+++ b/kalshi/models/api_keys.py
@@ -9,7 +9,7 @@
from __future__ import annotations
-from pydantic import BaseModel, SecretStr
+from pydantic import BaseModel, Field, SecretStr
from kalshi.types import NullableList
@@ -26,6 +26,9 @@ class ApiKey(BaseModel):
api_key_id: str
name: str
scopes: NullableList[str]
+ # Spec v3.23.0: if set, the key is restricted to this single subaccount
+ # (0-63). Optional — omitted for account-wide keys and by older servers.
+ subaccount: int | None = None
model_config = {"extra": "allow"}
@@ -56,6 +59,9 @@ class CreateApiKeyRequest(BaseModel):
name: str
public_key: str
scopes: list[str] | None = None
+ # Spec v3.23.0: restrict the key to a single subaccount when set. The spec
+ # declares an explicit minimum/maximum (0-63), so bound it client-side.
+ subaccount: int | None = Field(default=None, ge=0, le=63)
model_config = {"extra": "forbid"}
@@ -73,6 +79,9 @@ class GenerateApiKeyRequest(BaseModel):
name: str
scopes: list[str] | None = None
+ # Spec v3.23.0: restrict the key to a single subaccount when set. The spec
+ # declares an explicit minimum/maximum (0-63), so bound it client-side.
+ subaccount: int | None = Field(default=None, ge=0, le=63)
model_config = {"extra": "forbid"}
diff --git a/kalshi/models/markets.py b/kalshi/models/markets.py
index 6932892..bef662b 100644
--- a/kalshi/models/markets.py
+++ b/kalshi/models/markets.py
@@ -108,7 +108,10 @@ class Market(BaseModel):
settlement_timer_seconds: int
result: str
can_close_early: bool
- fractional_trading_enabled: bool
+ # Spec 3.23.0 dropped this field from the Market schema (previously required).
+ # Optional/defensive: older servers still emit it; newer ones may omit it, so
+ # a bare ``bool`` would hard-fail Market parsing if it disappears.
+ fractional_trading_enabled: bool | None = None
expiration_value: str
category: str | None = None
risk_limit_cents: int | None = None
diff --git a/kalshi/models/multivariate.py b/kalshi/models/multivariate.py
index 62bedc5..789de40 100644
--- a/kalshi/models/multivariate.py
+++ b/kalshi/models/multivariate.py
@@ -134,14 +134,3 @@ class LookupTickersResponse(BaseModel):
market_ticker: str
model_config = {"extra": "allow"}
-
-
-class LookupPoint(BaseModel):
- """A point in the lookup history of a multivariate collection."""
-
- event_ticker: str
- market_ticker: str
- selected_markets: NullableList[TickerPair]
- last_queried_ts: AwareDatetime
-
- model_config = {"extra": "allow"}
diff --git a/kalshi/models/portfolio.py b/kalshi/models/portfolio.py
index 2f33b93..2a6e091 100644
--- a/kalshi/models/portfolio.py
+++ b/kalshi/models/portfolio.py
@@ -87,7 +87,10 @@ class MarketPosition(BaseModel):
realized_pnl: DollarDecimal | None = Field(
validation_alias=AliasChoices("realized_pnl_dollars", "realized_pnl"),
)
- resting_orders_count: int
+ # Spec 3.23.0 dropped this field from the MarketPosition schema (previously
+ # required). Optional/defensive so a server that stops emitting it does not
+ # hard-fail MarketPosition parsing.
+ resting_orders_count: int | None = None
fees_paid: DollarDecimal | None = Field(
validation_alias=AliasChoices("fees_paid_dollars", "fees_paid"),
)
diff --git a/kalshi/models/subaccounts.py b/kalshi/models/subaccounts.py
index 4a85111..b6744aa 100644
--- a/kalshi/models/subaccounts.py
+++ b/kalshi/models/subaccounts.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Literal
from uuid import UUID
from pydantic import BaseModel, Field
@@ -9,6 +10,21 @@
from kalshi.types import DollarDecimal, StrictInt
+class CreateSubaccountRequest(BaseModel):
+ """Body for POST /portfolio/subaccounts (spec v3.23.0).
+
+ Every field is optional — an empty body spins up the next subaccount on
+ exchange shard ``0``. ``exchange_index`` targets a specific shard (spec
+ ``ExchangeIndex``, integer; "defaults to 0 if unspecified", and only ``0``
+ is currently supported). The SDK validates only the lower bound (``ge=0``),
+ leaving the upper bound to the server.
+ """
+
+ exchange_index: StrictInt | None = Field(default=None, ge=0)
+
+ model_config = {"extra": "forbid"}
+
+
class CreateSubaccountResponse(BaseModel):
"""Response from POST /portfolio/subaccounts — the new subaccount number."""
@@ -33,10 +49,49 @@ class ApplySubaccountTransferRequest(BaseModel):
from_subaccount: StrictInt = Field(ge=0)
to_subaccount: StrictInt = Field(ge=0)
amount_cents: StrictInt = Field(gt=0)
+ # Spec v3.23.0: exchange shard to apply the transfer on (spec ExchangeIndex,
+ # integer). Optional — "defaults to 0 if unspecified" per spec, and only 0
+ # is currently supported, so callers rarely set it.
+ exchange_index: StrictInt | None = Field(default=None, ge=0)
+
+ model_config = {"extra": "forbid"}
+
+
+class ApplySubaccountPositionTransferRequest(BaseModel):
+ """Body for POST /portfolio/subaccounts/positions/transfer (spec v3.23.0).
+
+ Moves an open **position** (contracts) between subaccounts — distinct from
+ the cash-only :class:`ApplySubaccountTransferRequest`. ``price_cents`` is the
+ per-contract price in cents (``0``-``100``) used to set the cost basis on the
+ destination subaccount; ``count`` is the number of contracts and must be
+ positive. ``from_subaccount`` / ``to_subaccount`` use ``0`` for the primary
+ account; the SDK enforces only the lower bound (``ge=0``), leaving the upper
+ bound to the server (mirrors :class:`ApplySubaccountTransferRequest`).
+ """
+
+ client_transfer_id: UUID
+ from_subaccount: StrictInt = Field(ge=0)
+ to_subaccount: StrictInt = Field(ge=0)
+ market_ticker: str
+ side: Literal["yes", "no"]
+ count: StrictInt = Field(gt=0)
+ price_cents: StrictInt = Field(ge=0, le=100)
model_config = {"extra": "forbid"}
+class ApplySubaccountPositionTransferResponse(BaseModel):
+ """Response from POST /portfolio/subaccounts/positions/transfer (spec v3.23.0).
+
+ ``position_transfer_id`` is the server-generated identifier for the applied
+ position transfer.
+ """
+
+ position_transfer_id: str
+
+ model_config = {"extra": "allow"}
+
+
class SubaccountBalance(BaseModel):
"""Balance for a single subaccount.
@@ -70,6 +125,11 @@ class SubaccountTransfer(BaseModel):
``created_ts`` is a Unix seconds integer per spec (``format: int64``),
matching ``SubaccountBalance.updated_ts``. This is intentionally
different from RFQ/Quote timestamps, which are ISO datetime strings.
+
+ Spec v3.23.0 split transfers into two kinds via ``transfer_type``: ``cash``
+ (money moved; ``amount_cents`` set) and ``position`` (contracts moved). The
+ ``market_ticker`` / ``side`` / ``count`` / ``price_cents`` fields are
+ populated only for ``position`` transfers, so they are optional here.
"""
transfer_id: str
@@ -77,6 +137,14 @@ class SubaccountTransfer(BaseModel):
to_subaccount: int
amount_cents: int
created_ts: int
+ # Spec v3.23.0 required additions.
+ exchange_index: int
+ transfer_type: Literal["cash", "position"]
+ # Position-transfer-only fields (absent on cash transfers).
+ market_ticker: str | None = None
+ side: Literal["yes", "no"] | None = None
+ count: int | None = None
+ price_cents: int | None = None
model_config = {"extra": "allow"}
diff --git a/kalshi/perps/models/margin_account.py b/kalshi/perps/models/margin_account.py
index e71ddde..b55591a 100644
--- a/kalshi/perps/models/margin_account.py
+++ b/kalshi/perps/models/margin_account.py
@@ -65,6 +65,9 @@ class MarginRiskPosition(BaseModel):
maintenance_margin_required: DollarDecimal | None = None
position_leverage: MultiplierDecimal | None = None
estimated_liquidation_price: DollarDecimal | None = None
+ # Spec v3.23.0 (required): True when the position is hedged within a
+ # portfolio, so its margin is computed at the portfolio level.
+ is_portfolio: bool
class GetMarginRiskResponse(BaseModel):
diff --git a/kalshi/perps/models/orders.py b/kalshi/perps/models/orders.py
index ae97ca7..ff15f06 100644
--- a/kalshi/perps/models/orders.py
+++ b/kalshi/perps/models/orders.py
@@ -41,6 +41,10 @@
OrderSourceLiteral = Literal["user", "system"]
"""Order source — user-placed or system (liquidation). Spec ``OrderSource`` (line 2036)."""
+OrderReasonLiteral = Literal["liquidation", "take_profit_stop_loss"]
+"""Reason for a system-generated order. Spec ``OrderReason`` — present only for
+liquidation and take-profit/stop-loss orders."""
+
LastUpdateReasonLiteral = Literal[
"",
"Decrease",
@@ -181,6 +185,8 @@ class MarginOrder(BaseModel):
cancel_order_on_pause: bool | None = None
order_group_id: str | None = None
order_source: OrderSourceLiteral | None = None
+ # Spec v3.23.0: present only for system-generated orders (liquidation, TP/SL).
+ order_reason: OrderReasonLiteral | None = None
class GetMarginOrderResponse(BaseModel):
diff --git a/kalshi/perps/models/portfolio.py b/kalshi/perps/models/portfolio.py
index 355eeba..7dfca78 100644
--- a/kalshi/perps/models/portfolio.py
+++ b/kalshi/perps/models/portfolio.py
@@ -56,12 +56,17 @@ class MarginPosition(BaseModel):
position: FixedPointCount
entry_price: DollarDecimal
unrealized_pnl: DollarDecimal
- margin_used: DollarDecimal
+ # Spec 3.23.0 relaxed margin_used from required to optional (still a property).
+ # Optional/defensive so a response omitting it does not hard-fail parsing.
+ margin_used: DollarDecimal | None = None
fees: DollarDecimal
return_on_equity: MultiplierDecimal | None = Field(
default=None,
validation_alias=AliasChoices("roe", "return_on_equity"),
)
+ # Spec v3.23.0 (required): True when the position is hedged within a
+ # portfolio, so its margin is computed at the portfolio level.
+ is_portfolio: bool
model_config = {"extra": "allow", "populate_by_name": True}
diff --git a/kalshi/resources/api_keys.py b/kalshi/resources/api_keys.py
index fff8227..640af82 100644
--- a/kalshi/resources/api_keys.py
+++ b/kalshi/resources/api_keys.py
@@ -28,12 +28,14 @@ def _build_create_api_key_body(
name: str | None,
public_key: str | None,
scopes: builtins.list[str] | None,
+ subaccount: int | None,
) -> dict[str, Any]:
_check_request_exclusive(
request,
name=name,
public_key=public_key,
scopes=scopes,
+ subaccount=subaccount,
)
if request is None:
if name is None or public_key is None:
@@ -42,6 +44,7 @@ def _build_create_api_key_body(
name=name,
public_key=public_key,
scopes=scopes,
+ subaccount=subaccount,
)
return request.model_dump(exclude_none=True, by_alias=True, mode="json")
@@ -51,12 +54,13 @@ def _build_generate_api_key_body(
*,
name: str | None,
scopes: builtins.list[str] | None,
+ subaccount: int | None,
) -> dict[str, Any]:
- _check_request_exclusive(request, name=name, scopes=scopes)
+ _check_request_exclusive(request, name=name, scopes=scopes, subaccount=subaccount)
if request is None:
if name is None:
raise TypeError("generate() requires `name` (or pass `request=...`)")
- request = GenerateApiKeyRequest(name=name, scopes=scopes)
+ request = GenerateApiKeyRequest(name=name, scopes=scopes, subaccount=subaccount)
return request.model_dump(exclude_none=True, by_alias=True, mode="json")
@@ -84,6 +88,7 @@ def create(
name: str,
public_key: str,
scopes: builtins.list[str] | None = ...,
+ subaccount: int | None = ...,
extra_headers: dict[str, str] | None = None,
) -> CreateApiKeyResponse: ...
def create(
@@ -93,6 +98,7 @@ def create(
name: str | None = None,
public_key: str | None = None,
scopes: builtins.list[str] | None = None,
+ subaccount: int | None = None,
extra_headers: dict[str, str] | None = None,
) -> CreateApiKeyResponse:
self._require_auth()
@@ -101,6 +107,7 @@ def create(
name=name,
public_key=public_key,
scopes=scopes,
+ subaccount=subaccount,
)
data = self._post("/api_keys", json=body, extra_headers=extra_headers)
return CreateApiKeyResponse.model_validate(data)
@@ -115,6 +122,7 @@ def generate(
*,
name: str,
scopes: builtins.list[str] | None = ...,
+ subaccount: int | None = ...,
extra_headers: dict[str, str] | None = None,
) -> GenerateApiKeyResponse: ...
def generate(
@@ -123,10 +131,13 @@ def generate(
request: GenerateApiKeyRequest | None = None,
name: str | None = None,
scopes: builtins.list[str] | None = None,
+ subaccount: int | None = None,
extra_headers: dict[str, str] | None = None,
) -> GenerateApiKeyResponse:
self._require_auth()
- body = _build_generate_api_key_body(request, name=name, scopes=scopes)
+ body = _build_generate_api_key_body(
+ request, name=name, scopes=scopes, subaccount=subaccount
+ )
data = self._post("/api_keys/generate", json=body, extra_headers=extra_headers)
return GenerateApiKeyResponse.model_validate(data)
@@ -154,6 +165,7 @@ async def create(
name: str,
public_key: str,
scopes: builtins.list[str] | None = ...,
+ subaccount: int | None = ...,
extra_headers: dict[str, str] | None = None,
) -> CreateApiKeyResponse: ...
async def create(
@@ -163,6 +175,7 @@ async def create(
name: str | None = None,
public_key: str | None = None,
scopes: builtins.list[str] | None = None,
+ subaccount: int | None = None,
extra_headers: dict[str, str] | None = None,
) -> CreateApiKeyResponse:
self._require_auth()
@@ -171,6 +184,7 @@ async def create(
name=name,
public_key=public_key,
scopes=scopes,
+ subaccount=subaccount,
)
data = await self._post("/api_keys", json=body, extra_headers=extra_headers)
return CreateApiKeyResponse.model_validate(data)
@@ -185,6 +199,7 @@ async def generate(
*,
name: str,
scopes: builtins.list[str] | None = ...,
+ subaccount: int | None = ...,
extra_headers: dict[str, str] | None = None,
) -> GenerateApiKeyResponse: ...
async def generate(
@@ -193,10 +208,13 @@ async def generate(
request: GenerateApiKeyRequest | None = None,
name: str | None = None,
scopes: builtins.list[str] | None = None,
+ subaccount: int | None = None,
extra_headers: dict[str, str] | None = None,
) -> GenerateApiKeyResponse:
self._require_auth()
- body = _build_generate_api_key_body(request, name=name, scopes=scopes)
+ body = _build_generate_api_key_body(
+ request, name=name, scopes=scopes, subaccount=subaccount
+ )
data = await self._post("/api_keys/generate", json=body, extra_headers=extra_headers)
return GenerateApiKeyResponse.model_validate(data)
diff --git a/kalshi/resources/multivariate.py b/kalshi/resources/multivariate.py
index 384ecfd..465a723 100644
--- a/kalshi/resources/multivariate.py
+++ b/kalshi/resources/multivariate.py
@@ -12,7 +12,6 @@
from kalshi.models.multivariate import (
CreateMarketInMultivariateEventCollectionRequest,
CreateMarketResponse,
- LookupPoint,
LookupTickersForMarketInMultivariateEventCollectionRequest,
LookupTickersResponse,
MultivariateCollectionStatusLiteral,
@@ -31,10 +30,6 @@
# Shared param + body builders (issue #46).
-# Spec /multivariate_event_collections/{ticker}/lookup (GET):
-# lookback_seconds enum is {10, 60, 300, 3600}.
-_VALID_LOOKBACK_SECONDS: frozenset[int] = frozenset({10, 60, 300, 3600})
-
# Spec marks these endpoints as deprecated (`deprecated: true`) with the
# message reproduced below. Applied to both sync and async classes via
# `typing_extensions.deprecated`, which emits DeprecationWarning on call
@@ -42,18 +37,6 @@
_DEPRECATION_MSG = "This endpoint predates RFQs and should not be used for new integrations."
-def _validate_lookback_seconds(value: int) -> int:
- """Reject ``lookback_seconds`` outside the spec enum {10, 60, 300, 3600}.
-
- Server returns 400 for anything else; failing client-side saves the
- round trip and surfaces a more actionable error (mirrors the limit
- bounds check added in #229).
- """
- if value not in _VALID_LOOKBACK_SECONDS:
- raise ValueError(f"lookback_seconds must be one of {{10, 60, 300, 3600}}, got {value}.")
- return value
-
-
def _list_collections_params(
*,
status: MultivariateCollectionStatusLiteral | None,
@@ -262,23 +245,6 @@ def lookup_tickers(
)
return _parse_lookup_tickers_response(data)
- @deprecated(_DEPRECATION_MSG)
- def lookup_history(
- self,
- collection_ticker: str,
- *,
- lookback_seconds: int,
- extra_headers: dict[str, str] | None = None,
- ) -> builtins.list[LookupPoint]:
- params = _params(lookback_seconds=_validate_lookback_seconds(lookback_seconds))
- data = self._get(
- f"/multivariate_event_collections/{_seg(collection_ticker, name='collection_ticker')}/lookup", # noqa: E501
- params=params,
- extra_headers=extra_headers,
- )
- raw = data.get("lookup_points", [])
- return [LookupPoint.model_validate(item) for item in raw]
-
class AsyncMultivariateCollectionsResource(AsyncResource):
"""Async multivariate event collections API."""
@@ -420,20 +386,3 @@ async def lookup_tickers(
extra_headers=extra_headers,
)
return _parse_lookup_tickers_response(data)
-
- @deprecated(_DEPRECATION_MSG)
- async def lookup_history(
- self,
- collection_ticker: str,
- *,
- lookback_seconds: int,
- extra_headers: dict[str, str] | None = None,
- ) -> builtins.list[LookupPoint]:
- params = _params(lookback_seconds=_validate_lookback_seconds(lookback_seconds))
- data = await self._get(
- f"/multivariate_event_collections/{_seg(collection_ticker, name='collection_ticker')}/lookup", # noqa: E501
- params=params,
- extra_headers=extra_headers,
- )
- raw = data.get("lookup_points", [])
- return [LookupPoint.model_validate(item) for item in raw]
diff --git a/kalshi/resources/subaccounts.py b/kalshi/resources/subaccounts.py
index e9b71c7..e6d6e1d 100644
--- a/kalshi/resources/subaccounts.py
+++ b/kalshi/resources/subaccounts.py
@@ -3,12 +3,15 @@
from __future__ import annotations
from collections.abc import AsyncIterator, Iterator
-from typing import Any, overload
+from typing import Any, Literal, overload
from uuid import UUID
from kalshi.models.common import Page
from kalshi.models.subaccounts import (
+ ApplySubaccountPositionTransferRequest,
+ ApplySubaccountPositionTransferResponse,
ApplySubaccountTransferRequest,
+ CreateSubaccountRequest,
CreateSubaccountResponse,
GetSubaccountBalancesResponse,
GetSubaccountNettingResponse,
@@ -67,6 +70,59 @@ def _build_transfer_body(
return request.model_dump(exclude_none=True, by_alias=True, mode="json")
+def _build_position_transfer_body(
+ request: ApplySubaccountPositionTransferRequest | None,
+ *,
+ client_transfer_id: UUID | str | None,
+ from_subaccount: int | None,
+ to_subaccount: int | None,
+ market_ticker: str | None,
+ side: Literal["yes", "no"] | None,
+ count: int | None,
+ price_cents: int | None,
+) -> dict[str, Any]:
+ _check_request_exclusive(
+ request,
+ client_transfer_id=client_transfer_id,
+ from_subaccount=from_subaccount,
+ to_subaccount=to_subaccount,
+ market_ticker=market_ticker,
+ side=side,
+ count=count,
+ price_cents=price_cents,
+ )
+ if request is None:
+ if (
+ client_transfer_id is None
+ or from_subaccount is None
+ or to_subaccount is None
+ or market_ticker is None
+ or side is None
+ or count is None
+ or price_cents is None
+ ):
+ raise TypeError(
+ "transfer_position() requires `client_transfer_id`, `from_subaccount`, "
+ "`to_subaccount`, `market_ticker`, `side`, `count`, and `price_cents` "
+ "(or pass `request=...`)"
+ )
+ # Accept str for caller ergonomics; coerce once to surface a clean
+ # ValueError on malformed strings before the model validator sees them.
+ uid = (
+ client_transfer_id if isinstance(client_transfer_id, UUID) else UUID(client_transfer_id)
+ )
+ request = ApplySubaccountPositionTransferRequest(
+ client_transfer_id=uid,
+ from_subaccount=from_subaccount,
+ to_subaccount=to_subaccount,
+ market_ticker=market_ticker,
+ side=side,
+ count=count,
+ price_cents=price_cents,
+ )
+ return request.model_dump(exclude_none=True, by_alias=True, mode="json")
+
+
def _build_update_netting_body(
request: UpdateSubaccountNettingRequest | None,
*,
@@ -97,17 +153,25 @@ class SubaccountsResource(SyncResource):
Subaccount 0 is the primary account; positive integers identify numbered
subaccounts (spec prose says ``1-63`` but defines no JSON-schema upper
bound, and demo has been observed allocating numbers above 32).
- POST /portfolio/subaccounts spins up the next subaccount with an
- empty body (spec takes no request payload).
+ POST /portfolio/subaccounts spins up the next subaccount; ``exchange_index``
+ optionally targets a specific exchange shard (spec v3.23.0).
"""
- def create(self, *, extra_headers: dict[str, str] | None = None) -> CreateSubaccountResponse:
+ def create(
+ self,
+ *,
+ exchange_index: int | None = None,
+ extra_headers: dict[str, str] | None = None,
+ ) -> CreateSubaccountResponse:
self._require_auth()
- # Spec defines no requestBody, but httpx omits Content-Type when no
- # body is passed and demo rejects the POST with `invalid_content_type`.
- # json={} forces Content-Type: application/json — same workaround
- # used on order_groups reset/trigger PUTs.
- data = self._post("/portfolio/subaccounts", json={}, extra_headers=extra_headers)
+ # Spec v3.23.0 defines an optional CreateSubaccountRequest body (a single
+ # optional exchange_index). When exchange_index is None the body is `{}`,
+ # which still forces Content-Type: application/json — demo rejects the
+ # POST with `invalid_content_type` when no body is passed at all.
+ body = CreateSubaccountRequest(exchange_index=exchange_index).model_dump(
+ exclude_none=True, by_alias=True, mode="json"
+ )
+ data = self._post("/portfolio/subaccounts", json=body, extra_headers=extra_headers)
return CreateSubaccountResponse.model_validate(data)
@overload
@@ -147,6 +211,62 @@ def transfer(
)
self._post("/portfolio/subaccounts/transfer", json=body, extra_headers=extra_headers)
+ @overload
+ def transfer_position(
+ self,
+ *,
+ request: ApplySubaccountPositionTransferRequest,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse: ...
+ @overload
+ def transfer_position(
+ self,
+ *,
+ client_transfer_id: UUID | str,
+ from_subaccount: int,
+ to_subaccount: int,
+ market_ticker: str,
+ side: Literal["yes", "no"],
+ count: int,
+ price_cents: int,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse: ...
+ def transfer_position(
+ self,
+ *,
+ request: ApplySubaccountPositionTransferRequest | None = None,
+ client_transfer_id: UUID | str | None = None,
+ from_subaccount: int | None = None,
+ to_subaccount: int | None = None,
+ market_ticker: str | None = None,
+ side: Literal["yes", "no"] | None = None,
+ count: int | None = None,
+ price_cents: int | None = None,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse:
+ """Move an open position between subaccounts (spec v3.23.0).
+
+ Unlike the cash-only :meth:`transfer`, this moves ``count`` contracts of
+ ``market_ticker`` (``side``) and returns the server-generated
+ ``position_transfer_id``. ``price_cents`` (0-100) sets the cost basis on
+ the destination.
+ """
+ self._require_auth()
+ body = _build_position_transfer_body(
+ request,
+ client_transfer_id=client_transfer_id,
+ from_subaccount=from_subaccount,
+ to_subaccount=to_subaccount,
+ market_ticker=market_ticker,
+ side=side,
+ count=count,
+ price_cents=price_cents,
+ )
+ data = self._post(
+ "/portfolio/subaccounts/positions/transfer", json=body, extra_headers=extra_headers
+ )
+ return ApplySubaccountPositionTransferResponse.model_validate(data)
+
def list_balances(
self, *, extra_headers: dict[str, str] | None = None
) -> GetSubaccountBalancesResponse:
@@ -231,12 +351,19 @@ class AsyncSubaccountsResource(AsyncResource):
"""Async subaccounts API."""
async def create(
- self, *, extra_headers: dict[str, str] | None = None
+ self,
+ *,
+ exchange_index: int | None = None,
+ extra_headers: dict[str, str] | None = None,
) -> CreateSubaccountResponse:
self._require_auth()
- # json={} forces Content-Type: application/json — demo rejects the
- # POST with `invalid_content_type` when no body is passed.
- data = await self._post("/portfolio/subaccounts", json={}, extra_headers=extra_headers)
+ # Spec v3.23.0 optional CreateSubaccountRequest body; `{}` when
+ # exchange_index is None still forces Content-Type: application/json —
+ # demo rejects the POST with `invalid_content_type` when no body is sent.
+ body = CreateSubaccountRequest(exchange_index=exchange_index).model_dump(
+ exclude_none=True, by_alias=True, mode="json"
+ )
+ data = await self._post("/portfolio/subaccounts", json=body, extra_headers=extra_headers)
return CreateSubaccountResponse.model_validate(data)
@overload
@@ -276,6 +403,59 @@ async def transfer(
)
await self._post("/portfolio/subaccounts/transfer", json=body, extra_headers=extra_headers)
+ @overload
+ async def transfer_position(
+ self,
+ *,
+ request: ApplySubaccountPositionTransferRequest,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse: ...
+ @overload
+ async def transfer_position(
+ self,
+ *,
+ client_transfer_id: UUID | str,
+ from_subaccount: int,
+ to_subaccount: int,
+ market_ticker: str,
+ side: Literal["yes", "no"],
+ count: int,
+ price_cents: int,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse: ...
+ async def transfer_position(
+ self,
+ *,
+ request: ApplySubaccountPositionTransferRequest | None = None,
+ client_transfer_id: UUID | str | None = None,
+ from_subaccount: int | None = None,
+ to_subaccount: int | None = None,
+ market_ticker: str | None = None,
+ side: Literal["yes", "no"] | None = None,
+ count: int | None = None,
+ price_cents: int | None = None,
+ extra_headers: dict[str, str] | None = None,
+ ) -> ApplySubaccountPositionTransferResponse:
+ """Move an open position between subaccounts (spec v3.23.0).
+
+ Async counterpart of :meth:`SubaccountsResource.transfer_position`.
+ """
+ self._require_auth()
+ body = _build_position_transfer_body(
+ request,
+ client_transfer_id=client_transfer_id,
+ from_subaccount=from_subaccount,
+ to_subaccount=to_subaccount,
+ market_ticker=market_ticker,
+ side=side,
+ count=count,
+ price_cents=price_cents,
+ )
+ data = await self._post(
+ "/portfolio/subaccounts/positions/transfer", json=body, extra_headers=extra_headers
+ )
+ return ApplySubaccountPositionTransferResponse.model_validate(data)
+
async def list_balances(
self, *, extra_headers: dict[str, str] | None = None
) -> GetSubaccountBalancesResponse:
diff --git a/kalshi/ws/models/market_lifecycle.py b/kalshi/ws/models/market_lifecycle.py
index 672ebbb..4e87c59 100644
--- a/kalshi/ws/models/market_lifecycle.py
+++ b/kalshi/ws/models/market_lifecycle.py
@@ -49,6 +49,11 @@ class MarketLifecyclePayload(BaseModel):
cap_strike: DollarDecimal | None = None
custom_strike: dict[str, Any] | None = None
price_level_structure: str | None = None
+ # v3.23.0 (#463): emitted alongside price_level_structure on `created` and
+ # `price_level_structure_updated`. Each entry is {start, end, step} in
+ # fixed-point dollars — the valid price bands for the market. Kept as
+ # list[dict] to match Market.price_ranges (no nested model yet).
+ price_ranges: list[dict[str, Any]] | None = None
yes_sub_title: str | None = None
model_config = {"extra": "allow", "populate_by_name": True}
diff --git a/pyproject.toml b/pyproject.toml
index b6fd421..3ec1cfd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "kalshi-sdk"
-version = "5.0.1"
+version = "6.0.0"
description = "A professional Python SDK for the Kalshi prediction markets and Perps (margin) APIs"
readme = "README.md"
license = { text = "MIT" }
diff --git a/specs/asyncapi.yaml b/specs/asyncapi.yaml
index f7b137c..557a4c2 100644
--- a/specs/asyncapi.yaml
+++ b/specs/asyncapi.yaml
@@ -414,7 +414,7 @@ channels:
- Market specification ignored
- Optional sharding for fanout control:
- - `shard_factor` (1-100) and `shard_key` (0 <= key < shard_factor)
+ - `shard_factor` (1-100) and `shard_key` (`0 <= key < shard_factor`)
- RFQ events (RFQCreated, RFQDeleted) always sent
- Quote events (QuoteCreated, QuoteAccepted, QuoteExecuted) are only sent
@@ -1699,6 +1699,10 @@ components:
market_ticker: INXD-23SEP14-B4487
event_type: price_level_structure_updated
price_level_structure: deci_cent
+ price_ranges:
+ - start: '0.0000'
+ end: '1.0000'
+ step: '0.0010'
- name: metadataUpdated
summary: Market metadata updated event
payload:
@@ -3173,6 +3177,31 @@ components:
- linear_cent
- deci_cent
- tapered_deci_cent
+ price_ranges:
+ type: array
+ description: >-
+ Optional - Emitted alongside price_level_structure (on market
+ creation and price_level_structure_updated events). The valid
+ price bands for the market, in fixed-point dollars. Use this to
+ determine valid order prices rather than hardcoding a tick size.
+ items:
+ type: object
+ required:
+ - start
+ - end
+ - step
+ properties:
+ start:
+ type: string
+ description: Starting price for this band, in dollars
+ end:
+ type: string
+ description: Ending price for this band, in dollars
+ step:
+ type: string
+ description: >-
+ Tick size (minimum price increment) within this band, in
+ dollars
strike_type:
type: string
description: >-
diff --git a/specs/openapi.yaml b/specs/openapi.yaml
index 0f9075c..215876d 100644
--- a/specs/openapi.yaml
+++ b/specs/openapi.yaml
@@ -1,10 +1,9 @@
openapi: 3.0.0
info:
title: Kalshi Trade API Manual Endpoints
- version: 3.22.0
- description: >-
- Manually defined OpenAPI spec for endpoints being migrated to spec-first
- approach
+ version: 3.23.0
+ description: Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
+
servers:
- url: https://external-api.kalshi.com/trade-api/v2
description: Production Trade API server
@@ -14,6 +13,7 @@ servers:
description: Demo Trade API server
- url: https://demo-api.kalshi.co/trade-api/v2
description: Demo shared API server, also supported
+
paths:
/exchange/status:
get:
@@ -47,6 +47,7 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ExchangeStatus'
+
/exchange/announcements:
get:
operationId: GetExchangeAnnouncements
@@ -63,6 +64,7 @@ paths:
$ref: '#/components/schemas/GetExchangeAnnouncementsResponse'
'500':
description: Internal server error
+
/series/fee_changes:
get:
operationId: GetSeriesFeeChanges
@@ -94,6 +96,7 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/exchange/schedule:
get:
operationId: GetExchangeSchedule
@@ -110,6 +113,7 @@ paths:
$ref: '#/components/schemas/GetExchangeScheduleResponse'
'500':
description: Internal server error
+
/exchange/user_data_timestamp:
get:
operationId: GetUserDataTimestamp
@@ -126,19 +130,14 @@ paths:
$ref: '#/components/schemas/GetUserDataTimestampResponse'
'500':
description: Internal server error
+
/series/{series_ticker}/markets/{ticker}/candlesticks:
get:
operationId: GetMarketCandlesticks
summary: Get Market Candlesticks
- description: >
- Time period length of each candlestick in minutes. Valid values: 1 (1
- minute), 60 (1 hour), 1440 (1 day).
-
- Candlesticks for markets that settled before the historical cutoff are
- only available via `GET /historical/markets/{ticker}/candlesticks`. See
- [Historical
- Data](https://docs.kalshi.com/getting_started/historical_data) for
- details.
+ description: |
+ Time period length of each candlestick in minutes. Valid values: 1 (1 minute), 60 (1 hour), 1440 (1 day).
+ Candlesticks for markets that settled before the historical cutoff are only available via `GET /historical/markets/{ticker}/candlesticks`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
tags:
- market
parameters:
@@ -157,49 +156,38 @@ paths:
- name: start_ts
in: query
required: true
- description: >-
- Start timestamp (Unix timestamp). Candlesticks will include those
- ending on or after this time.
+ description: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
schema:
type: integer
format: int64
- name: end_ts
in: query
required: true
- description: >-
- End timestamp (Unix timestamp). Candlesticks will include those
- ending on or before this time.
+ description: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
schema:
type: integer
format: int64
- name: period_interval
in: query
required: true
- description: >-
- Time period length of each candlestick in minutes. Valid values are
- 1 (1 minute), 60 (1 hour), or 1440 (1 day).
+ description: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
schema:
type: integer
- enum:
- - 1
- - 60
- - 1440
+ enum: [1, 60, 1440]
+ x-enum-varnames:
+ - GetMarketCandlesticksParamsPeriodIntervalN1
+ - GetMarketCandlesticksParamsPeriodIntervalN60
+ - GetMarketCandlesticksParamsPeriodIntervalN1440
x-oapi-codegen-extra-tags:
- validate: required,oneof=1 60 1440
+ validate: "required,oneof=1 60 1440"
- name: include_latest_before_start
in: query
required: false
- description: >
- If true, prepends the latest candlestick available before the
- start_ts. This synthetic candlestick is created by:
-
+ description: |
+ If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
1. Finding the most recent real candlestick before start_ts
-
- 2. Projecting it forward to the first period boundary (calculated as
- the next period interval after start_ts)
-
- 3. Setting all OHLC prices to null, and `previous_price` to the
- close price from the real candlestick
+ 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
+ 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
schema:
type: boolean
default: false
@@ -216,21 +204,13 @@ paths:
description: Not found
'500':
description: Internal server error
+
/markets/trades:
get:
operationId: GetTrades
summary: Get Trades
- description: >
- Endpoint for getting all trades for all markets. A trade represents a
- completed transaction between two users on a specific market. Each trade
- includes the market ticker, price, quantity, and timestamp information.
- Block trades are included in the response by default and identified by
- the `is_block_trade` field; use the `is_block_trade` query parameter to
- filter by block / non-block. This endpoint returns a paginated response.
- Use the 'limit' parameter to control page size (1-1000, defaults to
- 100). The response includes a 'cursor' field - pass this value in the
- 'cursor' parameter of your next request to get the next page. An empty
- cursor indicates no more pages are available.
+ description: |
+ Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. Block trades are included in the response by default and identified by the `is_block_trade` field; use the `is_block_trade` query parameter to filter by block / non-block. This endpoint returns a paginated response. Use the 'limit' parameter to control page size (1-1000, defaults to 100). The response includes a 'cursor' field - pass this value in the 'cursor' parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
tags:
- market
parameters:
@@ -251,6 +231,7 @@ paths:
description: Bad request
'500':
description: Internal server error
+
/markets/{ticker}/orderbook:
get:
operationId: GetMarketOrderbook
@@ -266,9 +247,7 @@ paths:
- $ref: '#/components/parameters/TickerPath'
- name: depth
in: query
- description: >-
- Depth of the orderbook to retrieve (0 or negative means all levels,
- 1-100 for specific depth)
+ description: Depth of the orderbook to retrieve (0 or negative means all levels, 1-100 for specific depth)
required: false
schema:
type: integer
@@ -290,20 +269,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/markets/orderbooks:
get:
operationId: GetMarketOrderbooks
summary: Get Multiple Market Orderbooks
- description: >-
- Endpoint for getting the current order books for multiple markets in a
- single request. The order book shows all active bid orders for both yes
- and no sides of a binary market. It returns yes bids and no bids only
- (no asks are returned). This is because in binary markets, a bid for yes
- at price X is equivalent to an ask for no at price (100-X). For example,
- a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract
- sizes. Each side shows price levels with their corresponding quantities
- and order counts, organized from best to worst prices. Returns one
- orderbook per requested market ticker.
+ description: 'Endpoint for getting the current order books for multiple markets in a single request. The order book shows all active bid orders for both yes and no sides of a binary market. It returns yes bids and no bids only (no asks are returned). This is because in binary markets, a bid for yes at price X is equivalent to an ask for no at price (100-X). For example, a yes bid at 7¢ is the same as a no ask at 93¢, with identical contract sizes. Each side shows price levels with their corresponding quantities and order counts, organized from best to worst prices. Returns one orderbook per requested market ticker.'
tags:
- market
security:
@@ -339,6 +310,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/series/{series_ticker}:
get:
operationId: GetSeries
@@ -360,9 +332,7 @@ paths:
type: boolean
default: false
x-go-type-skip-optional-pointer: true
- description: >-
- If true, includes the total volume traded across all events in this
- series.
+ description: If true, includes the total volume traded across all events in this series.
responses:
'200':
description: Series retrieved successfully
@@ -374,6 +344,7 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/series:
get:
operationId: GetSeriesList
@@ -408,15 +379,11 @@ paths:
type: boolean
default: false
x-go-type-skip-optional-pointer: true
- description: >-
- If true, includes the total volume traded across all events in each
- series.
+ description: If true, includes the total volume traded across all events in each series.
- name: min_updated_ts
in: query
required: false
- description: >-
- Filter series with metadata updated after this Unix timestamp (in
- seconds). Use this to efficiently poll for changes.
+ description: Filter series with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
schema:
type: integer
format: int64
@@ -431,24 +398,25 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/markets:
get:
operationId: GetMarkets
summary: Get Markets
- description: >
- Filter by market status. Possible values: `unopened`, `open`, `closed`,
- `settled`. Leave empty to return markets with any status.
- - Only one `status` filter may be supplied at a time.
- - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters.
-
- | Compatible Timestamp Filters | Additional Status Filters| Extra Notes |
- |------------------------------|--------------------------|-------------|
- | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | |
- | min_close_ts, max_close_ts | `closed`, *empty* | |
- | min_settled_ts, max_settled_ts | `settled`, *empty* | |
- | min_updated_ts | *empty* | Incompatible with all filters besides `mve_filter=exclude`. May be combined with `series_ticker`, which requires `mve_filter=exclude` |
-
- Markets that settled before the historical cutoff are only available via `GET /historical/markets`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
+ description: |
+ Filter by market status. Possible values: `unopened`, `open`, `closed`, `settled`. Leave empty to return markets with any status.
+ - Only one `status` filter may be supplied at a time.
+ - Timestamp filters will be mutually exclusive from other timestamp filters and certain status filters.
+
+ | Compatible Timestamp Filters | Additional Status Filters| Extra Notes |
+ |------------------------------|--------------------------|-------------|
+ | min_created_ts, max_created_ts | `unopened`, `open`, *empty* | |
+ | min_close_ts, max_close_ts | `closed`, *empty* | |
+ | min_settled_ts, max_settled_ts | `settled`, *empty* | |
+ | min_updated_ts | *empty* | Incompatible with all filters besides `mve_filter=exclude`. May be combined with `series_ticker`, which requires `mve_filter=exclude` |
+
+ Markets that settled before the historical cutoff are only available via `GET /historical/markets`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
+
tags:
- market
parameters:
@@ -479,6 +447,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/markets/{ticker}:
get:
operationId: GetMarket
@@ -501,22 +470,18 @@ paths:
description: Not found
'500':
description: Internal server error
+
/markets/candlesticks:
get:
operationId: BatchGetMarketCandlesticks
summary: Batch Get Market Candlesticks
- description: >
+ description: |
Endpoint for retrieving candlestick data for multiple markets.
-
- Accepts up to 100 market tickers per request
-
- Returns up to 10,000 candlesticks total across all markets
-
- Returns candlesticks grouped by market_id
-
- - Optionally includes a synthetic initial candlestick for price
- continuity (see `include_latest_before_start` parameter)
+ - Optionally includes a synthetic initial candlestick for price continuity (see `include_latest_before_start` parameter)
tags:
- market
parameters:
@@ -551,17 +516,11 @@ paths:
- name: include_latest_before_start
in: query
required: false
- description: >
- If true, prepends the latest candlestick available before the
- start_ts. This synthetic candlestick is created by:
-
+ description: |
+ If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
1. Finding the most recent real candlestick before start_ts
-
- 2. Projecting it forward to the first period boundary (calculated as
- the next period interval after start_ts)
-
- 3. Setting all OHLC prices to null, and `previous_price` to the
- close price from the real candlestick
+ 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
+ 3. Setting all OHLC prices to null, and `previous_price` to the close price from the real candlestick
schema:
type: boolean
default: false
@@ -578,6 +537,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/series/{series_ticker}/events/{ticker}/candlesticks:
get:
operationId: GetMarketCandlesticksByEvent
@@ -606,7 +566,7 @@ paths:
type: integer
format: int64
x-oapi-codegen-extra-tags:
- validate: required
+ validate: "required"
- name: end_ts
in: query
required: true
@@ -615,22 +575,17 @@ paths:
type: integer
format: int64
x-oapi-codegen-extra-tags:
- validate: required
+ validate: "required"
- name: period_interval
in: query
required: true
- description: >-
- Specifies the length of each candlestick period, in minutes. Must be
- one minute, one hour, or one day.
+ description: Specifies the length of each candlestick period, in minutes. Must be one minute, one hour, or one day.
schema:
type: integer
format: int32
- enum:
- - 1
- - 60
- - 1440
+ enum: [1, 60, 1440]
x-oapi-codegen-extra-tags:
- validate: required,oneof=1 60 1440
+ validate: "required,oneof=1 60 1440"
responses:
'200':
description: Event candlesticks retrieved successfully
@@ -644,27 +599,22 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/events:
get:
operationId: GetEvents
summary: Get Events
- description: >
+ description: |
Get all events. This endpoint excludes multivariate events.
-
- To retrieve multivariate events, use the GET /events/multivariate
- endpoint.
-
- All events are accessible through this endpoint, even if their
- associated markets are older than the historical cutoff.
+ To retrieve multivariate events, use the GET /events/multivariate endpoint.
+ All events are accessible through this endpoint, even if their associated markets are older than the historical cutoff.
tags:
- events
parameters:
- name: limit
in: query
required: false
- description: >-
- Parameter to specify the number of results per page. Defaults to
- 200. Maximum value is 200.
+ description: Parameter to specify the number of results per page. Defaults to 200. Maximum value is 200.
schema:
type: integer
minimum: 1
@@ -673,21 +623,13 @@ paths:
- name: cursor
in: query
required: false
- description: >-
- Parameter to specify the pagination cursor. Use the cursor value
- returned from the previous response to get the next page of results.
- Leave empty for the first page.
+ description: Parameter to specify the pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
schema:
type: string
- name: with_nested_markets
in: query
required: false
- description: >-
- Parameter to specify if nested markets should be included in the
- response. When true, each event will include a 'markets' field
- containing a list of Market objects associated with that event.
- Historical markets settled before the historical cutoff will not be
- included.
+ description: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event. Historical markets settled before the historical cutoff will not be included.
schema:
type: boolean
default: false
@@ -703,33 +645,23 @@ paths:
- name: status
in: query
required: false
- description: >-
- Filter by event status. Possible values are 'unopened', 'open',
- 'closed', 'settled'. Leave empty to return events with any status.
+ description: Filter by event status. Possible values are 'unopened', 'open', 'closed', 'settled'. Leave empty to return events with any status.
schema:
type: string
- enum:
- - unopened
- - open
- - closed
- - settled
+ enum: ['unopened', 'open', 'closed', 'settled']
- $ref: '#/components/parameters/SeriesTickerQuery'
- $ref: '#/components/parameters/EventTickersQuery'
- name: min_close_ts
in: query
required: false
- description: >-
- Filter events with at least one market with close timestamp greater
- than this Unix timestamp (in seconds).
+ description: Filter events with at least one market with close timestamp greater than this Unix timestamp (in seconds).
schema:
type: integer
format: int64
- name: min_updated_ts
in: query
required: false
- description: >-
- Filter events with metadata updated after this Unix timestamp (in
- seconds). Use this to efficiently poll for changes.
+ description: Filter events with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
schema:
type: integer
format: int64
@@ -746,14 +678,12 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/events/multivariate:
get:
operationId: GetMultivariateEvents
summary: Get Multivariate Events
- description: >-
- Retrieve multivariate (combo) events. These are dynamically created
- events from multivariate event collections. Supports filtering by series
- and collection ticker.
+ description: 'Retrieve multivariate (combo) events. These are dynamically created events from multivariate event collections. Supports filtering by series and collection ticker.'
tags:
- events
parameters:
@@ -769,28 +699,20 @@ paths:
- name: cursor
in: query
required: false
- description: >-
- Pagination cursor. Use the cursor value returned from the previous
- response to get the next page of results.
+ description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results.
schema:
type: string
- $ref: '#/components/parameters/SeriesTickerQuery'
- name: collection_ticker
in: query
required: false
- description: >-
- Filter events by collection ticker. Returns only multivariate events
- belonging to the specified collection. Cannot be used together with
- series_ticker.
+ description: Filter events by collection ticker. Returns only multivariate events belonging to the specified collection. Cannot be used together with series_ticker.
schema:
type: string
- name: with_nested_markets
in: query
required: false
- description: >-
- Parameter to specify if nested markets should be included in the
- response. When true, each event will include a 'markets' field
- containing a list of Market objects associated with that event.
+ description: Parameter to specify if nested markets should be included in the response. When true, each event will include a 'markets' field containing a list of Market objects associated with that event.
schema:
type: boolean
default: false
@@ -807,14 +729,13 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/events/fee_changes:
get:
operationId: GetEventFeeChanges
summary: Get Event Fee Changes
- description: >
- Event fees are an override layered on top of the parent series' fee
- structure. If `fee_type_override` and `fee_multiplier_override` are
- null, that indicates the override is cleared.
+ description: |
+ Event fees are an override layered on top of the parent series' fee structure. If `fee_type_override` and `fee_multiplier_override` are null, that indicates the override is cleared.
tags:
- events
parameters:
@@ -837,20 +758,15 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/events/{event_ticker}:
get:
operationId: GetEvent
summary: Get Event
- description: >
- Endpoint for getting data about an event by its ticker. An event
- represents a real-world occurrence that can be traded on, such as an
- election, sports game, or economic indicator release.
-
- Events contain one or more markets where users can place trades on
- different outcomes.
-
- All events are accessible through this endpoint, even if their
- associated markets are older than the historical cutoff.
+ description: |
+ Endpoint for getting data about an event by its ticker. An event represents a real-world occurrence that can be traded on, such as an election, sports game, or economic indicator release.
+ Events contain one or more markets where users can place trades on different outcomes.
+ All events are accessible through this endpoint, even if their associated markets are older than the historical cutoff.
tags:
- events
parameters:
@@ -863,11 +779,7 @@ paths:
- name: with_nested_markets
in: query
required: false
- description: >-
- If true, markets are included within the event object. If false
- (default), markets are returned as a separate top-level field in the
- response. Historical markets settled before the historical cutoff
- will not be included.
+ description: If true, markets are included within the event object. If false (default), markets are returned as a separate top-level field in the response. Historical markets settled before the historical cutoff will not be included.
schema:
type: boolean
default: false
@@ -881,12 +793,13 @@ paths:
$ref: '#/components/schemas/GetEventResponse'
'400':
description: Bad request
- '401':
- description: Unauthorized
'404':
description: Event not found
+ '401':
+ description: Unauthorized
'500':
description: Internal server error
+
/events/{event_ticker}/metadata:
get:
operationId: GetEventMetadata
@@ -910,19 +823,18 @@ paths:
$ref: '#/components/schemas/GetEventMetadataResponse'
'400':
description: Bad request
- '401':
- description: Unauthorized
'404':
description: Event not found
+ '401':
+ description: Unauthorized
'500':
description: Internal server error
+
/series/{series_ticker}/events/{ticker}/forecast_percentile_history:
get:
operationId: GetEventForecastPercentilesHistory
summary: Get Event Forecast Percentile History
- description: >-
- Endpoint for getting the historical raw and formatted forecast numbers
- for an event at specific percentiles.
+ description: Endpoint for getting the historical raw and formatted forecast numbers for an event at specific percentiles.
tags:
- events
security:
@@ -973,44 +885,32 @@ paths:
- name: period_interval
in: query
required: true
- description: >-
- Specifies the length of each forecast period, in minutes. 0 for
- 5-second intervals, or 1, 60, or 1440 for minute-based intervals.
+ description: Specifies the length of each forecast period, in minutes. 0 for 5-second intervals, or 1, 60, or 1440 for minute-based intervals.
schema:
type: integer
format: int32
- enum:
- - 0
- - 1
- - 60
- - 1440
+ enum: [0, 1, 60, 1440]
responses:
'200':
description: Event forecast percentile history retrieved successfully
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/GetEventForecastPercentilesHistoryResponse
+ $ref: '#/components/schemas/GetEventForecastPercentilesHistoryResponse'
'400':
description: Bad request
'401':
description: Unauthorized
'500':
description: Internal server error
+
/portfolio/orders:
get:
operationId: GetOrders
summary: Get Orders
- description: >
- Restricts the response to orders that have a certain status: resting,
- canceled, or executed.
-
- Orders that have been canceled or fully executed before the historical
- cutoff are only available via `GET /historical/orders`. Resting orders
- will always be available through this endpoint. See [Historical
- Data](https://docs.kalshi.com/getting_started/historical_data) for
- details.
+ description: |
+ Restricts the response to orders that have a certain status: resting, canceled, or executed.
+ Orders that have been canceled or fully executed before the historical cutoff are only available via `GET /historical/orders`. Resting orders will always be available through this endpoint. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
tags:
- orders
security:
@@ -1039,19 +939,16 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/orders/{order_id}:
get:
operationId: GetOrder
summary: Get Order
description: ' Endpoint for getting a single order.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- orders
@@ -1074,6 +971,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/orders/queue_positions:
get:
operationId: GetOrderQueuePositions
@@ -1110,6 +1008,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/orders/{order_id}/queue_position:
get:
operationId: GetOrderQueuePosition
@@ -1136,16 +1035,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/events/orders:
post:
operationId: CreateOrderV2
summary: Create Order (V2)
- description: >-
- Endpoint for submitting event-market orders using the V2
- request/response shape (single-book `bid`/`ask` side and fixed-point
- dollar prices). The legacy `/portfolio/orders` endpoint will be
- deprecated no earlier than May 6, 2026 — clients should migrate to this
- path.
+ description: 'Endpoint for submitting event-market orders using the V2 request/response shape (single-book `bid`/`ask` side and fixed-point dollar prices). The legacy `/portfolio/orders` endpoint will be deprecated no earlier than May 6, 2026 — clients should migrate to this path.'
tags:
- orders
security:
@@ -1175,24 +1070,16 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/events/orders/batched:
post:
operationId: BatchCreateOrdersV2
summary: Batch Create Orders (V2)
- description: >-
- Endpoint for submitting a batch of event-market orders using the V2
- request/response shape. The maximum batch size scales with your tier's
- write budget — see [Rate Limits and
- Tiers](/getting_started/rate_limits).
+ description: 'Endpoint for submitting a batch of event-market orders using the V2 request/response shape. The maximum batch size scales with your tier''s write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 10 tokens per order in the batch — billed per item, so
- total cost for a batch of N orders is N × 10. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 10 tokens per order in the batch — billed per item, so total cost for a batch of N orders is N × 10. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- orders
@@ -1221,22 +1108,15 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
delete:
operationId: BatchCancelOrdersV2
summary: Batch Cancel Orders (V2)
- description: >-
- Endpoint for cancelling a batch of event-market orders using the V2
- response shape. The maximum batch size scales with your tier's write
- budget — see [Rate Limits and Tiers](/getting_started/rate_limits).
+ description: 'Endpoint for cancelling a batch of event-market orders using the V2 response shape. The maximum batch size scales with your tier''s write budget — see [Rate Limits and Tiers](/getting_started/rate_limits).'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per order in the batch — billed per item, so
- total cost for a batch of N cancels is N × 2. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per order in the batch — billed per item, so total cost for a batch of N cancels is N × 2. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- orders
@@ -1265,22 +1145,16 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/events/orders/{order_id}:
delete:
operationId: CancelOrderV2
summary: Cancel Order (V2)
- description: >-
- Endpoint for cancelling event-market orders using the V2 response shape.
- Returns `{order_id, client_order_id, reduced_by}` rather than a full
- order object.
+ description: 'Endpoint for cancelling event-market orders using the V2 response shape. Returns `{order_id, client_order_id, reduced_by}` rather than a full order object.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- orders
@@ -1311,25 +1185,16 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/events/orders/{order_id}/amend:
post:
operationId: AmendOrderV2
summary: Amend Order (V2)
- description: >-
- Endpoint for amending the price and/or max fillable count of an existing
- event-market order using the V2 request/response shape. The request
- `count` is the updated total/max fillable count, equal to already filled
- count plus desired resting remaining count. This behavior matches the v1
- amend endpoints; only the request/response shape differs.
+ description: 'Endpoint for amending the price and/or max fillable count of an existing event-market order using the V2 request/response shape. The request `count` is the updated total/max fillable count, equal to already filled count plus desired resting remaining count. This behavior matches the v1 amend endpoints; only the request/response shape differs.'
x-mint:
- content: >
+ content: |
-
- Amending a resting order preserves queue position only when the
- amendment decreases size. All other amendments — like increasing size
- or changing price forfeit queue position and place the order at the
- back of the queue.
-
+ Amending a resting order preserves queue position only when the amendment decreases size. All other amendments — like increasing size or changing price forfeit queue position and place the order at the back of the queue.
tags:
- orders
@@ -1361,14 +1226,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/events/orders/{order_id}/decrease:
post:
operationId: DecreaseOrderV2
summary: Decrease Order (V2)
- description: >-
- Endpoint for decreasing the remaining count of an existing event-market
- order using the V2 request/response shape. Exactly one of `reduce_by` or
- `reduce_to` must be provided.
+ description: 'Endpoint for decreasing the remaining count of an existing event-market order using the V2 request/response shape. Exactly one of `reduce_by` or `reduce_to` must be provided.'
tags:
- orders
security:
@@ -1399,6 +1262,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups:
get:
operationId: GetOrderGroups
@@ -1425,6 +1289,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups/create:
post:
operationId: CreateOrderGroup
@@ -1455,6 +1320,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups/{order_group_id}:
get:
operationId: GetOrderGroup
@@ -1509,6 +1375,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups/{order_group_id}/reset:
put:
operationId: ResetOrderGroup
@@ -1543,6 +1410,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups/{order_group_id}/trigger:
put:
operationId: TriggerOrderGroup
@@ -1577,6 +1445,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/order_groups/{order_group_id}/limit:
put:
operationId: UpdateOrderGroupLimit
@@ -1612,14 +1481,13 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
+ # Portfolio endpoints
/portfolio/balance:
get:
operationId: GetBalance
summary: Get Balance
- description: >-
- Endpoint for getting the balance and portfolio value of a member. Both
- values are returned in cents. This endpoint also accepts API keys with
- the 'read::portfolio_balance' scope.
+ description: "Endpoint for getting the balance and portfolio value of a member. Both values are returned in cents. This endpoint also accepts API keys with the 'read::portfolio_balance' scope."
tags:
- portfolio
security:
@@ -1639,21 +1507,24 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/subaccounts:
post:
operationId: CreateSubaccount
summary: Create Subaccount
- description: >-
- Creates a new subaccount for the authenticated user. This endpoint is
- currently only available to institutions and market makers. Subaccounts
- are numbered sequentially starting from 1. Maximum 63 numbered
- subaccounts per user (64 including the primary account).
+ description: 'Creates a new subaccount for the authenticated user. This endpoint is currently only available to institutions and market makers. Subaccounts are numbered sequentially starting from 1. Maximum 63 numbered subaccounts per user (64 including the primary account).'
tags:
- portfolio
security:
- kalshiAccessKey: []
kalshiAccessSignature: []
kalshiAccessTimestamp: []
+ requestBody:
+ required: false
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateSubaccountRequest'
responses:
'201':
description: Subaccount created successfully
@@ -1667,13 +1538,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/subaccounts/transfer:
post:
operationId: ApplySubaccountTransfer
summary: Transfer Between Subaccounts
- description: >-
- Transfers funds between the authenticated user's subaccounts. Use 0 for
- the primary account, or 1-63 for numbered subaccounts.
+ description: 'Transfers funds between the authenticated user''s subaccounts. Use 0 for the primary account, or 1-63 for numbered subaccounts. Set exchange_index to apply the transfer on a specific exchange shard (defaults to 0).'
tags:
- portfolio
security:
@@ -1699,11 +1569,49 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
+ /portfolio/subaccounts/positions/transfer:
+ post:
+ operationId: ApplySubaccountPositionTransfer
+ summary: Transfer Position Between Subaccounts
+ description: >-
+ Moves an existing position between two of the authenticated user's own subaccounts.
+ Use 0 for the primary account, or 1-63 for numbered subaccounts.
+ The transfer is idempotent on `client_transfer_id`: retrying with the same value returns 409.
+ `price_cents` is the per-contract transfer price — see the [Subaccounts](/getting_started/subaccounts) page for how it sets cost basis and P&L.
+ tags:
+ - portfolio
+ security:
+ - kalshiAccessKey: []
+ kalshiAccessSignature: []
+ kalshiAccessTimestamp: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApplySubaccountPositionTransferRequest'
+ responses:
+ '200':
+ description: Position transfer completed successfully
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApplySubaccountPositionTransferResponse'
+ '400':
+ $ref: '#/components/responses/BadRequestError'
+ '401':
+ $ref: '#/components/responses/UnauthorizedError'
+ '409':
+ $ref: '#/components/responses/ConflictError'
+ '500':
+ $ref: '#/components/responses/InternalServerError'
+
/portfolio/subaccounts/balances:
get:
operationId: GetSubaccountBalances
summary: Get All Subaccount Balances
- description: Gets balances for all subaccounts including the primary account.
+ description: 'Gets balances for all subaccounts including the primary account.'
tags:
- portfolio
security:
@@ -1721,13 +1629,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/subaccounts/transfers:
get:
operationId: GetSubaccountTransfers
summary: Get Subaccount Transfers
- description: >-
- Gets a paginated list of all transfers between subaccounts for the
- authenticated user.
+ description: 'Gets a paginated list of all transfers between subaccounts for the authenticated user.'
tags:
- portfolio
security:
@@ -1748,13 +1655,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/subaccounts/netting:
put:
operationId: UpdateSubaccountNetting
summary: Update Subaccount Netting
- description: >-
- Updates the netting enabled setting for a specific subaccount. Use 0 for
- the primary account, or 1-63 for numbered subaccounts.
+ description: 'Updates the netting enabled setting for a specific subaccount. Use 0 for the primary account, or 1-63 for numbered subaccounts.'
tags:
- portfolio
security:
@@ -1779,7 +1685,7 @@ paths:
get:
operationId: GetSubaccountNetting
summary: Get Subaccount Netting
- description: Gets the netting enabled settings for all subaccounts.
+ description: 'Gets the netting enabled settings for all subaccounts.'
tags:
- portfolio
security:
@@ -1797,14 +1703,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/positions:
get:
operationId: GetPositions
summary: Get Positions
- description: >-
- Restricts the positions to those with any of following fields with
- non-zero values, as a comma separated list. The following values are
- accepted: position, total_traded
+ description: 'Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted: position, total_traded'
tags:
- portfolio
security:
@@ -1831,6 +1735,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/settlements:
get:
operationId: GetSettlements
@@ -1863,11 +1768,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/deposits:
get:
operationId: GetDeposits
summary: Get Deposits
- description: Endpoint for getting the member's deposit history.
+ description: 'Endpoint for getting the member''s deposit history.'
tags:
- portfolio
security:
@@ -1890,11 +1796,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/withdrawals:
get:
operationId: GetWithdrawals
summary: Get Withdrawals
- description: Endpoint for getting the member's withdrawal history.
+ description: 'Endpoint for getting the member''s withdrawal history.'
tags:
- portfolio
security:
@@ -1917,6 +1824,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/summary/total_resting_order_value:
get:
operationId: GetPortfolioRestingOrderTotalValue
@@ -1934,24 +1842,19 @@ paths:
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/GetPortfolioRestingOrderTotalValueResponse
+ $ref: '#/components/schemas/GetPortfolioRestingOrderTotalValueResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/fills:
get:
operationId: GetFills
summary: Get Fills
- description: >
- Endpoint for getting all fills for the member. A fill is when a trade
- you have is matched.
-
- Fills that occurred before the historical cutoff are only available via
- `GET /historical/fills`. See [Historical
- Data](https://docs.kalshi.com/getting_started/historical_data) for
- details.
+ description: |
+ Endpoint for getting all fills for the member. A fill is when a trade you have is matched.
+ Fills that occurred before the historical cutoff are only available via `GET /historical/fills`. See [Historical Data](https://docs.kalshi.com/getting_started/historical_data) for details.
tags:
- portfolio
security:
@@ -1979,6 +1882,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/communications/id:
get:
operationId: GetCommunicationsID
@@ -2001,6 +1905,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/block-trade-proposals:
get:
operationId: GetBlockTradeProposals
@@ -2017,9 +1922,7 @@ paths:
- $ref: '#/components/parameters/MarketTickerQuery'
- name: limit
in: query
- description: >-
- Parameter to specify the number of results per page. Defaults to
- 100.
+ description: Parameter to specify the number of results per page. Defaults to 100.
schema:
type: integer
format: int32
@@ -2044,6 +1947,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
post:
operationId: ProposeBlockTrade
summary: Propose Block Trade
@@ -2075,6 +1979,7 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/block-trade-proposals/{block_trade_proposal_id}/accept:
post:
operationId: AcceptBlockTradeProposal
@@ -2110,6 +2015,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/rfqs:
get:
operationId: GetRFQs
@@ -2128,9 +2034,7 @@ paths:
- $ref: '#/components/parameters/SubaccountQuery'
- name: limit
in: query
- description: >-
- Parameter to specify the number of results per page. Defaults to
- 100.
+ description: Parameter to specify the number of results per page. Defaults to 100.
schema:
type: integer
format: int32
@@ -2155,7 +2059,7 @@ paths:
$ref: '#/components/schemas/UserFilter'
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
- validate: omitempty,oneof=self
+ validate: "omitempty,oneof=self"
responses:
'200':
description: RFQs retrieved successfully
@@ -2167,6 +2071,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
post:
operationId: CreateRFQ
summary: Create RFQ
@@ -2198,6 +2103,7 @@ paths:
$ref: '#/components/responses/ConflictError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/rfqs/{rfq_id}:
get:
operationId: GetRFQ
@@ -2224,6 +2130,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
delete:
operationId: DeleteRFQ
summary: Delete RFQ
@@ -2245,19 +2152,16 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/rfqs/{rfq_id}/quotes/{quote_id}:
delete:
operationId: DeleteRFQQuote
summary: Delete RFQ Quote
description: ' Endpoint for deleting a quote scoped to its RFQ, which means it can no longer be accepted.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- communications
@@ -2277,6 +2181,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/rfqs/{rfq_id}/quotes/{quote_id}/accept:
put:
operationId: AcceptRFQQuote
@@ -2308,6 +2213,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/rfqs/{rfq_id}/quotes/{quote_id}/confirm:
put:
operationId: ConfirmRFQQuote
@@ -2337,6 +2243,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/quotes:
get:
operationId: GetQuotes
@@ -2352,25 +2259,19 @@ paths:
- $ref: '#/components/parameters/CursorQuery'
- name: min_ts
in: query
- description: >-
- Restricts the response to quotes last updated after a timestamp,
- formatted as a Unix Timestamp
+ description: Restricts the response to quotes last updated after a timestamp, formatted as a Unix Timestamp
schema:
type: integer
format: int64
- name: max_ts
in: query
- description: >-
- Restricts the response to quotes last updated before a timestamp,
- formatted as a Unix Timestamp
+ description: Restricts the response to quotes last updated before a timestamp, formatted as a Unix Timestamp
schema:
type: integer
format: int64
- name: limit
in: query
- description: >-
- Parameter to specify the number of results per page. Defaults to
- 500.
+ description: Parameter to specify the number of results per page. Defaults to 500.
schema:
type: integer
format: int32
@@ -2398,18 +2299,16 @@ paths:
$ref: '#/components/schemas/UserFilter'
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
- validate: omitempty,oneof=self
+ validate: "omitempty,oneof=self"
- name: rfq_user_filter
in: query
required: false
- description: >-
- Filter for quotes responding to RFQs created by the authenticated
- user.
+ description: Filter for quotes responding to RFQs created by the authenticated user.
schema:
$ref: '#/components/schemas/UserFilter'
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
- validate: omitempty,oneof=self
+ validate: "omitempty,oneof=self"
- name: rfq_creator_user_id
in: query
description: Filter quotes by RFQ creator user ID
@@ -2440,18 +2339,15 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
post:
operationId: CreateQuote
summary: Create Quote
description: ' Endpoint for creating a quote in response to an RFQ'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- communications
@@ -2478,19 +2374,16 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/quotes/{quote_id}:
get:
operationId: GetQuote
summary: Get Quote
description: ' Endpoint for getting a particular quote'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- communications
@@ -2513,18 +2406,15 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
delete:
operationId: DeleteQuote
summary: Delete Quote
description: ' Endpoint for deleting a quote, which means it can no longer be accepted.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- communications
@@ -2543,6 +2433,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/quotes/{quote_id}/accept:
put:
operationId: AcceptQuote
@@ -2573,6 +2464,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/communications/quotes/{quote_id}/confirm:
put:
operationId: ConfirmQuote
@@ -2601,6 +2493,8 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
+ # Multivariate Event Collections endpoints
/api_keys:
get:
operationId: GetApiKeys
@@ -2623,6 +2517,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
post:
operationId: CreateApiKey
summary: Create API Key
@@ -2654,6 +2549,7 @@ paths:
description: Forbidden - insufficient API usage level
'500':
description: Internal server error
+
/api_keys/generate:
post:
operationId: GenerateApiKey
@@ -2684,6 +2580,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/api_keys/{api_key}:
delete:
operationId: DeleteApiKey
@@ -2713,14 +2610,12 @@ paths:
description: API key not found
'500':
description: Internal server error
+
/account/limits:
get:
operationId: GetAccountApiLimits
- summary: Get Account API Limits
- description: >-
- Endpoint to retrieve the authenticated user's Predictions API usage tier
- and token-bucket limits. Public Predictions tiers include Basic,
- Advanced, Expert, Premier, Paragon, Prime, and Prestige.
+ summary: Get Account API Limits
+ description: 'Endpoint to retrieve the authenticated user''s Predictions API usage tier and token-bucket limits. Public Predictions tiers include Basic, Advanced, Expert, Premier, Paragon, Prime, and Prestige.'
tags:
- account
security:
@@ -2738,23 +2633,16 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/account/api_usage_level/upgrade:
post:
operationId: UpgradeAccountApiUsageLevel
summary: Upgrade Account API Usage Level
- description: >-
- Grants a permanent Advanced API usage-level grant. Currently only the
- Predictions exchange instance is supported. Criteria: at least 1 of the
- user's last 100 Predictions orders was created via API. Use Get Account
- API Limits to inspect the resulting usage tier and grants.
+ description: 'Grants a permanent Advanced API usage-level grant. Currently only the Predictions exchange instance is supported. Criteria: at least 1 of the user''s last 100 Predictions orders was created via API. Use Get Account API Limits to inspect the resulting usage tier and grants.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 30 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 30 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- account
@@ -2768,24 +2656,17 @@ paths:
'401':
description: Unauthorized
'403':
- description: >-
- No API-created order was found in the user's latest 100 Predictions
- orders
+ description: No API-created order was found in the user's latest 100 Predictions orders
'429':
- description: >-
- Rate limit exceeded. This endpoint costs 30 tokens and uses the
- Predictions Write bucket.
+ description: Rate limit exceeded. This endpoint costs 30 tokens and uses the Predictions Write bucket.
'500':
description: Internal server error
+
/account/api_usage_level/volume_progress:
get:
operationId: GetAccountApiUsageLevelVolumeProgress
summary: Get Account API Usage Level Volume Progress
- description: >-
- Returns the authenticated user's latest cron-computed trading volume
- progress toward volume-based API usage tiers for the predictions
- (event_contract) lane. Volume figures are reported as fixed-point
- contract counts.
+ description: 'Returns the authenticated user''s latest cron-computed trading volume progress toward volume-based API usage tiers for the predictions (event_contract) lane. Volume figures are reported as fixed-point contract counts.'
tags:
- account
security:
@@ -2798,19 +2679,17 @@ paths:
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/GetAccountApiUsageLevelVolumeProgressResponse
+ $ref: '#/components/schemas/GetAccountApiUsageLevelVolumeProgressResponse'
'401':
description: Unauthorized
'500':
description: Internal server error
+
/account/endpoint_costs:
get:
operationId: GetAccountEndpointCosts
summary: List Non-Default Endpoint Costs
- description: >-
- Lists API v2 endpoints whose configured token cost differs from the
- default cost. Endpoints that use the default cost are omitted.
+ description: 'Lists API v2 endpoints whose configured token cost differs from the default cost. Endpoints that use the default cost are omitted.'
tags:
- account
responses:
@@ -2822,16 +2701,15 @@ paths:
$ref: '#/components/schemas/GetAccountEndpointCostsResponse'
'500':
description: Internal server error
+
/search/tags_by_categories:
get:
operationId: GetTagsForSeriesCategories
summary: Get Tags for Series Categories
- description: >
+ description: |
Retrieve tags organized by series categories.
-
- This endpoint returns a mapping of series categories to their associated
- tags, which can be used for filtering and search functionality.
+ This endpoint returns a mapping of series categories to their associated tags, which can be used for filtering and search functionality.
tags:
- search
responses:
@@ -2845,17 +2723,15 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/search/filters_by_sport:
get:
operationId: GetFiltersForSports
summary: Get Filters for Sports
- description: >
+ description: |
Retrieve available filters organized by sport.
-
- This endpoint returns filtering options available for each sport,
- including scopes and competitions. It also provides an ordered list of
- sports for display purposes.
+ This endpoint returns filtering options available for each sport, including scopes and competitions. It also provides an ordered list of sports for display purposes.
tags:
- search
responses:
@@ -2869,6 +2745,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/live_data/milestone/{milestone_id}:
get:
operationId: GetLiveDataByMilestone
@@ -2887,11 +2764,9 @@ paths:
in: query
required: false
description: >-
- When true, includes player-level statistics in the live data
- response. Supported for Pro Football, Pro Basketball, and College
- Men's Basketball milestones that have player ID mappings configured.
- Has no effect for other sports or milestones without player
- mappings.
+ When true, includes player-level statistics in the live data response.
+ Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
+ Has no effect for other sports or milestones without player mappings.
schema:
type: boolean
default: false
@@ -2906,14 +2781,12 @@ paths:
description: Live data not found
'500':
description: Internal server error
+
/live_data/{type}/milestone/{milestone_id}:
get:
operationId: GetLiveData
summary: Get Live Data (with type)
- description: >-
- Get live data for a specific milestone. This is the legacy endpoint that
- requires a type path parameter. Prefer using
- `/live_data/milestone/{milestone_id}` instead.
+ description: Get live data for a specific milestone. This is the legacy endpoint that requires a type path parameter. Prefer using `/live_data/milestone/{milestone_id}` instead.
tags:
- live-data
parameters:
@@ -2933,11 +2806,9 @@ paths:
in: query
required: false
description: >-
- When true, includes player-level statistics in the live data
- response. Supported for Pro Football, Pro Basketball, and College
- Men's Basketball milestones that have player ID mappings configured.
- Has no effect for other sports or milestones without player
- mappings.
+ When true, includes player-level statistics in the live data response.
+ Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
+ Has no effect for other sports or milestones without player mappings.
schema:
type: boolean
default: false
@@ -2952,6 +2823,7 @@ paths:
description: Live data not found
'500':
description: Internal server error
+
/live_data/batch:
get:
operationId: GetLiveDatas
@@ -2975,11 +2847,9 @@ paths:
in: query
required: false
description: >-
- When true, includes player-level statistics in the live data
- response. Supported for Pro Football, Pro Basketball, and College
- Men's Basketball milestones that have player ID mappings configured.
- Has no effect for other sports or milestones without player
- mappings.
+ When true, includes player-level statistics in the live data response.
+ Supported for Pro Football, Pro Basketball, and College Men's Basketball milestones that have player ID mappings configured.
+ Has no effect for other sports or milestones without player mappings.
schema:
type: boolean
default: false
@@ -2992,16 +2862,15 @@ paths:
$ref: '#/components/schemas/GetLiveDatasResponse'
'500':
description: Internal server error
+
/live_data/milestone/{milestone_id}/game_stats:
get:
operationId: GetGameStats
summary: Get Game Stats
description: >-
- Get play-by-play game statistics for a specific milestone. Supported
- sports: Pro Football, College Football, Pro Basketball, College Men's
- Basketball, College Women's Basketball, WNBA, Soccer, Pro Hockey, and
- Pro Baseball. Returns null for unsupported milestone types or milestones
- without a Sportradar ID.
+ Get play-by-play game statistics for a specific milestone.
+ Supported sports: Pro Football, College Football, Pro Basketball, College Men's Basketball, College Women's Basketball, WNBA, Soccer, Pro Hockey, and Pro Baseball.
+ Returns null for unsupported milestone types or milestones without a Sportradar ID.
tags:
- live-data
parameters:
@@ -3022,6 +2891,8 @@ paths:
description: Game stats not found
'500':
description: Internal server error
+
+
/structured_targets:
get:
operationId: GetStructuredTargets
@@ -3032,9 +2903,7 @@ paths:
parameters:
- name: ids
in: query
- description: >-
- Filter by specific structured target IDs. Pass multiple IDs by
- repeating the parameter (e.g. `?ids=uuid1&ids=uuid2`).
+ description: Filter by specific structured target IDs. Pass multiple IDs by repeating the parameter (e.g. `?ids=uuid1&ids=uuid2`).
required: false
schema:
type: array
@@ -3052,9 +2921,7 @@ paths:
example: basketball_player
- name: competition
in: query
- description: >-
- Filter by competition. Matches against the league, conference,
- division, or tour in the structured target details.
+ description: 'Filter by competition. Matches against the league, conference, division, or tour in the structured target details.'
required: false
schema:
type: string
@@ -3086,6 +2953,7 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/structured_targets/{structured_target_id}:
get:
operationId: GetStructuredTarget
@@ -3113,6 +2981,7 @@ paths:
description: Not found
'500':
description: Internal server error
+
/milestones/{milestone_id}:
get:
operationId: GetMilestone
@@ -3142,6 +3011,7 @@ paths:
description: Not Found
'500':
description: Internal Server Error
+
/milestones:
get:
operationId: GetMilestones
@@ -3167,18 +3037,14 @@ paths:
format: date-time
- name: category
in: query
- description: >-
- Filter by milestone category. E.g. Sports, Elections, Esports,
- Crypto.
+ description: 'Filter by milestone category. E.g. Sports, Elections, Esports, Crypto.'
required: false
schema:
type: string
example: Sports
- name: competition
in: query
- description: >-
- Filter by competition. E.g. Pro Football, Pro Basketball (M), Pro
- Baseball, Pro Hockey, College Football.
+ description: 'Filter by competition. E.g. Pro Football, Pro Basketball (M), Pro Baseball, Pro Hockey, College Football.'
required: false
schema:
type: string
@@ -3191,10 +3057,7 @@ paths:
type: string
- name: type
in: query
- description: >-
- Filter by milestone type. E.g. football_game, basketball_game,
- soccer_tournament_multi_leg, baseball_game, hockey_match,
- political_race.
+ description: 'Filter by milestone type. E.g. football_game, basketball_game, soccer_tournament_multi_leg, baseball_game, hockey_match, political_race.'
required: false
schema:
type: string
@@ -3207,18 +3070,14 @@ paths:
type: string
- name: cursor
in: query
- description: >-
- Pagination cursor. Use the cursor value returned from the previous
- response to get the next page of results
+ description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results
required: false
schema:
type: string
- name: min_updated_ts
in: query
required: false
- description: >-
- Filter milestones with metadata updated after this Unix timestamp
- (in seconds). Use this to efficiently poll for changes.
+ description: Filter milestones with metadata updated after this Unix timestamp (in seconds). Use this to efficiently poll for changes.
schema:
type: integer
format: int64
@@ -3235,6 +3094,8 @@ paths:
description: Unauthorized
'500':
description: Internal Server Error
+
+ # Communications endpoints
/multivariate_event_collections/{collection_ticker}:
get:
operationId: GetMultivariateEventCollection
@@ -3265,10 +3126,7 @@ paths:
post:
operationId: CreateMarketInMultivariateEventCollection
summary: Create Market In Multivariate Event Collection
- description: >-
- Endpoint for creating an individual market in a multivariate event
- collection. This endpoint must be hit at least once before trading or
- looking up a market. Users are limited to 5000 creations per week.
+ description: 'Endpoint for creating an individual market in a multivariate event collection. This endpoint must be hit at least once before trading or looking up a market. Users are limited to 5000 creations per week.'
tags:
- multivariate
security:
@@ -3287,16 +3145,14 @@ paths:
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/CreateMarketInMultivariateEventCollectionRequest
+ $ref: '#/components/schemas/CreateMarketInMultivariateEventCollectionRequest'
responses:
'200':
description: Market created successfully
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/CreateMarketInMultivariateEventCollectionResponse
+ $ref: '#/components/schemas/CreateMarketInMultivariateEventCollectionResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'401':
@@ -3305,6 +3161,7 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/multivariate_event_collections:
get:
operationId: GetMultivariateEventCollections
@@ -3315,15 +3172,10 @@ paths:
parameters:
- name: status
in: query
- description: >-
- Only return collections of a certain status. Can be unopened, open,
- or closed.
+ description: Only return collections of a certain status. Can be unopened, open, or closed.
schema:
type: string
- enum:
- - unopened
- - open
- - closed
+ enum: [unopened, open, closed]
- name: associated_event_ticker
in: query
description: Only return collections associated with a particular event ticker.
@@ -3344,11 +3196,7 @@ paths:
maximum: 200
- name: cursor
in: query
- description: >-
- The Cursor represents a pointer to the next page of records in the
- pagination. This optional parameter, when filled, should be filled
- with the cursor string returned in a previous request to this
- end-point.
+ description: The Cursor represents a pointer to the next page of records in the pagination. This optional parameter, when filled, should be filled with the cursor string returned in a previous request to this end-point.
schema:
type: string
responses:
@@ -3362,33 +3210,21 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/multivariate_event_collections/{collection_ticker}/lookup:
put:
operationId: LookupTickersForMarketInMultivariateEventCollection
summary: Lookup Tickers For Market In Multivariate Event Collection
deprecated: true
- description: >-
- DEPRECATED: This endpoint predates RFQs and should not be used for new
- integrations. Endpoint for looking up an individual market in a
- multivariate event collection. If
- CreateMarketInMultivariateEventCollection has never been hit with that
- variable combination before, this will return a 404.
+ description: 'DEPRECATED: This endpoint predates RFQs and should not be used for new integrations. Endpoint for looking up an individual market in a multivariate event collection. If CreateMarketInMultivariateEventCollection has never been hit with that variable combination before, this will return a 404.'
x-mint:
- content: >
+ content: |
-
- This endpoint is deprecated and predates RFQs. Do not use it for new
- integrations.
-
+ This endpoint is deprecated and predates RFQs. Do not use it for new integrations.
-
-
- **Rate limit:** 2 tokens per request. See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 2 tokens per request. See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- multivariate
@@ -3408,16 +3244,14 @@ paths:
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/LookupTickersForMarketInMultivariateEventCollectionRequest
+ $ref: '#/components/schemas/LookupTickersForMarketInMultivariateEventCollectionRequest'
responses:
'200':
description: Market looked up successfully
content:
application/json:
schema:
- $ref: >-
- #/components/schemas/LookupTickersForMarketInMultivariateEventCollectionResponse
+ $ref: '#/components/schemas/LookupTickersForMarketInMultivariateEventCollectionResponse'
'400':
$ref: '#/components/responses/BadRequestError'
'401':
@@ -3426,58 +3260,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
- get:
- operationId: GetMultivariateEventCollectionLookupHistory
- summary: Get Multivariate Event Collection Lookup History
- deprecated: true
- description: >-
- DEPRECATED: This endpoint predates RFQs and should not be used for new
- integrations. Endpoint for retrieving which markets in an event
- collection were recently looked up.
- x-mint:
- content: >
-
-
- This endpoint is deprecated and predates RFQs. Do not use it for new
- integrations.
-
-
- tags:
- - multivariate
- parameters:
- - name: collection_ticker
- in: path
- required: true
- description: Collection ticker
- schema:
- type: string
- - name: lookback_seconds
- in: query
- required: true
- description: >-
- Number of seconds to look back for lookup history. Must be one of
- 10, 60, 300, or 3600.
- schema:
- type: integer
- format: int32
- enum:
- - 10
- - 60
- - 300
- - 3600
- responses:
- '200':
- description: Lookup history retrieved successfully
- content:
- application/json:
- schema:
- $ref: >-
- #/components/schemas/GetMultivariateEventCollectionLookupHistoryResponse
- '400':
- $ref: '#/components/responses/BadRequestError'
- '500':
- $ref: '#/components/responses/InternalServerError'
- /incentive_programs:
+ /incentive_programs:
get:
operationId: GetIncentivePrograms
summary: Get Incentives
@@ -3488,29 +3271,17 @@ paths:
- name: status
in: query
required: false
- description: >-
- Status filter. Can be "all", "active", "upcoming", "closed", or
- "paid_out". Default is "all".
+ description: 'Status filter. Can be "all", "active", "upcoming", "closed", or "paid_out". Default is "all".'
schema:
type: string
- enum:
- - all
- - active
- - upcoming
- - closed
- - paid_out
+ enum: [all, active, upcoming, closed, paid_out]
- name: type
in: query
required: false
- description: >-
- Type filter. Can be "all", "liquidity", or "volume". Default is
- "all".
+ description: 'Type filter. Can be "all", "liquidity", or "volume". Default is "all".'
schema:
type: string
- enum:
- - all
- - liquidity
- - volume
+ enum: [all, liquidity, volume]
- name: incentive_description
in: query
required: false
@@ -3550,15 +3321,14 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
+
/fcm/orders:
get:
operationId: GetFCMOrders
summary: Get FCM Orders
- description: >
+ description: |
Endpoint for FCM members to get orders filtered by subtrader ID.
-
- This endpoint requires FCM member access level and allows filtering
- orders by subtrader ID.
+ This endpoint requires FCM member access level and allows filtering orders by subtrader ID.
tags:
- fcm
security:
@@ -3569,9 +3339,7 @@ paths:
- name: subtrader_id
in: query
required: true
- description: >-
- Restricts the response to orders for a specific subtrader (FCM
- members only)
+ description: Restricts the response to orders for a specific subtrader (FCM members only)
schema:
type: string
- $ref: '#/components/parameters/CursorQuery'
@@ -3579,17 +3347,13 @@ paths:
- $ref: '#/components/parameters/TickerQuery'
- name: min_ts
in: query
- description: >-
- Restricts the response to orders after a timestamp, formatted as a
- Unix Timestamp
+ description: Restricts the response to orders after a timestamp, formatted as a Unix Timestamp
schema:
type: integer
format: int64
- name: max_ts
in: query
- description: >-
- Restricts the response to orders before a timestamp, formatted as a
- Unix Timestamp
+ description: Restricts the response to orders before a timestamp, formatted as a Unix Timestamp
schema:
type: integer
format: int64
@@ -3598,10 +3362,7 @@ paths:
description: Restricts the response to orders that have a certain status
schema:
type: string
- enum:
- - resting
- - canceled
- - executed
+ enum: [resting, canceled, executed]
- name: limit
in: query
description: Parameter to specify the number of results per page. Defaults to 100
@@ -3624,16 +3385,14 @@ paths:
description: Not found
'500':
description: Internal server error
+
/fcm/positions:
get:
operationId: GetFCMPositions
summary: Get FCM Positions
- description: >
- Endpoint for FCM members to get market positions filtered by subtrader
- ID.
-
- This endpoint requires FCM member access level and allows filtering
- positions by subtrader ID.
+ description: |
+ Endpoint for FCM members to get market positions filtered by subtrader ID.
+ This endpoint requires FCM member access level and allows filtering positions by subtrader ID.
tags:
- fcm
security:
@@ -3644,9 +3403,7 @@ paths:
- name: subtrader_id
in: query
required: true
- description: >-
- Restricts the response to positions for a specific subtrader (FCM
- members only)
+ description: Restricts the response to positions for a specific subtrader (FCM members only)
schema:
type: string
- name: ticker
@@ -3663,9 +3420,7 @@ paths:
x-go-type-skip-optional-pointer: true
- name: count_filter
in: query
- description: >-
- Restricts the positions to those with any of following fields with
- non-zero values, as a comma separated list
+ description: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list
schema:
type: string
- name: settlement_status
@@ -3673,10 +3428,7 @@ paths:
description: Settlement status of the markets to return. Defaults to unsettled
schema:
type: string
- enum:
- - all
- - unsettled
- - settled
+ enum: [all, unsettled, settled]
- name: limit
in: query
description: Parameter to specify the number of results per page. Defaults to 100
@@ -3686,9 +3438,7 @@ paths:
maximum: 1000
- name: cursor
in: query
- description: >-
- The Cursor represents a pointer to the next page of records in the
- pagination
+ description: The Cursor represents a pointer to the next page of records in the pagination
schema:
type: string
responses:
@@ -3706,27 +3456,18 @@ paths:
description: Not found
'500':
description: Internal server error
+
/historical/cutoff:
get:
operationId: GetHistoricalCutoff
summary: Get Historical Cutoff Timestamps
- description: >
- Returns the cutoff timestamps that define the boundary between **live**
- and **historical** data.
-
+ description: |
+ Returns the cutoff timestamps that define the boundary between **live** and **historical** data.
## Cutoff fields
-
- - `market_settled_ts` : Markets that **settled** before this timestamp,
- and their candlesticks, must be accessed via `GET /historical/markets`
- and `GET /historical/markets/{ticker}/candlesticks`.
-
- - `trades_created_ts` : Trades that were **filled** before this
- timestamp must be accessed via `GET /historical/fills`.
-
- - `orders_updated_ts` : Orders that were **canceled or fully executed**
- before this timestamp must be accessed via `GET /historical/orders`.
- Resting (active) orders are always available in `GET /portfolio/orders`.
+ - `market_settled_ts` : Markets that **settled** before this timestamp, and their candlesticks, must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`.
+ - `trades_created_ts` : Trades that were **filled** before this timestamp must be accessed via `GET /historical/fills`.
+ - `orders_updated_ts` : Orders that were **canceled or fully executed** before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`.
tags:
- historical
responses:
@@ -3738,6 +3479,7 @@ paths:
$ref: '#/components/schemas/GetHistoricalCutoffResponse'
'500':
description: Internal server error
+
/historical/markets/{ticker}/candlesticks:
get:
operationId: GetMarketCandlesticksHistorical
@@ -3755,35 +3497,26 @@ paths:
- name: start_ts
in: query
required: true
- description: >-
- Start timestamp (Unix timestamp). Candlesticks will include those
- ending on or after this time.
+ description: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
schema:
type: integer
format: int64
- name: end_ts
in: query
required: true
- description: >-
- End timestamp (Unix timestamp). Candlesticks will include those
- ending on or before this time.
+ description: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
schema:
type: integer
format: int64
- name: period_interval
in: query
required: true
- description: >-
- Time period length of each candlestick in minutes. Valid values are
- 1 (1 minute), 60 (1 hour), or 1440 (1 day).
+ description: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
schema:
type: integer
- enum:
- - 1
- - 60
- - 1440
+ enum: [1, 60, 1440]
x-oapi-codegen-extra-tags:
- validate: required,oneof=1 60 1440
+ validate: "required,oneof=1 60 1440"
responses:
'200':
description: Candlesticks retrieved successfully
@@ -3797,6 +3530,7 @@ paths:
description: Not found
'500':
description: Internal server error
+
/historical/fills:
get:
operationId: GetFillsHistorical
@@ -3828,11 +3562,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
description: Internal server error
+
/historical/orders:
get:
operationId: GetHistoricalOrders
summary: Get Historical Orders
- description: ' Endpoint for getting orders that have been archived to the historical database.'
+ description: ' Endpoint for getting orders that have been archived to the historical database.'
tags:
- historical
security:
@@ -3857,6 +3592,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/historical/trades:
get:
operationId: GetTradesHistorical
@@ -3884,13 +3620,13 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/historical/markets:
get:
operationId: GetHistoricalMarkets
summary: Get Historical Markets
- description: >
- Endpoint for getting markets that have been archived to the historical
- database. Filters are mutually exclusive.
+ description: |
+ Endpoint for getting markets that have been archived to the historical database. Filters are mutually exclusive.
tags:
- historical
parameters:
@@ -3911,6 +3647,7 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/historical/markets/{ticker}:
get:
operationId: GetHistoricalMarket
@@ -3931,6 +3668,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
components:
securitySchemes:
kalshiAccessKey:
@@ -3948,6 +3686,7 @@ components:
in: header
name: KALSHI-ACCESS-TIMESTAMP
description: Request timestamp in milliseconds
+
responses:
BadRequestError:
description: Bad request - invalid input
@@ -3986,13 +3725,12 @@ components:
schema:
$ref: '#/components/schemas/ErrorResponse'
RateLimitError:
- description: >-
- Rate limit exceeded. The default cost is 10 tokens per request. Use GET
- /trade-api/v2/account/endpoint_costs to list non-default endpoint costs.
+ description: 'Rate limit exceeded. The default cost is 10 tokens per request. Use GET /trade-api/v2/account/endpoint_costs to list non-default endpoint costs.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
+
parameters:
LimitQuery:
name: limit
@@ -4005,7 +3743,8 @@ components:
maximum: 1000
default: 100
x-oapi-codegen-extra-tags:
- validate: omitempty,min=1,max=1000
+ validate: "omitempty,min=1,max=1000"
+
WithdrawalLimitQuery:
name: limit
in: query
@@ -4017,7 +3756,8 @@ components:
maximum: 500
default: 100
x-oapi-codegen-extra-tags:
- validate: omitempty,min=1,max=500
+ validate: "omitempty,min=1,max=500"
+
MarketLimitQuery:
name: limit
in: query
@@ -4030,22 +3770,22 @@ components:
default: 100
x-oapi-codegen-extra-tags:
validate: omitempty,gte=0,lte=1000
+
CursorQuery:
name: cursor
in: query
- description: >-
- Pagination cursor. Use the cursor value returned from the previous
- response to get the next page of results. Leave empty for the first
- page.
+ description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
schema:
type: string
x-go-type-skip-optional-pointer: true
+
StatusQuery:
name: status
in: query
description: Filter by status. Possible values depend on the endpoint.
schema:
type: string
+
OrderGroupIdPath:
name: order_group_id
in: path
@@ -4053,6 +3793,7 @@ components:
description: Order group ID
schema:
type: string
+
RfqIdPath:
name: rfq_id
in: path
@@ -4060,6 +3801,7 @@ components:
description: RFQ ID
schema:
type: string
+
QuoteIdPath:
name: quote_id
in: path
@@ -4067,6 +3809,7 @@ components:
description: Quote ID
schema:
type: string
+
MarketTickerQuery:
name: market_ticker
in: query
@@ -4074,6 +3817,7 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
TickerQuery:
name: ticker
in: query
@@ -4081,15 +3825,15 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
IsBlockTradeQuery:
name: is_block_trade
in: query
- description: >
- Filter trades by whether they are block trades. Omit to return all
- trades. Set to `true` to return only block trades. Set to `false` to
- return only non-block trades.
+ description: |
+ Filter trades by whether they are block trades. Omit to return all trades. Set to `true` to return only block trades. Set to `false` to return only non-block trades.
schema:
type: boolean
+
SingleEventTickerQuery:
name: event_ticker
in: query
@@ -4097,6 +3841,7 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
MultipleEventTickerQuery:
name: event_ticker
in: query
@@ -4104,15 +3849,14 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
PositionsCursorQuery:
name: cursor
in: query
- description: >-
- The Cursor represents a pointer to the next page of records in the
- pagination. Use the value returned from the previous response to get the
- next page.
+ description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned from the previous response to get the next page.
schema:
type: string
+
PositionsLimitQuery:
name: limit
in: query
@@ -4123,15 +3867,14 @@ components:
minimum: 1
maximum: 1000
default: 100
+
CountFilterQuery:
name: count_filter
in: query
- description: >-
- Restricts the positions to those with any of following fields with
- non-zero values, as a comma separated list. The following values are
- accepted - position, total_traded
+ description: Restricts the positions to those with any of following fields with non-zero values, as a comma separated list. The following values are accepted - position, total_traded
schema:
type: string
+
OrderIdQuery:
name: order_id
in: query
@@ -4139,6 +3882,7 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
MinTsQuery:
name: min_ts
in: query
@@ -4146,6 +3890,7 @@ components:
schema:
type: integer
format: int64
+
MaxTsQuery:
name: max_ts
in: query
@@ -4153,26 +3898,28 @@ components:
schema:
type: integer
format: int64
+
SubaccountQuery:
name: subaccount
in: query
- description: >-
- Subaccount number (0 for primary, 1-63 for subaccounts). If omitted,
- defaults to all subaccounts.
+ description: Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts.
schema:
type: integer
+
SubaccountQueryDefaultPrimary:
name: subaccount
in: query
description: Subaccount number (0 for primary, 1-63 for subaccounts). Defaults to 0.
schema:
type: integer
+
ExchangeIndexQuery:
name: exchange_index
in: query
schema:
$ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
OrderIdPath:
name: order_id
in: path
@@ -4180,6 +3927,7 @@ components:
description: Order ID
schema:
type: string
+
TickerPath:
name: ticker
in: path
@@ -4187,6 +3935,7 @@ components:
description: Market ticker
schema:
type: string
+
SeriesTickerQuery:
name: series_ticker
in: query
@@ -4194,6 +3943,7 @@ components:
schema:
type: string
x-go-type-skip-optional-pointer: true
+
MinCreatedTsQuery:
name: min_created_ts
in: query
@@ -4201,6 +3951,7 @@ components:
schema:
type: integer
format: int64
+
MaxCreatedTsQuery:
name: max_created_ts
in: query
@@ -4208,17 +3959,15 @@ components:
schema:
type: integer
format: int64
+
MinUpdatedTsQuery:
name: min_updated_ts
in: query
- description: >-
- Return markets with metadata updated later than this Unix timestamp.
- Tracks non-trading changes only. Incompatible with any other filters
- except mve_filter=exclude. May be combined with series_ticker, which
- requires mve_filter=exclude.
+ description: Return markets with metadata updated later than this Unix timestamp. Tracks non-trading changes only. Incompatible with any other filters except mve_filter=exclude. May be combined with series_ticker, which requires mve_filter=exclude.
schema:
type: integer
format: int64
+
MaxCloseTsQuery:
name: max_close_ts
in: query
@@ -4226,6 +3975,7 @@ components:
schema:
type: integer
format: int64
+
MinCloseTsQuery:
name: min_close_ts
in: query
@@ -4233,6 +3983,7 @@ components:
schema:
type: integer
format: int64
+
MinSettledTsQuery:
name: min_settled_ts
in: query
@@ -4240,6 +3991,7 @@ components:
schema:
type: integer
format: int64
+
MaxSettledTsQuery:
name: max_settled_ts
in: query
@@ -4247,94 +3999,73 @@ components:
schema:
type: integer
format: int64
+
MarketStatusQuery:
name: status
in: query
description: Filter by market status. Leave empty to return markets with any status.
schema:
type: string
- enum:
- - unopened
- - open
- - paused
- - closed
- - settled
+ enum: [unopened, open, paused, closed, settled]
+
TickersQuery:
name: tickers
in: query
- description: >-
- Filter by specific market tickers. Comma-separated list of market
- tickers to retrieve.
+ description: Filter by specific market tickers. Comma-separated list of market tickers to retrieve.
schema:
type: string
+
EventTickersQuery:
name: tickers
in: query
- description: >-
- Filter by specific event tickers. Comma-separated list of event tickers
- to retrieve.
+ description: Filter by specific event tickers. Comma-separated list of event tickers to retrieve.
schema:
type: string
+
MveFilterQuery:
name: mve_filter
in: query
- description: >-
- Filter by multivariate events (combos). 'only' returns only multivariate
- events, 'exclude' excludes multivariate events.
+ description: Filter by multivariate events (combos). 'only' returns only multivariate events, 'exclude' excludes multivariate events.
schema:
type: string
- enum:
- - only
- - exclude
+ enum: ['only', 'exclude']
+
MveHistoricalFilterQuery:
name: mve_filter
in: query
- description: >-
- Filter by multivariate events (combos). By default, MVE markets are
- included.
+ description: Filter by multivariate events (combos). By default, MVE markets are included.
schema:
type: string
- enum:
- - exclude
+ enum: ['exclude']
nullable: true
default: null
+
schemas:
+ # Common schemas
FixedPointDollars:
type: string
- description: >-
- US dollar amount as a fixed-point decimal string with up to 6 decimal
- places of precision. This is the maximum supported precision; valid
- quote intervals for a given market are constrained by that market's
- price level structure.
- example: '0.5600'
+ description: US dollar amount as a fixed-point decimal string with up to 6 decimal places of precision. This is the maximum supported precision; valid quote intervals for a given market are constrained by that market's price level structure.
+ example: "0.5600"
+
FixedPointCount:
type: string
- description: >-
- Fixed-point contract count string (2 decimals, e.g., "10.00"; referred
- to as "fp" in field names). Requests accept 0–2 decimal places (e.g.,
- "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional
- contract values (e.g., "2.50") are supported on markets with fractional
- trading enabled; the minimum granularity is 0.01 contracts. Integer
- contract count fields are legacy and will be deprecated; when both
- integer and fp fields are provided, they must match.
- example: '10.00'
+ description: Fixed-point contract count string (2 decimals, e.g., "10.00"; referred to as "fp" in field names). Requests accept 0-2 decimal places (e.g., "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional contract values (e.g., "2.50") are supported; the minimum granularity is 0.01 contracts.
+ example: "10.00"
+
ExchangeIndex:
type: integer
- description: >-
- Identifier for an exchange shard. Defaults to 0 if unspecified. Note:
- currently only 0 supported.
+ description: "Identifier for an exchange shard. Defaults to 0 if unspecified. Note: currently only 0 supported."
example: 0
+
FeeType:
type: string
- enum:
- - quadratic
- - quadratic_with_maker_fees
- - flat
+ enum: [quadratic, quadratic_with_maker_fees, flat]
x-enum-varnames:
- FeeTypeQuadratic
- FeeTypeQuadraticWithMakerFees
- FeeTypeFlat
description: Fee type for a series or scheduled fee override.
+
GetMarketCandlesticksHistoricalResponse:
type: object
required:
@@ -4349,6 +4080,7 @@ components:
description: Array of candlestick data points for the specified time range.
items:
$ref: '#/components/schemas/MarketCandlestickHistorical'
+
MarketCandlestickHistorical:
type: object
required:
@@ -4365,29 +4097,20 @@ components:
description: Unix timestamp for the inclusive end of the candlestick period.
yes_bid:
$ref: '#/components/schemas/BidAskDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) data for YES buy offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for YES buy offers on the market during the candlestick period.
yes_ask:
$ref: '#/components/schemas/BidAskDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) data for YES sell offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for YES sell offers on the market during the candlestick period.
price:
$ref: '#/components/schemas/PriceDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) and more data for trade YES contract
- prices on the market during the candlestick period.
+ description: Open, high, low, close (OHLC) and more data for trade YES contract prices on the market during the candlestick period.
volume:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought on the
- market during the candlestick period.
+ description: String representation of the number of contracts bought on the market during the candlestick period.
open_interest:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought on the
- market by end of the candlestick period (end_period_ts).
+ description: String representation of the number of contracts bought on the market by end of the candlestick period (end_period_ts).
+
BidAskDistributionHistorical:
type: object
required:
@@ -4398,24 +4121,17 @@ components:
properties:
open:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Offer price on the market at the start of the candlestick period (in
- dollars).
+ description: Offer price on the market at the start of the candlestick period (in dollars).
low:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Lowest offer price on the market during the candlestick period (in
- dollars).
+ description: Lowest offer price on the market during the candlestick period (in dollars).
high:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Highest offer price on the market during the candlestick period (in
- dollars).
+ description: Highest offer price on the market during the candlestick period (in dollars).
close:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Offer price on the market at the end of the candlestick period (in
- dollars).
+ description: Offer price on the market at the end of the candlestick period (in dollars).
+
PriceDistributionHistorical:
type: object
required:
@@ -4430,44 +4146,33 @@ components:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Price of the first trade during the candlestick period (in dollars).
- Null if no trades occurred.
+ description: Price of the first trade during the candlestick period (in dollars). Null if no trades occurred.
low:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Lowest trade price during the candlestick period (in dollars). Null
- if no trades occurred.
+ description: Lowest trade price during the candlestick period (in dollars). Null if no trades occurred.
high:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Highest trade price during the candlestick period (in dollars). Null
- if no trades occurred.
+ description: Highest trade price during the candlestick period (in dollars). Null if no trades occurred.
close:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Price of the last trade during the candlestick period (in dollars).
- Null if no trades occurred.
+ description: Price of the last trade during the candlestick period (in dollars). Null if no trades occurred.
mean:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Volume-weighted average price during the candlestick period (in
- dollars). Null if no trades occurred.
+ description: Volume-weighted average price during the candlestick period (in dollars). Null if no trades occurred.
previous:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Close price from the previous candlestick period (in dollars). Null
- if this is the first candlestick or no prior trade exists.
+ description: Close price from the previous candlestick period (in dollars). Null if this is the first candlestick or no prior trade exists.
+
ErrorResponse:
type: object
properties:
@@ -4483,72 +4188,40 @@ components:
service:
type: string
description: The name of the service that generated the error
+
SelfTradePreventionType:
type: string
- enum:
- - taker_at_cross
- - maker
- description: >
- The self-trade prevention type for orders. `taker_at_cross` cancels the
- taker order when it would trade against another order from the same
- user; execution stops and any partial fills already matched are
- executed. `maker` cancels the resting maker order and continues
- matching.
+ enum: ['taker_at_cross', 'maker']
+ description: |
+ The self-trade prevention type for orders. `taker_at_cross` cancels the taker order when it would trade against another order from the same user; execution stops and any partial fills already matched are executed. `maker` cancels the resting maker order and continues matching.
+
BookSide:
type: string
- enum:
- - bid
- - ask
- description: >-
- Side of the book for an order or trade. For event markets, this refers
- to the YES leg only: `bid` means buy YES, `ask` means sell YES. (Selling
- YES is economically equivalent to buying NO at `1 - price`, but this
- endpoint quotes everything from the YES side.)
+ enum: ['bid', 'ask']
+ description: 'Side of the book for an order or trade. For event markets, this refers to the YES leg only: `bid` means buy YES, `ask` means sell YES. (Selling YES is economically equivalent to buying NO at `1 - price`, but this endpoint quotes everything from the YES side.)'
+
OrderStatus:
type: string
- enum:
- - resting
- - canceled
- - executed
+ enum: ['resting', 'canceled', 'executed']
description: The status of an order
+
ExchangeInstance:
type: string
- enum:
- - event_contract
- - margined
+ enum: ['event_contract', 'margined']
description: The exchange instance type
+
UserFilter:
type: string
- enum:
- - self
- x-enum-varnames:
- - UserFilterSelf
- description: >-
- Omit or leave empty to return all results. Use `self` to filter by the
- authenticated user.
+ enum: ['self']
+ x-enum-varnames: ['UserFilterSelf']
+ description: Omit or leave empty to return all results. Use `self` to filter by the authenticated user.
+
ApiKeyScope:
type: string
- enum:
- - read
- - write
- - read::block_trade_accept
- - read::portfolio_balance
- - write::transfer
- - write::block_trade_accept
- x-enum-varnames:
- - ApiKeyScopeRead
- - ApiKeyScopeWrite
- - ApiKeyScopeReadBlockTradeAccept
- - ApiKeyScopeReadPortfolioBalance
- - ApiKeyScopeWriteTransfer
- - ApiKeyScopeWriteBlockTradeAccept
- description: >-
- Scope granted to an API key. Parent scopes grant broad access; for
- example, `read` grants all read endpoints and `write` grants all write
- endpoints. Child scopes such as `read::block_trade_accept`,
- `read::portfolio_balance`, `write::transfer`, and
- `write::block_trade_accept` grant only their specific endpoint group and
- can be granted without the parent scope.
+ enum: ['read', 'write', 'read::block_trade_accept', 'read::portfolio_balance', 'write::trade', 'write::transfer', 'write::block_trade_accept']
+ x-enum-varnames: ['ApiKeyScopeRead', 'ApiKeyScopeWrite', 'ApiKeyScopeReadBlockTradeAccept', 'ApiKeyScopeReadPortfolioBalance', 'ApiKeyScopeWriteTrade', 'ApiKeyScopeWriteTransfer', 'ApiKeyScopeWriteBlockTradeAccept']
+ description: Scope granted to an API key. Parent scopes grant broad access; for example, `read` grants all read endpoints and `write` grants all write endpoints. Child scopes such as `read::block_trade_accept`, `read::portfolio_balance`, `write::trade`, `write::transfer`, and `write::block_trade_accept` grant only their specific endpoint group and can be granted without the parent scope.
+
ApiKey:
type: object
required:
@@ -4567,6 +4240,13 @@ components:
description: List of scopes granted to this API key.
items:
$ref: '#/components/schemas/ApiKeyScope'
+ subaccount:
+ type: integer
+ nullable: true
+ minimum: 0
+ maximum: 63
+ description: If set, the API key is restricted to this single sub-account and may only read and trade on it. Absent/null means the key is unrestricted.
+
GetApiKeysResponse:
type: object
required:
@@ -4577,6 +4257,7 @@ components:
description: List of all API keys associated with the user
items:
$ref: '#/components/schemas/ApiKey'
+
CreateApiKeyRequest:
type: object
required:
@@ -4588,18 +4269,18 @@ components:
description: Name for the API key. This helps identify the key's purpose
public_key:
type: string
- description: >-
- RSA public key in PEM format. This will be used to verify signatures
- on API requests
+ description: RSA public key in PEM format. This will be used to verify signatures on API requests
scopes:
type: array
- description: >-
- List of scopes to grant to the API key. If the broad `write` parent
- scope is included, `read` must also be included. Child scopes may be
- granted without the broad parent scope. Defaults to full access
- (`read`, `write`) if not provided.
+ description: List of scopes to grant to the API key. If the broad `write` parent scope is included, `read` must also be included. Child scopes may be granted without the broad parent scope. Defaults to full access (`read`, `write`) if not provided.
items:
$ref: '#/components/schemas/ApiKeyScope'
+ subaccount:
+ type: integer
+ minimum: 0
+ maximum: 63
+ description: If set, restricts the API key to a single sub-account (0-63) that you own. A restricted key may only read and trade on that sub-account; it cannot act on other sub-accounts, transfer funds between sub-accounts, or create sub-accounts. Omit to leave the key unrestricted.
+
CreateApiKeyResponse:
type: object
required:
@@ -4608,6 +4289,7 @@ components:
api_key_id:
type: string
description: Unique identifier for the newly created API key
+
GenerateApiKeyRequest:
type: object
required:
@@ -4618,13 +4300,15 @@ components:
description: Name for the API key. This helps identify the key's purpose
scopes:
type: array
- description: >-
- List of scopes to grant to the API key. If the broad `write` parent
- scope is included, `read` must also be included. Child scopes may be
- granted without the broad parent scope. Defaults to full access
- (`read`, `write`) if not provided.
+ description: List of scopes to grant to the API key. If the broad `write` parent scope is included, `read` must also be included. Child scopes may be granted without the broad parent scope. Defaults to full access (`read`, `write`) if not provided.
items:
$ref: '#/components/schemas/ApiKeyScope'
+ subaccount:
+ type: integer
+ minimum: 0
+ maximum: 63
+ description: If set, restricts the API key to a single sub-account (0-63) that you own. A restricted key may only read and trade on that sub-account; it cannot act on other sub-accounts, transfer funds between sub-accounts, or create sub-accounts. Omit to leave the key unrestricted.
+
GenerateApiKeyResponse:
type: object
required:
@@ -4636,9 +4320,8 @@ components:
description: Unique identifier for the newly generated API key
private_key:
type: string
- description: >-
- RSA private key in PEM format. This must be stored securely and
- cannot be retrieved again after this response
+ description: RSA private key in PEM format. This must be stored securely and cannot be retrieved again after this response
+
GetTagsForSeriesCategoriesResponse:
type: object
required:
@@ -4651,6 +4334,7 @@ components:
type: array
items:
type: string
+
ScopeList:
type: object
required:
@@ -4661,6 +4345,7 @@ components:
description: List of scopes
items:
type: string
+
SportFilterDetails:
type: object
required:
@@ -4677,6 +4362,7 @@ components:
description: Mapping of competitions to their scope lists
additionalProperties:
$ref: '#/components/schemas/ScopeList'
+
GetFiltersBySportsResponse:
type: object
required:
@@ -4693,6 +4379,7 @@ components:
description: Ordered list of sports for display
items:
type: string
+
BucketLimit:
type: object
description: |
@@ -4716,6 +4403,7 @@ components:
headroom that idle clients accumulate and can spend in a single
pulse (e.g. write buckets at non-Basic tiers hold two seconds of
budget).
+
GetAccountApiLimitsResponse:
type: object
required:
@@ -4726,10 +4414,7 @@ components:
properties:
usage_tier:
type: string
- description: >-
- User's effective Predictions API usage tier for these limits (for
- example, basic, advanced, expert, premier, paragon, prime, or
- prestige).
+ description: User's effective Predictions API usage tier for these limits (for example, basic, advanced, expert, premier, paragon, prime, or prestige).
example: expert
read:
$ref: '#/components/schemas/BucketLimit'
@@ -4737,12 +4422,10 @@ components:
$ref: '#/components/schemas/BucketLimit'
grants:
type: array
- description: >-
- The caller's active API usage level grants across exchange lanes,
- where each grant applies to its exchange_instance and usage_tier
- reflects the effective tier for the lane reported by this endpoint.
+ description: The caller's active API usage level grants across exchange lanes, where each grant applies to its exchange_instance and usage_tier reflects the effective tier for the lane reported by this endpoint.
items:
$ref: '#/components/schemas/ApiUsageLevelGrant'
+
ApiUsageLevelGrant:
type: object
required:
@@ -4754,22 +4437,17 @@ components:
$ref: '#/components/schemas/ExchangeInstance'
level:
type: string
- description: >-
- API usage level this grant confers (for example, expert, premier,
- paragon, prime, or prestige).
+ description: API usage level this grant confers (for example, expert, premier, paragon, prime, or prestige).
example: prestige
expires_ts:
type: integer
format: int64
nullable: true
- description: >-
- Unix timestamp (seconds) when the grant expires. Absent for
- permanent grants.
+ description: Unix timestamp (seconds) when the grant expires. Absent for permanent grants.
source:
type: string
- description: >-
- How the grant was created: "volume" (earned from trading volume) or
- "manual" (assigned by Kalshi).
+ description: 'How the grant was created: "volume" (earned from trading volume) or "manual" (assigned by Kalshi).'
+
GetAccountApiUsageLevelVolumeProgressResponse:
type: object
required:
@@ -4777,12 +4455,10 @@ components:
properties:
volume_progress:
type: array
- description: >-
- Latest cron-computed trading volume progress toward volume-based API
- usage tiers for the predictions (event_contract) lane. Volume-based
- public tiers are Expert, Premier, Paragon, Prime, and Prestige.
+ description: Latest cron-computed trading volume progress toward volume-based API usage tiers for the predictions (event_contract) lane. Volume-based public tiers are Expert, Premier, Paragon, Prime, and Prestige.
items:
$ref: '#/components/schemas/AccountApiUsageLevelVolumeProgress'
+
AccountApiUsageLevelVolumeProgress:
type: object
required:
@@ -4793,16 +4469,14 @@ components:
computed_ts:
type: integer
format: int64
- description: >-
- Unix timestamp (seconds) when this progress was computed;
- trailing_30d_volume_fp covers the trailing 30 days ending at this
- time.
+ description: 'Unix timestamp (seconds) when this progress was computed; trailing_30d_volume_fp covers the trailing 30 days ending at this time.'
trailing_30d_volume_fp:
$ref: '#/components/schemas/FixedPointCount'
goals:
type: array
items:
$ref: '#/components/schemas/AccountApiUsageLevelVolumeGoal'
+
AccountApiUsageLevelVolumeGoal:
type: object
required:
@@ -4818,6 +4492,7 @@ components:
$ref: '#/components/schemas/FixedPointCount'
keep_volume_goal_fp:
$ref: '#/components/schemas/FixedPointCount'
+
EndpointTokenCost:
type: object
required:
@@ -4833,9 +4508,8 @@ components:
description: API route path for the endpoint.
cost:
type: integer
- description: >-
- Configured token cost for an endpoint whose cost differs from the
- default cost.
+ description: Configured token cost for an endpoint whose cost differs from the default cost.
+
GetAccountEndpointCostsResponse:
type: object
required:
@@ -4844,16 +4518,13 @@ components:
properties:
default_cost:
type: integer
- description: >-
- Default token cost applied to endpoints that are not listed in
- `endpoint_costs`. This is currently 10.
+ description: Default token cost applied to endpoints that are not listed in `endpoint_costs`. This is currently 10.
endpoint_costs:
type: array
- description: >-
- API v2 endpoints whose configured token cost differs from
- `default_cost`. Endpoints that use the default cost are omitted.
+ description: API v2 endpoints whose configured token cost differs from `default_cost`. Endpoints that use the default cost are omitted.
items:
$ref: '#/components/schemas/EndpointTokenCost'
+
ExchangeStatus:
type: object
required:
@@ -4862,36 +4533,24 @@ components:
properties:
exchange_active:
type: boolean
- description: >-
- False if the core Kalshi exchange is no longer taking any state
- changes at all. This includes but is not limited to trading, new
- users, and transfers. True unless we are under maintenance.
+ description: False if the core Kalshi exchange is no longer taking any state changes at all. This includes but is not limited to trading, new users, and transfers. True unless we are under maintenance.
trading_active:
type: boolean
- description: >-
- True if we are currently permitting trading on the exchange. This is
- true during trading hours and false outside exchange hours. Kalshi
- reserves the right to pause at any time in case issues are detected.
+ description: True if we are currently permitting trading on the exchange. This is true during trading hours and false outside exchange hours. Kalshi reserves the right to pause at any time in case issues are detected.
intra_exchange_transfers_active:
type: boolean
- description: >-
- True if intra-exchange transfers are currently permitted. False when
- transfers are temporarily blocked.
+ description: True if intra-exchange transfers are currently permitted. False when transfers are temporarily blocked.
exchange_estimated_resume_time:
type: string
format: date-time
- description: >-
- Estimated downtime for the current exchange maintenance window.
- However, this is not guaranteed and can be extended.
+ description: Estimated downtime for the current exchange maintenance window. However, this is not guaranteed and can be extended.
nullable: true
exchange_index_statuses:
type: array
- description: >-
- Status of each exchange index. The top-level fields above reflect
- the default exchange index (0). Absent when the per-index breakdown
- is unavailable.
+ description: Status of each exchange index. The top-level fields above reflect the default exchange index (0). Absent when the per-index breakdown is unavailable.
items:
$ref: '#/components/schemas/ExchangeIndexStatus'
+
ExchangeIndexStatus:
type: object
required:
@@ -4904,19 +4563,14 @@ components:
$ref: '#/components/schemas/ExchangeIndex'
exchange_active:
type: boolean
- description: >-
- False if this exchange index is no longer taking any state changes
- at all. True unless under maintenance.
+ description: False if this exchange index is no longer taking any state changes at all. True unless under maintenance.
trading_active:
type: boolean
- description: >-
- True if trading is currently permitted on this exchange index. False
- outside exchange hours or during pauses.
+ description: True if trading is currently permitted on this exchange index. False outside exchange hours or during pauses.
intra_exchange_transfers_active:
type: boolean
- description: >-
- True if intra-exchange transfers are currently permitted on this
- exchange index. False when transfers are temporarily blocked.
+ description: True if intra-exchange transfers are currently permitted on this exchange index. False when transfers are temporarily blocked.
+
GetExchangeAnnouncementsResponse:
type: object
required:
@@ -4927,6 +4581,7 @@ components:
description: A list of exchange-wide announcements.
items:
$ref: '#/components/schemas/Announcement'
+
Announcement:
type: object
required:
@@ -4937,10 +4592,7 @@ components:
properties:
type:
type: string
- enum:
- - info
- - warning
- - error
+ enum: [info, warning, error]
description: The type of the announcement.
message:
type: string
@@ -4951,10 +4603,9 @@ components:
description: The time the announcement was delivered.
status:
type: string
- enum:
- - active
- - inactive
+ enum: [active, inactive]
description: The current status of this announcement.
+
GetExchangeScheduleResponse:
type: object
required:
@@ -4962,6 +4613,7 @@ components:
properties:
schedule:
$ref: '#/components/schemas/Schedule'
+
Schedule:
type: object
required:
@@ -4970,18 +4622,15 @@ components:
properties:
standard_hours:
type: array
- description: >-
- The standard operating hours of the exchange. All times are
- expressed in ET. Outside of these times trading will be unavailable.
+ description: The standard operating hours of the exchange. All times are expressed in ET. Outside of these times trading will be unavailable.
items:
$ref: '#/components/schemas/WeeklySchedule'
maintenance_windows:
type: array
- description: >-
- Scheduled maintenance windows, during which the exchange may be
- unavailable.
+ description: Scheduled maintenance windows, during which the exchange may be unavailable.
items:
$ref: '#/components/schemas/MaintenanceWindow'
+
WeeklySchedule:
type: object
required:
@@ -5002,9 +4651,7 @@ components:
end_time:
type: string
format: date-time
- description: >-
- End date and time for when this weekly schedule is no longer
- effective.
+ description: End date and time for when this weekly schedule is no longer effective.
monday:
type: array
description: Trading hours for Monday. May contain multiple sessions.
@@ -5040,6 +4687,7 @@ components:
description: Trading hours for Sunday. May contain multiple sessions.
items:
$ref: '#/components/schemas/DailySchedule'
+
DailySchedule:
type: object
required:
@@ -5052,6 +4700,7 @@ components:
close_time:
type: string
description: Closing time in ET (Eastern Time) format HH:MM.
+
MaintenanceWindow:
type: object
required:
@@ -5066,6 +4715,7 @@ components:
type: string
format: date-time
description: End date and time of the maintenance window.
+
GetHistoricalCutoffResponse:
type: object
required:
@@ -5076,25 +4726,19 @@ components:
market_settled_ts:
type: string
format: date-time
- description: >
- Cutoff based on **market settlement time**. Markets and their
- candlesticks that settled before this timestamp must be accessed via
- `GET /historical/markets` and `GET
- /historical/markets/{ticker}/candlesticks`.
+ description: |
+ Cutoff based on **market settlement time**. Markets and their candlesticks that settled before this timestamp must be accessed via `GET /historical/markets` and `GET /historical/markets/{ticker}/candlesticks`.
trades_created_ts:
type: string
format: date-time
- description: >
- Cutoff based on **trade fill time**. Fills that occurred before this
- timestamp must be accessed via `GET /historical/fills`.
+ description: |
+ Cutoff based on **trade fill time**. Fills that occurred before this timestamp must be accessed via `GET /historical/fills`.
orders_updated_ts:
type: string
format: date-time
- description: >
- Cutoff based on **order cancellation or execution time**. Orders
- canceled or fully executed before this timestamp must be accessed
- via `GET /historical/orders`. Resting (active) orders are always
- available in `GET /portfolio/orders`.
+ description: |
+ Cutoff based on **order cancellation or execution time**. Orders canceled or fully executed before this timestamp must be accessed via `GET /historical/orders`. Resting (active) orders are always available in `GET /portfolio/orders`.
+
GetUserDataTimestampResponse:
type: object
required:
@@ -5104,6 +4748,7 @@ components:
type: string
format: date-time
description: Timestamp when user data was last updated.
+
GetMarketCandlesticksResponse:
type: object
required:
@@ -5118,6 +4763,7 @@ components:
description: Array of candlestick data points for the specified time range.
items:
$ref: '#/components/schemas/MarketCandlestick'
+
GetEventCandlesticksResponse:
type: object
required:
@@ -5132,9 +4778,7 @@ components:
type: string
market_candlesticks:
type: array
- description: >-
- Array of market candlestick arrays, one for each market in the
- event.
+ description: Array of market candlestick arrays, one for each market in the event.
items:
type: array
items:
@@ -5142,9 +4786,8 @@ components:
adjusted_end_ts:
type: integer
format: int64
- description: >-
- Adjusted end timestamp if the requested candlesticks would be larger
- than maxAggregateCandidates.
+ description: Adjusted end timestamp if the requested candlesticks would be larger than maxAggregateCandidates.
+
BatchGetMarketCandlesticksResponse:
type: object
required:
@@ -5155,6 +4798,7 @@ components:
description: Array of market candlestick data, one entry per requested market.
items:
$ref: '#/components/schemas/MarketCandlesticksResponse'
+
MarketCandlesticksResponse:
type: object
required:
@@ -5166,11 +4810,10 @@ components:
description: Market ticker string (e.g., 'INXD-24JAN01').
candlesticks:
type: array
- description: >-
- Array of candlestick data points for the market. Includes an initial
- data point at the start timestamp when available.
+ description: Array of candlestick data points for the market. Includes an initial data point at the start timestamp when available.
items:
$ref: '#/components/schemas/MarketCandlestick'
+
MarketCandlestick:
type: object
required:
@@ -5187,29 +4830,20 @@ components:
description: Unix timestamp for the inclusive end of the candlestick period.
yes_bid:
$ref: '#/components/schemas/BidAskDistribution'
- description: >-
- Open, high, low, close (OHLC) data for YES buy offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for YES buy offers on the market during the candlestick period.
yes_ask:
$ref: '#/components/schemas/BidAskDistribution'
- description: >-
- Open, high, low, close (OHLC) data for YES sell offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for YES sell offers on the market during the candlestick period.
price:
$ref: '#/components/schemas/PriceDistribution'
- description: >-
- Open, high, low, close (OHLC) and more data for trade YES contract
- prices on the market during the candlestick period.
+ description: Open, high, low, close (OHLC) and more data for trade YES contract prices on the market during the candlestick period.
volume_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought on the
- market during the candlestick period.
+ description: String representation of the number of contracts bought on the market during the candlestick period.
open_interest_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought on the
- market by end of the candlestick period (end_period_ts).
+ description: String representation of the number of contracts bought on the market by end of the candlestick period (end_period_ts).
+
BidAskDistribution:
type: object
required:
@@ -5220,81 +4854,54 @@ components:
properties:
open_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Offer price on the market at the start of the candlestick period (in
- dollars).
+ description: Offer price on the market at the start of the candlestick period (in dollars).
low_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Lowest offer price on the market during the candlestick period (in
- dollars).
+ description: Lowest offer price on the market during the candlestick period (in dollars).
high_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Highest offer price on the market during the candlestick period (in
- dollars).
+ description: Highest offer price on the market during the candlestick period (in dollars).
close_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Offer price on the market at the end of the candlestick period (in
- dollars).
+ description: Offer price on the market at the end of the candlestick period (in dollars).
+
PriceDistribution:
type: object
properties:
open_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- First traded YES contract price on the market during the candlestick
- period (in dollars). May be null if there was no trade during the
- period.
+ description: First traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
low_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Lowest traded YES contract price on the market during the
- candlestick period (in dollars). May be null if there was no trade
- during the period.
+ description: Lowest traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
high_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Highest traded YES contract price on the market during the
- candlestick period (in dollars). May be null if there was no trade
- during the period.
+ description: Highest traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
close_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Last traded YES contract price on the market during the candlestick
- period (in dollars). May be null if there was no trade during the
- period.
+ description: Last traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
mean_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Mean traded YES contract price on the market during the candlestick
- period (in dollars). May be null if there was no trade during the
- period.
+ description: Mean traded YES contract price on the market during the candlestick period (in dollars). May be null if there was no trade during the period.
previous_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Last traded YES contract price on the market before the candlestick
- period (in dollars). May be null if there were no trades before the
- period.
+ description: Last traded YES contract price on the market before the candlestick period (in dollars). May be null if there were no trades before the period.
min_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Minimum close price of any market during the candlestick period (in
- dollars).
+ description: Minimum close price of any market during the candlestick period (in dollars).
max_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Maximum close price of any market during the candlestick period (in
- dollars).
+ description: Maximum close price of any market during the candlestick period (in dollars).
+
+ # Live Data schemas
LiveData:
type: object
required:
@@ -5312,6 +4919,7 @@ components:
milestone_id:
type: string
description: Milestone ID
+
GetLiveDataResponse:
type: object
required:
@@ -5319,6 +4927,7 @@ components:
properties:
live_data:
$ref: '#/components/schemas/LiveData'
+
GetLiveDatasResponse:
type: object
required:
@@ -5328,11 +4937,13 @@ components:
type: array
items:
$ref: '#/components/schemas/LiveData'
+
GetGameStatsResponse:
type: object
properties:
pbp:
$ref: '#/components/schemas/PlayByPlay'
+
PlayByPlay:
type: object
description: Play-by-play data organized by period.
@@ -5347,6 +4958,7 @@ components:
items:
type: object
additionalProperties: true
+
IndexedBalance:
type: object
required:
@@ -5357,6 +4969,7 @@ components:
$ref: '#/components/schemas/ExchangeIndex'
balance:
$ref: '#/components/schemas/FixedPointDollars'
+
GetBalanceResponse:
type: object
required:
@@ -5368,20 +4981,14 @@ components:
balance:
type: integer
format: int64
- description: >-
- Member's available balance in cents. This represents the amount
- available for trading.
+ description: Member's available balance in cents. This represents the amount available for trading.
balance_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Member's available balance as a fixed-point dollar string. This
- represents the amount available for trading.
+ description: Member's available balance as a fixed-point dollar string. This represents the amount available for trading.
portfolio_value:
type: integer
format: int64
- description: >-
- Member's portfolio value in cents. This is the current value of all
- positions held.
+ description: Member's portfolio value in cents. This is the current value of all positions held.
updated_ts:
type: integer
format: int64
@@ -5391,6 +4998,18 @@ components:
items:
$ref: '#/components/schemas/IndexedBalance'
description: Balance broken down per exchange index.
+
+ CreateSubaccountRequest:
+ type: object
+ properties:
+ exchange_index:
+ allOf:
+ - $ref: '#/components/schemas/ExchangeIndex'
+ description: "Identifier for an exchange shard. Defaults to 0 if unspecified."
+ x-go-type-skip-optional-pointer: true
+ x-oapi-codegen-extra-tags:
+ validate: "gte=0"
+
CreateSubaccountResponse:
type: object
required:
@@ -5399,6 +5018,7 @@ components:
subaccount_number:
type: integer
description: The sequential number assigned to this subaccount (1-63).
+
ApplySubaccountTransferRequest:
type: object
required:
@@ -5412,24 +5032,91 @@ components:
format: uuid
description: Unique client-provided transfer ID for idempotency.
x-oapi-codegen-extra-tags:
- validate: required
+ validate: "required"
from_subaccount:
type: integer
- description: >-
- Source subaccount number (0 for primary, 1-63 for numbered
- subaccounts).
+ description: Source subaccount number (0 for primary, 1-63 for numbered subaccounts).
to_subaccount:
type: integer
- description: >-
- Destination subaccount number (0 for primary, 1-63 for numbered
- subaccounts).
+ description: Destination subaccount number (0 for primary, 1-63 for numbered subaccounts).
amount_cents:
type: integer
format: int64
description: Amount to transfer in cents.
+ exchange_index:
+ allOf:
+ - $ref: '#/components/schemas/ExchangeIndex'
+ description: "Identifier for an exchange shard. Defaults to 0 if unspecified."
+ x-go-type-skip-optional-pointer: true
+ x-oapi-codegen-extra-tags:
+ validate: "gte=0"
+
ApplySubaccountTransferResponse:
type: object
description: Empty response indicating successful transfer.
+
+ ApplySubaccountPositionTransferRequest:
+ type: object
+ required:
+ - client_transfer_id
+ - from_subaccount
+ - to_subaccount
+ - market_ticker
+ - side
+ - count
+ - price_cents
+ properties:
+ client_transfer_id:
+ type: string
+ format: uuid
+ description: Unique client-provided transfer ID for idempotency. Retrying with the same value returns 409.
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ from_subaccount:
+ type: integer
+ nullable: true
+ description: Source subaccount number (0 for primary, 1-63 for numbered subaccounts).
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ to_subaccount:
+ type: integer
+ nullable: true
+ description: Destination subaccount number (0 for primary, 1-63 for numbered subaccounts).
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ market_ticker:
+ type: string
+ description: Ticker of the market whose position is being moved. The market must be on exchange shard 0; markets on any other shard are rejected.
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ side:
+ type: string
+ enum: ["yes", "no"]
+ description: Side of the position to move.
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ count:
+ type: integer
+ nullable: true
+ description: Number of contracts to move (must be greater than 0).
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+ price_cents:
+ type: integer
+ nullable: true
+ description: Per-contract price in cents (0-100) used to set cost basis and realized P&L.
+ x-oapi-codegen-extra-tags:
+ validate: "required"
+
+ ApplySubaccountPositionTransferResponse:
+ type: object
+ required:
+ - position_transfer_id
+ properties:
+ position_transfer_id:
+ type: string
+ description: Server-generated identifier for the position transfer.
+
GetSubaccountBalancesResponse:
type: object
required:
@@ -5439,6 +5126,7 @@ components:
type: array
items:
$ref: '#/components/schemas/SubaccountBalance'
+
SubaccountBalance:
type: object
required:
@@ -5460,6 +5148,7 @@ components:
type: integer
format: int64
description: Unix timestamp of last balance update.
+
GetSubaccountTransfersResponse:
type: object
required:
@@ -5472,6 +5161,7 @@ components:
cursor:
type: string
description: Cursor for the next page of results.
+
SubaccountTransfer:
type: object
required:
@@ -5480,6 +5170,8 @@ components:
- to_subaccount
- amount_cents
- created_ts
+ - exchange_index
+ - transfer_type
properties:
transfer_id:
type: string
@@ -5493,11 +5185,33 @@ components:
amount_cents:
type: integer
format: int64
- description: Transfer amount in cents.
+ description: Cash transfer amount in cents. Zero for position transfers.
created_ts:
type: integer
format: int64
description: Unix timestamp when the transfer was created.
+ exchange_index:
+ type: integer
+ description: Exchange index the transfer was applied on.
+ transfer_type:
+ type: string
+ enum: [cash, position]
+ x-enum-varnames: [TransferTypeCash, TransferTypePosition]
+ description: Whether this row is a cash or position transfer.
+ market_ticker:
+ type: string
+ description: Market ticker (position transfers only).
+ side:
+ type: string
+ enum: ["yes", "no"]
+ description: Position side (position transfers only).
+ count:
+ type: integer
+ description: Number of contracts moved (position transfers only).
+ price_cents:
+ type: integer
+ description: Per-contract price in cents (position transfers only).
+
UpdateSubaccountNettingRequest:
type: object
required:
@@ -5510,6 +5224,7 @@ components:
enabled:
type: boolean
description: Whether netting is enabled for this subaccount.
+
GetSubaccountNettingResponse:
type: object
required:
@@ -5519,6 +5234,7 @@ components:
type: array
items:
$ref: '#/components/schemas/SubaccountNettingConfig'
+
SubaccountNettingConfig:
type: object
required:
@@ -5531,6 +5247,8 @@ components:
enabled:
type: boolean
description: Whether netting is enabled for this subaccount.
+
+ # Portfolio schemas (specific to portfolio endpoints, not shared with IB)
GetSettlementsResponse:
type: object
required:
@@ -5542,6 +5260,7 @@ components:
$ref: '#/components/schemas/Settlement'
cursor:
type: string
+
Settlement:
type: object
required:
@@ -5564,47 +5283,36 @@ components:
description: The event ticker symbol of the market that was settled.
market_result:
type: string
- enum:
- - 'yes'
- - 'no'
- - scalar
- description: >-
- The outcome of the market settlement. 'yes' = market resolved to
- YES, 'no' = market resolved to NO, 'scalar' = scalar market settled
- at a specific value.
+ enum: ['yes', 'no', 'scalar']
+ description: The outcome of the market settlement. 'yes' = market resolved to YES, 'no' = market resolved to NO, 'scalar' = scalar market settled at a specific value.
yes_count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of YES contracts owned at the
- time of settlement.
+ description: String representation of the number of YES contracts owned at the time of settlement.
yes_total_cost_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Total cost basis of all YES contracts in fixed-point dollars.
no_count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of NO contracts owned at the
- time of settlement.
+ description: String representation of the number of NO contracts owned at the time of settlement.
no_total_cost_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Total cost basis of all NO contracts in fixed-point dollars.
revenue:
type: integer
- description: >-
- Total revenue earned from this settlement in cents (winning
- contracts pay out 100 cents each).
+ description: Total revenue earned from this settlement in cents (winning contracts pay out 100 cents each).
settled_time:
type: string
format: date-time
description: Timestamp when the market was settled and payouts were processed.
fee_cost:
$ref: '#/components/schemas/FixedPointDollars'
- example: '0.3400'
+ example: "0.3400"
description: Total fees paid in fixed point dollars.
value:
type: integer
nullable: true
description: Payout of a single yes contract in cents.
+
GetPortfolioRestingOrderTotalValueResponse:
type: object
required:
@@ -5613,6 +5321,7 @@ components:
total_resting_order_value:
type: integer
description: Total value of resting orders in cents
+
GetDepositsResponse:
type: object
required:
@@ -5624,6 +5333,7 @@ components:
$ref: '#/components/schemas/Deposit'
cursor:
type: string
+
Deposit:
type: object
required:
@@ -5644,9 +5354,7 @@ components:
- applied
- failed
- returned
- description: >-
- Current status of the deposit. 'applied' means funds are reflected
- in balance.
+ description: Current status of the deposit. 'applied' means funds are reflected in balance.
type:
type: string
enum:
@@ -5672,9 +5380,8 @@ components:
type: integer
format: int64
nullable: true
- description: >-
- Unix timestamp of when the deposit was finalized (applied, failed,
- or returned).
+ description: Unix timestamp of when the deposit was finalized (applied, failed, or returned).
+
GetWithdrawalsResponse:
type: object
required:
@@ -5686,6 +5393,7 @@ components:
$ref: '#/components/schemas/Withdrawal'
cursor:
type: string
+
Withdrawal:
type: object
required:
@@ -5706,9 +5414,7 @@ components:
- applied
- failed
- returned
- description: >-
- Current status of the withdrawal. 'applied' means funds have been
- deducted from balance.
+ description: Current status of the withdrawal. 'applied' means funds have been deducted from balance.
type:
type: string
enum:
@@ -5734,9 +5440,9 @@ components:
type: integer
format: int64
nullable: true
- description: >-
- Unix timestamp of when the withdrawal was finalized (applied,
- failed, or returned).
+ description: Unix timestamp of when the withdrawal was finalized (applied, failed, or returned).
+
+ # FCM schemas
Order:
type: object
required:
@@ -5771,62 +5477,34 @@ components:
type: string
side:
type: string
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
deprecated: true
- description: >
- Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order
- direction](/getting_started/order_direction). This field will not be
- removed before May 14, 2026.
+ description: |
+ Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
action:
type: string
- enum:
- - buy
- - sell
+ enum: [buy, sell]
deprecated: true
- description: >
- Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order
- direction](/getting_started/order_direction). This field will not be
- removed before May 14, 2026.
+ description: |
+ Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
outcome_side:
type: string
- enum:
- - 'yes'
- - 'no'
- description: >
- The outcome side this order is positioned for. buy-yes and sell-no
- produce 'yes'; buy-no and sell-yes produce 'no'.
-
-
- `outcome_side` describes directional exposure only; it does not
- change the order's price. An order at price `p` with
- `outcome_side=no` is matched by an order at the same price `p` with
- `outcome_side=yes` — both parties trade at the same price, just on
- opposite directions.
+ enum: ['yes', 'no']
+ description: |
+ The outcome side this order is positioned for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.
+ `outcome_side` describes directional exposure only; it does not change the order's price. An order at price `p` with `outcome_side=no` is matched by an order at the same price `p` with `outcome_side=yes` — both parties trade at the same price, just on opposite directions.
- `outcome_side` and `book_side` will become the canonical way to
- determine order direction. The legacy `action`, `side`, and `is_yes`
- fields will be deprecated in a future release — please migrate to
- these new fields.
+ `outcome_side` and `book_side` will become the canonical way to determine order direction. The legacy `action`, `side`, and `is_yes` fields will be deprecated in a future release — please migrate to these new fields.
book_side:
$ref: '#/components/schemas/BookSide'
- description: >
- Same directional bit as outcome_side in book vocabulary. 'bid' is
- equivalent to outcome_side 'yes'; 'ask' is equivalent to
- outcome_side 'no'.
-
+ description: |
+ Same directional bit as outcome_side in book vocabulary. 'bid' is equivalent to outcome_side 'yes'; 'ask' is equivalent to outcome_side 'no'.
- `outcome_side` and `book_side` will become the canonical way to
- determine order direction. The legacy `action`, `side`, and `is_yes`
- fields will be deprecated in a future release — please migrate to
- these new fields.
+ `outcome_side` and `book_side` will become the canonical way to determine order direction. The legacy `action`, `side`, and `is_yes` fields will be deprecated in a future release — please migrate to these new fields.
type:
type: string
- enum:
- - limit
- - market
+ enum: [limit, market]
status:
$ref: '#/components/schemas/OrderStatus'
yes_price_dollars:
@@ -5837,17 +5515,13 @@ components:
description: The no price for this order in fixed-point dollars
fill_count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts that have been
- filled
+ description: String representation of the number of contracts that have been filled
remaining_count_fp:
$ref: '#/components/schemas/FixedPointCount'
description: String representation of the remaining contracts for this order
initial_count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the initial size of the order (contract
- units)
+ description: String representation of the initial size of the order (contract units)
taker_fill_cost_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: The cost of filled taker orders in dollars
@@ -5885,9 +5559,7 @@ components:
description: The order group this order is part of
cancel_order_on_pause:
type: boolean
- description: >-
- If this flag is set to true, the order will be canceled if the order
- is open and trading on the exchange is paused for any reason.
+ description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
subaccount_number:
type: integer
nullable: true
@@ -5897,6 +5569,7 @@ components:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
Milestone:
type: object
required:
@@ -5916,14 +5589,11 @@ components:
description: Unique identifier for the milestone.
category:
type: string
- description: Category of the milestone. E.g. Sports, Elections, Esports, Crypto.
+ description: 'Category of the milestone. E.g. Sports, Elections, Esports, Crypto.'
example: Sports
type:
type: string
- description: >-
- Type of the milestone. E.g. football_game, basketball_game,
- soccer_tournament_multi_leg, baseball_game, hockey_match,
- golf_tournament, political_race.
+ description: 'Type of the milestone. E.g. football_game, basketball_game, soccer_tournament_multi_leg, baseball_game, hockey_match, golf_tournament, political_race.'
example: football_game
start_date:
type: string
@@ -5962,13 +5632,12 @@ components:
type: array
items:
type: string
- description: >-
- List of event tickers directly related to the outcome of this
- milestone.
+ description: List of event tickers directly related to the outcome of this milestone.
last_updated_ts:
type: string
format: date-time
description: Last time this structured target was updated.
+
GetMilestoneResponse:
type: object
required:
@@ -5977,6 +5646,7 @@ components:
milestone:
$ref: '#/components/schemas/Milestone'
description: The milestone data.
+
GetMilestonesResponse:
type: object
required:
@@ -5990,6 +5660,7 @@ components:
cursor:
type: string
description: Cursor for pagination.
+
GetOrdersResponse:
type: object
required:
@@ -6002,6 +5673,7 @@ components:
$ref: '#/components/schemas/Order'
cursor:
type: string
+
GetOrderQueuePositionResponse:
type: object
required:
@@ -6010,6 +5682,7 @@ components:
queue_position_fp:
$ref: '#/components/schemas/FixedPointCount'
description: The number of preceding shares before the order in the queue.
+
OrderQueuePosition:
type: object
required:
@@ -6026,6 +5699,7 @@ components:
queue_position_fp:
$ref: '#/components/schemas/FixedPointCount'
description: The number of preceding shares before the order in the queue.
+
GetOrderQueuePositionsResponse:
type: object
required:
@@ -6036,6 +5710,7 @@ components:
description: Queue positions for all matching orders
items:
$ref: '#/components/schemas/OrderQueuePosition'
+
MarketPosition:
type: object
required:
@@ -6044,7 +5719,6 @@ components:
- position_fp
- market_exposure_dollars
- realized_pnl_dollars
- - resting_orders_count
- fees_paid_dollars
- last_updated_ts
properties:
@@ -6057,20 +5731,13 @@ components:
description: Total spent on this market in dollars
position_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought in this
- market. Negative means NO contracts and positive means YES contracts
+ description: String representation of the number of contracts bought in this market. Negative means NO contracts and positive means YES contracts
market_exposure_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Cost of the aggregate market position in dollars
realized_pnl_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Locked in profit and loss, in dollars
- resting_orders_count:
- type: integer
- format: int32
- description: '[DEPRECATED] Aggregate size of resting orders in contract units'
- deprecated: true
fees_paid_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Fees paid on fill orders, in dollars
@@ -6078,6 +5745,7 @@ components:
type: string
format: date-time
description: Last time the position is updated
+
EventPosition:
type: object
required:
@@ -6096,9 +5764,7 @@ components:
description: Total spent on this event in dollars
total_cost_shares_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the total number of shares traded on this
- event (including both YES and NO contracts)
+ description: String representation of the total number of shares traded on this event (including both YES and NO contracts)
event_exposure_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Cost of the aggregate event position in dollars
@@ -6108,6 +5774,7 @@ components:
fees_paid_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Fees paid on fill orders, in dollars
+
GetPositionsResponse:
type: object
required:
@@ -6116,12 +5783,7 @@ components:
properties:
cursor:
type: string
- description: >-
- The Cursor represents a pointer to the next page of records in the
- pagination. Use the value returned here in the cursor query
- parameter for this end-point to get the next page containing limit
- records. An empty value of this field indicates there is no next
- page.
+ description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned here in the cursor query parameter for this end-point to get the next page containing limit records. An empty value of this field indicates there is no next page.
market_positions:
type: array
items:
@@ -6132,6 +5794,7 @@ components:
items:
$ref: '#/components/schemas/EventPosition'
description: List of event positions
+
Trade:
type: object
required:
@@ -6154,9 +5817,7 @@ components:
description: Unique identifier for the market
count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought or sold in
- this trade
+ description: String representation of the number of contracts bought or sold in this trade
yes_price_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Yes price for this trade in dollars
@@ -6165,63 +5826,35 @@ components:
description: No price for this trade in dollars
taker_side:
type: string
- enum:
- - 'yes'
- - 'no'
- x-enum-varnames:
- - TradeTakerSideYes
- - TradeTakerSideNo
+ enum: ['yes', 'no']
+ x-enum-varnames: ['TradeTakerSideYes', 'TradeTakerSideNo']
deprecated: true
- description: >
- Deprecated. Use `taker_outcome_side` (or `taker_book_side`) instead.
- See [Order direction](/getting_started/order_direction). This field
- will not be removed before May 14, 2026.
+ description: |
+ Deprecated. Use `taker_outcome_side` (or `taker_book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
taker_outcome_side:
type: string
- enum:
- - 'yes'
- - 'no'
- x-enum-varnames:
- - TradeTakerOutcomeSideYes
- - TradeTakerOutcomeSideNo
- description: >
- The outcome side the taker is positioned for. buy-yes and sell-no
- produce 'yes'; buy-no and sell-yes produce 'no'.
-
-
- `taker_outcome_side` describes directional exposure only; it does
- not change the trade's price. A trade at price `p` with
- `taker_outcome_side=no` is matched against the maker at the same
- price `p` with the opposite direction — both parties trade at the
- same price.
-
-
- `taker_outcome_side` and `taker_book_side` will become the canonical
- way to determine trade direction. The legacy `taker_side` field will
- be deprecated in a future release — please migrate to these new
- fields.
+ enum: ['yes', 'no']
+ x-enum-varnames: ['TradeTakerOutcomeSideYes', 'TradeTakerOutcomeSideNo']
+ description: |
+ The outcome side the taker is positioned for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.
+
+ `taker_outcome_side` describes directional exposure only; it does not change the trade's price. A trade at price `p` with `taker_outcome_side=no` is matched against the maker at the same price `p` with the opposite direction — both parties trade at the same price.
+
+ `taker_outcome_side` and `taker_book_side` will become the canonical way to determine trade direction. The legacy `taker_side` field will be deprecated in a future release — please migrate to these new fields.
taker_book_side:
$ref: '#/components/schemas/BookSide'
- description: >
- Same directional bit as taker_outcome_side in book vocabulary. 'bid'
- is equivalent to taker_outcome_side 'yes'; 'ask' is equivalent to
- taker_outcome_side 'no'.
-
+ description: |
+ Same directional bit as taker_outcome_side in book vocabulary. 'bid' is equivalent to taker_outcome_side 'yes'; 'ask' is equivalent to taker_outcome_side 'no'.
- `taker_outcome_side` and `taker_book_side` will become the canonical
- way to determine trade direction. The legacy `taker_side` field will
- be deprecated in a future release — please migrate to these new
- fields.
+ `taker_outcome_side` and `taker_book_side` will become the canonical way to determine trade direction. The legacy `taker_side` field will be deprecated in a future release — please migrate to these new fields.
created_time:
type: string
format: date-time
description: Timestamp when this trade was executed
is_block_trade:
type: boolean
- description: >-
- True if this trade was matched off-book as a block trade (e.g. via
- RFQ / negotiated block proposal); false for trades that filled on
- the standard order book.
+ description: True if this trade was matched off-book as a block trade (e.g. via RFQ / negotiated block proposal); false for trades that filled on the standard order book.
+
GetIncentiveProgramsResponse:
type: object
required:
@@ -6234,6 +5867,7 @@ components:
next_cursor:
type: string
description: Cursor for pagination to get the next page of results
+
IncentiveProgram:
type: object
required:
@@ -6252,19 +5886,13 @@ components:
description: Unique identifier for the incentive program
market_id:
type: string
- description: >-
- The unique identifier of the market associated with this incentive
- program
+ description: The unique identifier of the market associated with this incentive program
market_ticker:
type: string
- description: >-
- The ticker symbol of the market associated with this incentive
- program
+ description: The ticker symbol of the market associated with this incentive program
incentive_type:
type: string
- enum:
- - liquidity
- - volume
+ enum: ['liquidity', 'volume']
description: Type of incentive program
incentive_description:
type: string
@@ -6292,9 +5920,8 @@ components:
target_size_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the target size for the incentive program
- (optional)
+ description: String representation of the target size for the incentive program (optional)
+
GetTradesResponse:
type: object
required:
@@ -6307,6 +5934,7 @@ components:
$ref: '#/components/schemas/Trade'
cursor:
type: string
+
Fill:
type: object
required:
@@ -6342,62 +5970,34 @@ components:
description: Unique identifier for the market (legacy field name, same as ticker)
side:
type: string
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
deprecated: true
- description: >
- Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order
- direction](/getting_started/order_direction). This field will not be
- removed before May 14, 2026.
+ description: |
+ Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
action:
type: string
- enum:
- - buy
- - sell
+ enum: ['buy', 'sell']
deprecated: true
- description: >
- Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order
- direction](/getting_started/order_direction). This field will not be
- removed before May 14, 2026.
+ description: |
+ Deprecated. Use `outcome_side` (or `book_side`) instead. See [Order direction](/getting_started/order_direction). This field will not be removed before May 14, 2026.
outcome_side:
type: string
- enum:
- - 'yes'
- - 'no'
- description: >
- The outcome side this fill positioned the user for. buy-yes and
- sell-no produce 'yes'; buy-no and sell-yes produce 'no'.
-
-
- `outcome_side` describes directional exposure only; it does not
- change the fill's price. A fill at price `p` with `outcome_side=no`
- is matched against an order at the same price `p` with
- `outcome_side=yes` — both parties trade at the same price, just on
- opposite directions.
+ enum: ['yes', 'no']
+ description: |
+ The outcome side this fill positioned the user for. buy-yes and sell-no produce 'yes'; buy-no and sell-yes produce 'no'.
+ `outcome_side` describes directional exposure only; it does not change the fill's price. A fill at price `p` with `outcome_side=no` is matched against an order at the same price `p` with `outcome_side=yes` — both parties trade at the same price, just on opposite directions.
- `outcome_side` and `book_side` will become the canonical way to
- determine fill direction. The legacy `action` and `side` fields will
- be deprecated in a future release — please migrate to these new
- fields.
+ `outcome_side` and `book_side` will become the canonical way to determine fill direction. The legacy `action` and `side` fields will be deprecated in a future release — please migrate to these new fields.
book_side:
$ref: '#/components/schemas/BookSide'
- description: >
- Same directional bit as outcome_side in book vocabulary. 'bid' is
- equivalent to outcome_side 'yes'; 'ask' is equivalent to
- outcome_side 'no'.
-
+ description: |
+ Same directional bit as outcome_side in book vocabulary. 'bid' is equivalent to outcome_side 'yes'; 'ask' is equivalent to outcome_side 'no'.
- `outcome_side` and `book_side` will become the canonical way to
- determine fill direction. The legacy `action` and `side` fields will
- be deprecated in a future release — please migrate to these new
- fields.
+ `outcome_side` and `book_side` will become the canonical way to determine fill direction. The legacy `action` and `side` fields will be deprecated in a future release — please migrate to these new fields.
count_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought or sold in
- this fill
+ description: String representation of the number of contracts bought or sold in this fill
yes_price_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Fill price for the yes side in fixed-point dollars
@@ -6406,9 +6006,7 @@ components:
description: Fill price for the no side in fixed-point dollars
is_taker:
type: boolean
- description: >-
- If true, this fill was a taker (removed liquidity from the order
- book)
+ description: If true, this fill was a taker (removed liquidity from the order book)
created_time:
type: string
format: date-time
@@ -6420,13 +6018,12 @@ components:
type: integer
nullable: true
x-omitempty: true
- description: >-
- Subaccount number (0 for primary, 1-63 for subaccounts). Present for
- direct users.
+ description: Subaccount number (0 for primary, 1-63 for subaccounts). Present for direct users.
ts:
type: integer
format: int64
description: Unix timestamp when this fill was executed (legacy field name)
+
GetFillsResponse:
type: object
required:
@@ -6439,6 +6036,8 @@ components:
$ref: '#/components/schemas/Fill'
cursor:
type: string
+
+ # Structured Target schemas
StructuredTarget:
type: object
properties:
@@ -6453,14 +6052,10 @@ components:
description: Type of the structured target.
details:
type: object
- description: >-
- Additional details about the structured target. Contains flexible
- JSON data specific to the target type.
+ description: Additional details about the structured target. Contains flexible JSON data specific to the target type.
source_id:
type: string
- description: >-
- External source identifier for the structured target, if available
- (e.g., third-party data provider ID).
+ description: External source identifier for the structured target, if available (e.g., third-party data provider ID).
source_ids:
type: object
additionalProperties:
@@ -6470,6 +6065,7 @@ components:
type: string
format: date-time
description: Timestamp when this structured target was last updated.
+
GetStructuredTargetsResponse:
type: object
properties:
@@ -6479,17 +6075,19 @@ components:
$ref: '#/components/schemas/StructuredTarget'
cursor:
type: string
- description: >-
- Pagination cursor for the next page. Empty if there are no more
- results.
+ description: Pagination cursor for the next page. Empty if there are no more results.
+
GetStructuredTargetResponse:
type: object
properties:
structured_target:
$ref: '#/components/schemas/StructuredTarget'
+
+ # Order Group schemas
EmptyResponse:
type: object
description: An empty response body
+
IntraExchangeInstanceTransferRequest:
type: object
required:
@@ -6517,6 +6115,7 @@ components:
default: 0
x-go-type-skip-optional-pointer: true
description: Destination exchange shard index (default 0)
+
IntraExchangeInstanceTransferResponse:
type: object
required:
@@ -6525,6 +6124,7 @@ components:
transfer_id:
type: string
description: The ID of the transfer that was created
+
OrderGroup:
type: object
required:
@@ -6537,9 +6137,7 @@ components:
x-go-type-skip-optional-pointer: true
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the current maximum contracts allowed over
- a rolling 15-second window.
+ description: String representation of the current maximum contracts allowed over a rolling 15-second window.
x-go-type-skip-optional-pointer: true
is_auto_cancel_enabled:
type: boolean
@@ -6549,6 +6147,7 @@ components:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
GetOrderGroupsResponse:
type: object
properties:
@@ -6557,6 +6156,7 @@ components:
items:
$ref: '#/components/schemas/OrderGroup'
x-go-type-skip-optional-pointer: true
+
GetOrderGroupResponse:
type: object
required:
@@ -6568,9 +6168,7 @@ components:
description: Whether auto-cancel is enabled for this order group
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the current maximum contracts allowed over
- a rolling 15-second window.
+ description: String representation of the current maximum contracts allowed over a rolling 15-second window.
x-go-type-skip-optional-pointer: true
orders:
type: array
@@ -6582,42 +6180,34 @@ components:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
CreateOrderGroupRequest:
type: object
properties:
subaccount:
type: integer
minimum: 0
- description: >-
- Optional subaccount number to use for this order group (0 for
- primary, 1-63 for subaccounts)
+ description: Optional subaccount number to use for this order group (0 for primary, 1-63 for subaccounts)
default: 0
x-go-type-skip-optional-pointer: true
contracts_limit:
type: integer
format: int64
minimum: 1
- description: >-
- Specifies the maximum number of contracts that can be matched within
- this group over a rolling 15-second window. Whole contracts only.
- Provide contracts_limit or contracts_limit_fp; if both provided they
- must match.
+ description: Specifies the maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
validate: omitempty,gte=1
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the maximum number of contracts that can be
- matched within this group over a rolling 15-second window. Provide
- contracts_limit or contracts_limit_fp; if both provided they must
- match.
+ description: String representation of the maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
x-go-type-skip-optional-pointer: true
+
UpdateOrderGroupLimitRequest:
type: object
properties:
@@ -6625,22 +6215,15 @@ components:
type: integer
format: int64
minimum: 1
- description: >-
- New maximum number of contracts that can be matched within this
- group over a rolling 15-second window. Whole contracts only. Provide
- contracts_limit or contracts_limit_fp; if both provided they must
- match.
+ description: New maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
validate: omitempty,gte=1
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the new maximum number of contracts that
- can be matched within this group over a rolling 15-second window.
- Provide contracts_limit or contracts_limit_fp; if both provided they
- must match.
+ description: String representation of the new maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
+
CreateOrderGroupResponse:
type: object
required:
@@ -6653,14 +6236,13 @@ components:
subaccount:
type: integer
minimum: 0
- description: >-
- Subaccount number that owns the created order group (0 for primary,
- 1-63 for subaccounts).
+ description: Subaccount number that owns the created order group (0 for primary, 1-63 for subaccounts).
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
GetCommunicationsIDResponse:
type: object
required:
@@ -6669,6 +6251,7 @@ components:
communications_id:
type: string
description: A public communications ID which is used to identify the user
+
BlockTradeProposal:
type: object
required:
@@ -6695,25 +6278,17 @@ components:
description: User ID of the proposal creator
buyer_user_id:
type: string
- description: >-
- User ID of the buyer. Empty when the authenticated user is not the
- buyer.
+ description: User ID of the buyer. Empty when the authenticated user is not the buyer.
buyer_subtrader_id:
type: string
- description: >-
- Subtrader ID of the buyer. Empty when the authenticated user is not
- the buyer.
+ description: Subtrader ID of the buyer. Empty when the authenticated user is not the buyer.
x-go-type-skip-optional-pointer: true
seller_user_id:
type: string
- description: >-
- User ID of the seller. Empty when the authenticated user is not the
- seller.
+ description: User ID of the seller. Empty when the authenticated user is not the seller.
seller_subtrader_id:
type: string
- description: >-
- Subtrader ID of the seller. Empty when the authenticated user is not
- the seller.
+ description: Subtrader ID of the seller. Empty when the authenticated user is not the seller.
x-go-type-skip-optional-pointer: true
market_ticker:
type: string
@@ -6729,9 +6304,7 @@ components:
maker_side:
type: string
description: The maker side of the trade
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
expiration_ts:
type: string
format: date-time
@@ -6773,6 +6346,7 @@ components:
type: string
description: Order ID for the seller after the proposal is executed
x-go-type-skip-optional-pointer: true
+
GetBlockTradeProposalsResponse:
type: object
required:
@@ -6787,6 +6361,7 @@ components:
type: string
description: Cursor for pagination to get the next page of results
x-go-type-skip-optional-pointer: true
+
ProposeBlockTradeRequest:
type: object
required:
@@ -6805,18 +6380,13 @@ components:
validate: required
buyer_subtrader_id:
type: string
- description: >-
- Subtrader ID of the buyer. Provide either this or buyer_subaccount,
- not both.
+ description: Subtrader ID of the buyer. Provide either this or buyer_subaccount, not both.
x-go-type-skip-optional-pointer: true
buyer_subaccount:
type: integer
minimum: 0
maximum: 63
- description: >-
- User-managed subaccount number of the buyer (0 for primary, 1-63 for
- numbered subaccounts). Provide either this or buyer_subtrader_id,
- not both.
+ description: User-managed subaccount number of the buyer (0 for primary, 1-63 for numbered subaccounts). Provide either this or buyer_subtrader_id, not both.
seller_user_id:
type: string
description: User ID of the seller
@@ -6824,18 +6394,13 @@ components:
validate: required
seller_subtrader_id:
type: string
- description: >-
- Subtrader ID of the seller. Provide either this or
- seller_subaccount, not both.
+ description: Subtrader ID of the seller. Provide either this or seller_subaccount, not both.
x-go-type-skip-optional-pointer: true
seller_subaccount:
type: integer
minimum: 0
maximum: 63
- description: >-
- User-managed subaccount number of the seller (0 for primary, 1-63
- for numbered subaccounts). Provide either this or
- seller_subtrader_id, not both.
+ description: User-managed subaccount number of the seller (0 for primary, 1-63 for numbered subaccounts). Provide either this or seller_subtrader_id, not both.
market_ticker:
type: string
description: The ticker of the market for this block trade
@@ -6858,9 +6423,7 @@ components:
maker_side:
type: string
description: The maker side of the trade
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
x-oapi-codegen-extra-tags:
validate: required,oneof=yes no
expiration_ts:
@@ -6869,6 +6432,7 @@ components:
description: Expiration time of the proposal
x-oapi-codegen-extra-tags:
validate: required
+
ProposeBlockTradeResponse:
type: object
required:
@@ -6877,23 +6441,20 @@ components:
block_trade_proposal_id:
type: string
description: The ID of the newly created block trade proposal
+
AcceptBlockTradeProposalRequest:
type: object
properties:
subtrader_id:
type: string
- description: >-
- Subtrader ID to accept as. Provide either this or subaccount, not
- both.
+ description: Subtrader ID to accept as. Provide either this or subaccount, not both.
x-go-type-skip-optional-pointer: true
subaccount:
type: integer
minimum: 0
maximum: 63
- description: >-
- User-managed subaccount number to accept as (0 for primary, 1-63 for
- numbered subaccounts). Provide either this or subtrader_id, not
- both.
+ description: User-managed subaccount number to accept as (0 for primary, 1-63 for numbered subaccounts). Provide either this or subtrader_id, not both.
+
RFQ:
type: object
required:
@@ -6915,18 +6476,14 @@ components:
description: The ticker of the market this RFQ is for
contracts_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts requested in the
- RFQ
+ description: String representation of the number of contracts requested in the RFQ
target_cost_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Total value of the RFQ in dollars
status:
type: string
description: Current status of the RFQ (open, closed)
- enum:
- - open
- - closed
+ enum: [open, closed]
created_ts:
type: string
format: date-time
@@ -6955,9 +6512,7 @@ components:
x-go-type-skip-optional-pointer: true
creator_subaccount:
type: integer
- description: >-
- Subaccount number of the RFQ creator (visible when the caller is the
- RFQ creator)
+ description: Subaccount number of the RFQ creator (visible when the caller is the RFQ creator)
cancelled_ts:
type: string
format: date-time
@@ -6966,6 +6521,7 @@ components:
type: string
format: date-time
description: Timestamp when the RFQ was last updated
+
GetRFQsResponse:
type: object
required:
@@ -6980,6 +6536,7 @@ components:
type: string
description: Cursor for pagination to get the next page of results
x-go-type-skip-optional-pointer: true
+
GetRFQResponse:
type: object
required:
@@ -6988,6 +6545,7 @@ components:
rfq:
$ref: '#/components/schemas/RFQ'
description: The details of the requested RFQ
+
CreateRFQRequest:
type: object
required:
@@ -6999,23 +6557,16 @@ components:
description: The ticker of the market for which to create an RFQ
contracts:
type: integer
- description: >-
- Whole-contract count for the RFQ. Use contracts_fp for partial
- contract values; if both are provided, they must match.
+ description: Whole-contract count for the RFQ. Use contracts_fp for partial contract values; if both are provided, they must match.
x-go-type-skip-optional-pointer: true
contracts_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- Fixed-point number of contracts for the RFQ. Supports partial
- contracts in 0.01-contract increments; if contracts is also
- provided, both values must match.
+ description: Fixed-point number of contracts for the RFQ. Supports partial contracts in 0.01-contract increments; if contracts is also provided, both values must match.
target_cost_centi_cents:
type: integer
format: int64
- description: >-
- DEPRECATED: The target cost for the RFQ in centi-cents. Use
- target_cost_dollars instead.
+ description: 'DEPRECATED: The target cost for the RFQ in centi-cents. Use target_cost_dollars instead.'
deprecated: true
x-go-type-skip-optional-pointer: true
target_cost_dollars:
@@ -7036,10 +6587,9 @@ components:
x-go-type-skip-optional-pointer: true
subaccount:
type: integer
- description: >-
- The subaccount number to create the RFQ for (direct members only; 0
- for primary, 1-63 for subaccounts)
+ description: The subaccount number to create the RFQ for (direct members only; 0 for primary, 1-63 for subaccounts)
x-go-type-skip-optional-pointer: true
+
CreateRFQResponse:
type: object
required:
@@ -7048,6 +6598,7 @@ components:
id:
type: string
description: The ID of the newly created RFQ
+
Quote:
type: object
required:
@@ -7099,18 +6650,11 @@ components:
status:
type: string
description: Current status of the quote
- enum:
- - open
- - accepted
- - confirmed
- - executed
- - cancelled
+ enum: [open, accepted, confirmed, executed, cancelled]
accepted_side:
type: string
description: The side that was accepted (yes or no)
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
accepted_ts:
type: string
format: date-time
@@ -7132,9 +6676,7 @@ components:
description: Whether to rest the remainder of the quote after execution
post_only:
type: boolean
- description: >-
- Whether the quote creator's order is post-only (visible when the
- caller is the quote creator)
+ description: Whether the quote creator's order is post-only (visible when the caller is the quote creator)
cancellation_reason:
type: string
description: Reason for quote cancellation if cancelled
@@ -7160,20 +6702,17 @@ components:
x-go-type-skip-optional-pointer: true
creator_subaccount:
type: integer
- description: >-
- Subaccount number of the quote creator (visible when the caller is
- the quote creator)
+ description: Subaccount number of the quote creator (visible when the caller is the quote creator)
rfq_creator_subaccount:
type: integer
- description: >-
- Subaccount number of the RFQ creator (visible when the caller is the
- RFQ creator)
+ description: Subaccount number of the RFQ creator (visible when the caller is the RFQ creator)
yes_contracts_fp:
$ref: '#/components/schemas/FixedPointCount'
description: Number of YES contracts offered in the quote (fixed-point)
no_contracts_fp:
$ref: '#/components/schemas/FixedPointCount'
description: Number of NO contracts offered in the quote (fixed-point)
+
GetQuotesResponse:
type: object
required:
@@ -7188,6 +6727,7 @@ components:
type: string
description: Cursor for pagination to get the next page of results
x-go-type-skip-optional-pointer: true
+
GetQuoteResponse:
type: object
required:
@@ -7196,6 +6736,7 @@ components:
quote:
$ref: '#/components/schemas/Quote'
description: The details of the requested quote
+
CreateQuoteRequest:
type: object
required:
@@ -7220,14 +6761,11 @@ components:
description: Whether to rest the remainder of the quote after execution
post_only:
type: boolean
- description: >-
- If true, the quote creator's resting order will be cancelled rather
- than crossed if it would take liquidity. Defaults to false.
+ description: If true, the quote creator's resting order will be cancelled rather than crossed if it would take liquidity. Defaults to false.
subaccount:
type: integer
- description: >-
- Optional subaccount number to place the quote under (0 for primary,
- 1-63 for subaccounts)
+ description: Optional subaccount number to place the quote under (0 for primary, 1-63 for subaccounts)
+
CreateQuoteResponse:
type: object
required:
@@ -7236,6 +6774,7 @@ components:
id:
type: string
description: The ID of the newly created quote
+
AcceptQuoteRequest:
type: object
required:
@@ -7244,9 +6783,9 @@ components:
accepted_side:
type: string
description: The side of the quote to accept (yes or no)
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
+
+ # Order schemas
GetOrderResponse:
type: object
required:
@@ -7254,6 +6793,7 @@ components:
properties:
order:
$ref: '#/components/schemas/Order'
+
CreateOrderRequest:
type: object
required:
@@ -7270,33 +6810,25 @@ components:
x-go-type-skip-optional-pointer: true
side:
type: string
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
x-oapi-codegen-extra-tags:
validate: required,oneof=yes no
action:
type: string
- enum:
- - buy
- - sell
+ enum: ['buy', 'sell']
x-oapi-codegen-extra-tags:
validate: required,oneof=buy sell
count:
type: integer
minimum: 1
- description: >-
- Order quantity in contracts (whole contracts only). Provide count or
- count_fp; if both provided they must match.
+ description: Order quantity in contracts (whole contracts only). Provide count or count_fp; if both provided they must match.
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
validate: omitempty,gte=1
count_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the order quantity in contracts. Provide
- count or count_fp; if both provided they must match.
+ description: String representation of the order quantity in contracts. Provide count or count_fp; if both provided they must match.
yes_price:
type: integer
minimum: 1
@@ -7316,50 +6848,33 @@ components:
expiration_ts:
type: integer
format: int64
- description: >
- Optional Unix timestamp in seconds for when the order expires. To
- place
-
+ description: |
+ Optional Unix timestamp in seconds for when the order expires. To place
an expiring order, set `time_in_force` to `good_till_canceled` and
-
- provide this `expiration_ts`. `GTT` is an internal execution type
- and is
-
+ provide this `expiration_ts`. `GTT` is an internal execution type and is
not a valid API value for `time_in_force`. The `immediate_or_cancel`
-
time-in-force value cannot be combined with `expiration_ts`.
time_in_force:
type: string
- description: >
- Specifies how long the order remains active. Use
- `good_till_canceled`
-
+ description: |
+ Specifies how long the order remains active. Use `good_till_canceled`
with `expiration_ts` for an order that should rest until a specific
-
expiration time; without `expiration_ts`, `good_till_canceled` is a
-
true good-till-canceled order. `GTT` is not a valid API value.
- enum:
- - fill_or_kill
- - good_till_canceled
- - immediate_or_cancel
+ enum: ['fill_or_kill', 'good_till_canceled', 'immediate_or_cancel']
x-oapi-codegen-extra-tags:
- validate: >-
- omitempty,oneof=fill_or_kill good_till_canceled
- immediate_or_cancel
+ validate: omitempty,oneof=fill_or_kill good_till_canceled immediate_or_cancel
x-go-type-skip-optional-pointer: true
buy_max_cost:
type: integer
- description: >-
- Maximum cost in cents. When specified, the order will automatically
- have Fill-or-Kill (FoK) behavior.
+ description: Maximum cost in cents. When specified, the order will automatically have Fill-or-Kill (FoK) behavior.
post_only:
type: boolean
reduce_only:
type: boolean
sell_position_floor:
type: integer
- description: 'Deprecated: Use reduce_only instead. Only accepts value of 0.'
+ description: "Deprecated: Use reduce_only instead. Only accepts value of 0."
self_trade_prevention_type:
allOf:
- $ref: '#/components/schemas/SelfTradePreventionType'
@@ -7372,25 +6887,20 @@ components:
x-go-type-skip-optional-pointer: true
cancel_order_on_pause:
type: boolean
- description: >-
- If this flag is set to true, the order will be canceled if the order
- is open and trading on the exchange is paused for any reason.
+ description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
subaccount:
type: integer
minimum: 0
default: 0
- description: >-
- The subaccount number to use for this order. 0 is the primary
- subaccount.
+ description: The subaccount number to use for this order. 0 is the primary subaccount.
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
- description: >-
- Exchange shard index. Defaults to 0. Use -1 to auto-route by market
- ticker.
+ description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
x-go-type-skip-optional-pointer: true
+
CreateOrderResponse:
type: object
required:
@@ -7398,6 +6908,7 @@ components:
properties:
order:
$ref: '#/components/schemas/Order'
+
BatchCreateOrdersRequest:
type: object
required:
@@ -7409,6 +6920,7 @@ components:
validate: required,dive
items:
$ref: '#/components/schemas/CreateOrderRequest'
+
BatchCreateOrdersResponse:
type: object
required:
@@ -7418,6 +6930,7 @@ components:
type: array
items:
$ref: '#/components/schemas/BatchCreateOrdersIndividualResponse'
+
BatchCreateOrdersIndividualResponse:
type: object
properties:
@@ -7426,12 +6939,13 @@ components:
nullable: true
order:
allOf:
- - $ref: '#/components/schemas/Order'
+ - $ref: '#/components/schemas/Order'
nullable: true
error:
allOf:
- - $ref: '#/components/schemas/ErrorResponse'
+ - $ref: '#/components/schemas/ErrorResponse'
nullable: true
+
BatchCancelOrdersRequest:
type: object
properties:
@@ -7445,9 +6959,8 @@ components:
type: array
items:
$ref: '#/components/schemas/BatchCancelOrdersRequestOrder'
- description: >-
- An array of orders to cancel, each optionally specifying a
- subaccount
+ description: An array of orders to cancel, each optionally specifying a subaccount
+
BatchCancelOrdersRequestOrder:
type: object
required:
@@ -7460,22 +6973,19 @@ components:
type: integer
minimum: 0
default: 0
- description: >-
- Optional subaccount number to use for this cancellation (0 for
- primary, 1-63 for subaccounts)
+ description: Optional subaccount number to use for this cancellation (0 for primary, 1-63 for subaccounts)
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
- description: >-
- Exchange shard index. Defaults to 0. Use -1 to auto-route by market
- ticker.
+ description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
x-go-type-skip-optional-pointer: true
market_ticker:
type: string
description: Market ticker. Required when exchange_index is -1 (auto).
x-go-type-skip-optional-pointer: true
+
BatchCancelOrdersResponse:
type: object
required:
@@ -7485,6 +6995,7 @@ components:
type: array
items:
$ref: '#/components/schemas/BatchCancelOrdersIndividualResponse'
+
BatchCancelOrdersIndividualResponse:
type: object
required:
@@ -7493,22 +7004,19 @@ components:
properties:
order_id:
type: string
- description: >-
- The order ID to identify which order had an error during batch
- cancellation
+ description: The order ID to identify which order had an error during batch cancellation
order:
allOf:
- $ref: '#/components/schemas/Order'
nullable: true
reduced_by_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts that were
- successfully canceled from this order
+ description: String representation of the number of contracts that were successfully canceled from this order
error:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
nullable: true
+
AmendOrderRequest:
type: object
required:
@@ -7519,9 +7027,7 @@ components:
subaccount:
type: integer
minimum: 0
- description: >-
- Optional subaccount number to use for this amendment (0 for primary,
- 1-63 for subaccounts)
+ description: Optional subaccount number to use for this amendment (0 for primary, 1-63 for subaccounts)
default: 0
x-go-type-skip-optional-pointer: true
ticker:
@@ -7529,15 +7035,11 @@ components:
description: Market ticker
side:
type: string
- enum:
- - 'yes'
- - 'no'
+ enum: ["yes", "no"]
description: Side of the order
action:
type: string
- enum:
- - buy
- - sell
+ enum: ["buy", "sell"]
description: Action of the order
client_order_id:
type: string
@@ -7559,35 +7061,24 @@ components:
description: Updated no price for the order in cents
yes_price_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Updated yes price for the order in fixed-point dollars. Exactly one
- of yes_price, no_price, yes_price_dollars, and no_price_dollars must
- be passed.
+ description: Updated yes price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
no_price_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Updated no price for the order in fixed-point dollars. Exactly one
- of yes_price, no_price, yes_price_dollars, and no_price_dollars must
- be passed.
+ description: Updated no price for the order in fixed-point dollars. Exactly one of yes_price, no_price, yes_price_dollars, and no_price_dollars must be passed.
count:
type: integer
minimum: 1
- description: >-
- Updated quantity for the order (whole contracts only). If updating
- quantity, provide count or count_fp; if both provided they must
- match.
+ description: Updated quantity for the order (whole contracts only). If updating quantity, provide count or count_fp; if both provided they must match.
count_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the updated quantity for the order. If
- updating quantity, provide count or count_fp; if both provided they
- must match.
+ description: String representation of the updated quantity for the order. If updating quantity, provide count or count_fp; if both provided they must match.
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
x-go-type-skip-optional-pointer: true
+
AmendOrderResponse:
type: object
required:
@@ -7600,6 +7091,7 @@ components:
order:
$ref: '#/components/schemas/Order'
description: The order after amendment
+
CreateOrderV2Request:
type: object
required:
@@ -7613,8 +7105,8 @@ components:
ticker: HIGHNY-24JAN01-T60
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
side: bid
- count: '10.00'
- price: '0.5600'
+ count: "10.00"
+ price: "0.5600"
time_in_force: good_till_canceled
self_trade_prevention_type: taker_at_cross
post_only: false
@@ -7644,37 +7136,21 @@ components:
expiration_time:
type: integer
format: int64
- description: >
- Optional Unix timestamp in seconds for when the order expires. To
- place
-
+ description: |
+ Optional Unix timestamp in seconds for when the order expires. To place
an expiring order, set `time_in_force` to `good_till_canceled` and
-
- provide this `expiration_time`. `GTT` is an internal execution type
- and
-
+ provide this `expiration_time`. `GTT` is an internal execution type and
is not a valid API value for `time_in_force`. The
-
`immediate_or_cancel` time-in-force value cannot be combined with
-
`expiration_time`.
time_in_force:
type: string
- description: >
- Specifies how long the order remains active. Use
- `good_till_canceled`
-
- with `expiration_time` for an order that should rest until a
- specific
-
- expiration time; without `expiration_time`, `good_till_canceled` is
- a
-
+ description: |
+ Specifies how long the order remains active. Use `good_till_canceled`
+ with `expiration_time` for an order that should rest until a specific
+ expiration time; without `expiration_time`, `good_till_canceled` is a
true good-till-canceled order. `GTT` is not a valid API value.
- enum:
- - fill_or_kill
- - good_till_canceled
- - immediate_or_cancel
+ enum: ['fill_or_kill', 'good_till_canceled', 'immediate_or_cancel']
x-oapi-codegen-extra-tags:
validate: required,oneof=fill_or_kill good_till_canceled immediate_or_cancel
x-go-type-skip-optional-pointer: true
@@ -7688,21 +7164,15 @@ components:
x-go-type-skip-optional-pointer: true
cancel_order_on_pause:
type: boolean
- description: >-
- If this flag is set to true, the order will be canceled if the order
- is open and trading on the exchange is paused for any reason.
+ description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
reduce_only:
type: boolean
- description: >-
- Specifies whether the order place count should be capped by the
- member's current position.
+ description: Specifies whether the order place count should be capped by the member's current position.
subaccount:
type: integer
minimum: 0
default: 0
- description: >-
- The subaccount number to use for this order. 0 is the primary
- subaccount.
+ description: The subaccount number to use for this order. 0 is the primary subaccount.
x-go-type-skip-optional-pointer: true
order_group_id:
type: string
@@ -7712,10 +7182,9 @@ components:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
- description: >-
- Exchange shard index. Defaults to 0. Use -1 to auto-route by market
- ticker.
+ description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
x-go-type-skip-optional-pointer: true
+
CreateOrderV2Response:
type: object
required:
@@ -7726,8 +7195,8 @@ components:
example:
order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
- fill_count: '0.00'
- remaining_count: '10.00'
+ fill_count: "0.00"
+ remaining_count: "10.00"
ts_ms: 1715793600123
properties:
order_id:
@@ -7739,25 +7208,18 @@ components:
description: Number of contracts filled immediately upon placement.
remaining_count:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts remaining after placement. For IOC orders, this
- reflects the final state after unfilled contracts are canceled.
+ description: Number of contracts remaining after placement. For IOC orders, this reflects the final state after unfilled contracts are canceled.
average_fill_price:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Volume-weighted average fill price. Only present when fill_count >
- 0.
+ description: Volume-weighted average fill price. Only present when fill_count > 0.
average_fee_paid:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Volume-weighted average fee paid per contract for fills resulting
- from this request. Only present when fill_count > 0.
+ description: Volume-weighted average fee paid per contract for fills resulting from this request. Only present when fill_count > 0.
ts_ms:
type: integer
format: int64
- description: >-
- Matching engine timestamp at which the order was processed, as Unix
- epoch milliseconds.
+ description: Matching engine timestamp at which the order was processed, as Unix epoch milliseconds.
+
CancelOrderV2Response:
type: object
required:
@@ -7767,7 +7229,7 @@ components:
example:
order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
- reduced_by: '10.00'
+ reduced_by: "10.00"
ts_ms: 1715793660456
properties:
order_id:
@@ -7776,38 +7238,32 @@ components:
type: string
reduced_by:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts that were canceled (i.e. the remaining count at
- time of cancellation).
+ description: Number of contracts that were canceled (i.e. the remaining count at time of cancellation).
ts_ms:
type: integer
format: int64
- description: >-
- Matching engine timestamp at which the cancellation was processed,
- as Unix epoch milliseconds.
+ description: Matching engine timestamp at which the cancellation was processed, as Unix epoch milliseconds.
+
DecreaseOrderV2Request:
type: object
example:
- reduce_by: '2.00'
+ reduce_by: "2.00"
exchange_index: 0
properties:
reduce_by:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the number of contracts to reduce by.
- Exactly one of `reduce_by` or `reduce_to` must be provided.
+ description: String representation of the number of contracts to reduce by. Exactly one of `reduce_by` or `reduce_to` must be provided.
reduce_to:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the number of contracts to reduce to.
- Exactly one of `reduce_by` or `reduce_to` must be provided.
+ description: String representation of the number of contracts to reduce to. Exactly one of `reduce_by` or `reduce_to` must be provided.
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
x-go-type-skip-optional-pointer: true
+
DecreaseOrderV2Response:
type: object
required:
@@ -7817,7 +7273,7 @@ components:
example:
order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
- remaining_count: '8.00'
+ remaining_count: "8.00"
ts_ms: 1715793680789
properties:
order_id:
@@ -7830,9 +7286,8 @@ components:
ts_ms:
type: integer
format: int64
- description: >-
- Matching engine timestamp at which the decrease was processed, as
- Unix epoch milliseconds.
+ description: Matching engine timestamp at which the decrease was processed, as Unix epoch milliseconds.
+
AmendOrderV2Request:
type: object
required:
@@ -7843,8 +7298,8 @@ components:
example:
ticker: HIGHNY-24JAN01-T60
side: bid
- price: '0.5700'
- count: '8.00'
+ price: "0.5700"
+ count: "8.00"
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
updated_client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
exchange_index: 0
@@ -7865,10 +7320,7 @@ components:
x-go-type-skip-optional-pointer: true
count:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Updated total/max fillable count for the order. Set this to the
- order's already filled count plus the desired resting remaining
- count after the amend.
+ description: Updated total/max fillable count for the order. Set this to the order's already filled count plus the desired resting remaining count after the amend.
x-go-type-skip-optional-pointer: true
client_order_id:
type: string
@@ -7883,6 +7335,7 @@ components:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
x-go-type-skip-optional-pointer: true
+
AmendOrderV2Response:
type: object
required:
@@ -7891,8 +7344,8 @@ components:
example:
order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
- remaining_count: '8.00'
- fill_count: '0.00'
+ remaining_count: "8.00"
+ fill_count: "0.00"
ts_ms: 1715793690123
properties:
order_id:
@@ -7903,38 +7356,27 @@ components:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
x-omitempty: false
- description: >-
- Number of resting contracts remaining after the amend. This is the
- actual post-amend resting quantity, not the request's total/max
- fillable count. Only present when the amend caused a fill or changed
- the resting size.
+ description: Number of resting contracts remaining after the amend. This is the actual post-amend resting quantity, not the request's total/max fillable count. Only present when the amend caused a fill or changed the resting size.
fill_count:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
x-omitempty: false
- description: >-
- Number of contracts filled as a result of the amend crossing the
- book. Only present when fills occurred or remaining size changed.
+ description: Number of contracts filled as a result of the amend crossing the book. Only present when fills occurred or remaining size changed.
average_fill_price:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fill price for fills resulting from the
- amend. Only present when fills occurred.
+ description: Volume-weighted average fill price for fills resulting from the amend. Only present when fills occurred.
average_fee_paid:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fee paid per contract for fills resulting
- from the amend. Only present when fills occurred.
+ description: Volume-weighted average fee paid per contract for fills resulting from the amend. Only present when fills occurred.
ts_ms:
type: integer
format: int64
- description: >-
- Matching engine timestamp at which the amend was processed, as Unix
- epoch milliseconds.
+ description: Matching engine timestamp at which the amend was processed, as Unix epoch milliseconds.
+
BatchCreateOrdersV2Request:
type: object
required:
@@ -7944,16 +7386,16 @@ components:
- ticker: HIGHNY-24JAN01-T60
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
side: bid
- count: '10.00'
- price: '0.5600'
+ count: "10.00"
+ price: "0.5600"
time_in_force: good_till_canceled
self_trade_prevention_type: taker_at_cross
exchange_index: 0
- ticker: HIGHNY-24JAN01-T60
client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
side: ask
- count: '5.00'
- price: '0.5800'
+ count: "5.00"
+ price: "0.5800"
time_in_force: immediate_or_cancel
self_trade_prevention_type: maker
exchange_index: 0
@@ -7964,6 +7406,7 @@ components:
validate: required,dive
items:
$ref: '#/components/schemas/CreateOrderV2Request'
+
BatchCreateOrdersV2Response:
type: object
required:
@@ -7972,15 +7415,15 @@ components:
orders:
- order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
- fill_count: '0.00'
- remaining_count: '10.00'
+ fill_count: "0.00"
+ remaining_count: "10.00"
ts_ms: 1715793600123
- order_id: a6d6010d-6d5f-40a1-a7e7-5501386bb621
client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
- fill_count: '5.00'
- remaining_count: '0.00'
- average_fill_price: '0.5800'
- average_fee_paid: '0.0012'
+ fill_count: "5.00"
+ remaining_count: "0.00"
+ average_fill_price: "0.5800"
+ average_fee_paid: "0.0012"
ts_ms: 1715793600456
properties:
orders:
@@ -8007,28 +7450,23 @@ components:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fill price. Only present when
- fill_count > 0.
+ description: Volume-weighted average fill price. Only present when fill_count > 0.
average_fee_paid:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fee paid per contract. Only present
- when fill_count > 0.
+ description: Volume-weighted average fee paid per contract. Only present when fill_count > 0.
ts_ms:
type: integer
format: int64
nullable: true
x-omitempty: false
- description: >-
- Matching engine timestamp at which the order was processed, as
- Unix epoch milliseconds. Absent when the request errored.
+ description: Matching engine timestamp at which the order was processed, as Unix epoch milliseconds. Absent when the request errored.
error:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
nullable: true
+
BatchCancelOrdersV2Request:
type: object
required:
@@ -8046,9 +7484,7 @@ components:
type: array
x-oapi-codegen-extra-tags:
validate: required,dive
- description: >-
- An array of orders to cancel, each optionally specifying a
- subaccount.
+ description: An array of orders to cancel, each optionally specifying a subaccount.
items:
type: object
required:
@@ -8061,22 +7497,19 @@ components:
type: integer
minimum: 0
default: 0
- description: >-
- Optional subaccount number to use for this cancellation (0 for
- primary, 1-63 for subaccounts).
+ description: Optional subaccount number to use for this cancellation (0 for primary, 1-63 for subaccounts).
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
default: 0
- description: >-
- Exchange shard index. Defaults to 0. Use -1 to auto-route by
- market ticker.
+ description: "Exchange shard index. Defaults to 0. Use -1 to auto-route by market ticker."
x-go-type-skip-optional-pointer: true
market_ticker:
type: string
description: Market ticker. Required when exchange_index is -1 (auto).
x-go-type-skip-optional-pointer: true
+
BatchCancelOrdersV2Response:
type: object
required:
@@ -8085,11 +7518,11 @@ components:
orders:
- order_id: 3b23c1c7-f4ef-4f0d-8b9a-9e53c61f1a0d
client_order_id: 8c35ecb3-328f-4f52-8c7c-0f4b9862f8d1
- reduced_by: '10.00'
+ reduced_by: "10.00"
ts_ms: 1715793660456
- order_id: a6d6010d-6d5f-40a1-a7e7-5501386bb621
client_order_id: 2a0e3fc9-b593-4aa3-96e5-82f7f7566c2a
- reduced_by: '5.00'
+ reduced_by: "5.00"
ts_ms: 1715793660789
properties:
orders:
@@ -8102,30 +7535,25 @@ components:
properties:
order_id:
type: string
- description: >-
- The order ID identifying which order this entry corresponds
- to.
+ description: The order ID identifying which order this entry corresponds to.
client_order_id:
type: string
nullable: true
reduced_by:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts that were canceled (i.e. the remaining
- count at time of cancellation). Zero if the cancel errored.
+ description: Number of contracts that were canceled (i.e. the remaining count at time of cancellation). Zero if the cancel errored.
ts_ms:
type: integer
format: int64
nullable: true
x-omitempty: false
- description: >-
- Matching engine timestamp at which the cancellation was
- processed, as Unix epoch milliseconds. Absent when the cancel
- errored.
+ description: Matching engine timestamp at which the cancellation was processed, as Unix epoch milliseconds. Absent when the cancel errored.
error:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
nullable: true
+
+ # Multivariate Event Collection schemas
AssociatedEvent:
type: object
required:
@@ -8143,21 +7571,18 @@ components:
type: integer
format: int32
nullable: true
- description: >-
- Maximum number of markets from this event (inclusive). Null means no
- limit.
+ description: Maximum number of markets from this event (inclusive). Null means no limit.
size_min:
type: integer
format: int32
nullable: true
- description: >-
- Minimum number of markets from this event (inclusive). Null means no
- limit.
+ description: Minimum number of markets from this event (inclusive). Null means no limit.
active_quoters:
type: array
items:
type: string
description: List of active quoters for this event.
+
MultivariateEventCollection:
type: object
required:
@@ -8181,9 +7606,7 @@ components:
description: Unique identifier for the collection.
series_ticker:
type: string
- description: >-
- Series associated with the collection. Events produced in the
- collection will be associated with this series.
+ description: Series associated with the collection. Events produced in the collection will be associated with this series.
title:
type: string
description: Title of the collection.
@@ -8193,15 +7616,11 @@ components:
open_date:
type: string
format: date-time
- description: >-
- The open date of the collection. Before this time, the collection
- cannot be interacted with.
+ description: The open date of the collection. Before this time, the collection cannot be interacted with.
close_date:
type: string
format: date-time
- description: >-
- The close date of the collection. After this time, the collection
- cannot be interacted with.
+ description: The close date of the collection. After this time, the collection cannot be interacted with.
associated_events:
type: array
items:
@@ -8211,44 +7630,28 @@ components:
type: array
items:
type: string
- description: >-
- [DEPRECATED - Use associated_events instead] A list of events
- associated with the collection. Markets in these events can be
- passed as inputs to the Lookup and Create endpoints.
+ description: '[DEPRECATED - Use associated_events instead] A list of events associated with the collection. Markets in these events can be passed as inputs to the Lookup and Create endpoints.'
is_ordered:
type: boolean
- description: >-
- Whether the collection is ordered. If true, the order of markets
- passed into Lookup/Create affects the output. If false, the order
- does not matter.
+ description: Whether the collection is ordered. If true, the order of markets passed into Lookup/Create affects the output. If false, the order does not matter.
is_single_market_per_event:
type: boolean
- description: >-
- [DEPRECATED - Use associated_events instead] Whether the collection
- accepts multiple markets from the same event passed into
- Lookup/Create.
+ description: '[DEPRECATED - Use associated_events instead] Whether the collection accepts multiple markets from the same event passed into Lookup/Create.'
is_all_yes:
type: boolean
- description: >-
- [DEPRECATED - Use associated_events instead] Whether the collection
- requires that only the market side of 'yes' may be used.
+ description: '[DEPRECATED - Use associated_events instead] Whether the collection requires that only the market side of ''yes'' may be used.'
size_min:
type: integer
format: int32
- description: >-
- The minimum number of markets that must be passed into Lookup/Create
- (inclusive).
+ description: The minimum number of markets that must be passed into Lookup/Create (inclusive).
size_max:
type: integer
format: int32
- description: >-
- The maximum number of markets that must be passed into Lookup/Create
- (inclusive).
+ description: The maximum number of markets that must be passed into Lookup/Create (inclusive).
functional_description:
type: string
- description: >-
- A functional description of the collection describing how inputs
- affect the output.
+ description: A functional description of the collection describing how inputs affect the output.
+
GetMultivariateEventCollectionResponse:
type: object
required:
@@ -8257,6 +7660,7 @@ components:
multivariate_contract:
$ref: '#/components/schemas/MultivariateEventCollection'
description: The multivariate event collection.
+
GetMultivariateEventCollectionsResponse:
type: object
required:
@@ -8269,13 +7673,9 @@ components:
description: List of multivariate event collections.
cursor:
type: string
- description: >-
- The Cursor represents a pointer to the next page of records in the
- pagination. Use the value returned here in the cursor query
- parameter for this end-point to get the next page containing limit
- records. An empty value of this field indicates there is no next
- page.
+ description: The Cursor represents a pointer to the next page of records in the pagination. Use the value returned here in the cursor query parameter for this end-point to get the next page containing limit records. An empty value of this field indicates there is no next page.
x-go-type-skip-optional-pointer: true
+
TickerPair:
type: object
required:
@@ -8291,12 +7691,11 @@ components:
description: Event ticker identifier.
side:
type: string
- enum:
- - 'yes'
- - 'no'
+ enum: ['yes', 'no']
description: Side of the market (yes or no).
x-oapi-codegen-extra-tags:
validate: required,oneof=yes no
+
LookupTickersForMarketInMultivariateEventCollectionRequest:
type: object
required:
@@ -8306,9 +7705,8 @@ components:
type: array
items:
$ref: '#/components/schemas/TickerPair'
- description: >-
- List of selected markets that act as parameters to determine which
- market is produced.
+ description: List of selected markets that act as parameters to determine which market is produced.
+
LookupTickersForMarketInMultivariateEventCollectionResponse:
type: object
required:
@@ -8321,39 +7719,7 @@ components:
market_ticker:
type: string
description: Market ticker for the looked up market.
- LookupPoint:
- type: object
- required:
- - event_ticker
- - market_ticker
- - selected_markets
- - last_queried_ts
- properties:
- event_ticker:
- type: string
- description: Event ticker for the lookup point.
- market_ticker:
- type: string
- description: Market ticker for the lookup point.
- selected_markets:
- type: array
- items:
- $ref: '#/components/schemas/TickerPair'
- description: Markets that were selected for this lookup.
- last_queried_ts:
- type: string
- format: date-time
- description: Timestamp when this lookup was last queried.
- GetMultivariateEventCollectionLookupHistoryResponse:
- type: object
- required:
- - lookup_points
- properties:
- lookup_points:
- type: array
- items:
- $ref: '#/components/schemas/LookupPoint'
- description: List of recent lookup points in the collection.
+
CreateMarketInMultivariateEventCollectionRequest:
type: object
required:
@@ -8363,14 +7729,13 @@ components:
type: array
items:
$ref: '#/components/schemas/TickerPair'
- description: >-
- List of selected markets that act as parameters to determine which
- market is created.
+ description: List of selected markets that act as parameters to determine which market is created.
x-oapi-codegen-extra-tags:
validate: required,dive
with_market_payload:
type: boolean
description: Whether to include the market payload in the response.
+
CreateMarketInMultivariateEventCollectionResponse:
type: object
required:
@@ -8386,20 +7751,16 @@ components:
market:
$ref: '#/components/schemas/Market'
description: Market payload of the created market.
+ # Market Orderbook schemas
PriceLevelDollarsCountFp:
type: array
minItems: 2
maxItems: 2
- example:
- - '0.1500'
- - '100.00'
+ example: ["0.1500", "100.00"]
items:
type: string
- description: >-
- Price level in dollars represented as [dollars_string, fp] where
- dollars_string is like "0.1500" and fp is a FixedPointCount string
- (fixed-point contract count). The second element is the contract
- quantity (not price).
+ description: Price level in dollars represented as [dollars_string, fp] where dollars_string is like "0.1500" and fp is a FixedPointCount string (fixed-point contract count). The second element is the contract quantity (not price).
+
OrderbookCountFp:
type: object
required:
@@ -8414,9 +7775,8 @@ components:
type: array
items:
$ref: '#/components/schemas/PriceLevelDollarsCountFp'
- description: >-
- Orderbook with fixed-point contract counts (fp) in all dollar price
- levels.
+ description: Orderbook with fixed-point contract counts (fp) in all dollar price levels.
+
GetMarketOrderbooksResponse:
type: object
required:
@@ -8426,6 +7786,7 @@ components:
type: array
items:
$ref: '#/components/schemas/MarketOrderbookFp'
+
MarketOrderbookFp:
type: object
required:
@@ -8436,6 +7797,7 @@ components:
type: string
orderbook_fp:
$ref: '#/components/schemas/OrderbookCountFp'
+
GetMarketOrderbookResponse:
type: object
required:
@@ -8444,6 +7806,7 @@ components:
orderbook_fp:
$ref: '#/components/schemas/OrderbookCountFp'
description: Orderbook with fixed-point contract counts (fp) in all price levels.
+
GetEventsResponse:
type: object
required:
@@ -8462,9 +7825,8 @@ components:
$ref: '#/components/schemas/Milestone'
cursor:
type: string
- description: >-
- Pagination cursor for the next page. Empty if there are no more
- results.
+ description: Pagination cursor for the next page. Empty if there are no more results.
+
GetMultivariateEventsResponse:
type: object
required:
@@ -8478,9 +7840,8 @@ components:
$ref: '#/components/schemas/EventData'
cursor:
type: string
- description: >-
- Pagination cursor for the next page. Empty if there are no more
- results.
+ description: Pagination cursor for the next page. Empty if there are no more results.
+
EventFeeChange:
type: object
required:
@@ -8505,21 +7866,17 @@ components:
- $ref: '#/components/schemas/FeeType'
nullable: true
example: quadratic
- description: >-
- New fee type override for the event. When null, the event clears any
- prior override and falls back to the parent series' fee structure.
+ description: New fee type override for the event. When null, the event clears any prior override and falls back to the parent series' fee structure.
fee_multiplier_override:
type: number
format: double
nullable: true
- description: >-
- New fee multiplier override for the event. When null, the event
- clears any prior override and falls back to the parent series' fee
- multiplier.
+ description: New fee multiplier override for the event. When null, the event clears any prior override and falls back to the parent series' fee multiplier.
scheduled_ts:
type: string
format: date-time
description: Timestamp when this fee change is scheduled to take effect
+
GetEventFeeChangesResponse:
type: object
required:
@@ -8532,9 +7889,8 @@ components:
$ref: '#/components/schemas/EventFeeChange'
cursor:
type: string
- description: >-
- Pagination cursor for the next page. Empty if there are no more
- results.
+ description: Pagination cursor for the next page. Empty if there are no more results.
+
GetEventResponse:
type: object
required:
@@ -8546,13 +7902,10 @@ components:
description: Data for the event.
markets:
type: array
- description: >-
- Data for the markets in this event. This field is deprecated in
- favour of the "markets" field inside the event. Which will be filled
- with the same value if you use the query parameter
- "with_nested_markets=true".
+ description: Data for the markets in this event. This field is deprecated in favour of the "markets" field inside the event. Which will be filled with the same value if you use the query parameter "with_nested_markets=true".
items:
$ref: '#/components/schemas/Market'
+
MarketMetadata:
type: object
required:
@@ -8569,6 +7922,7 @@ components:
color_code:
type: string
description: The color code for the market.
+
GetEventMetadataResponse:
type: object
required:
@@ -8604,6 +7958,7 @@ components:
x-omitempty: true
description: Event scope, based on the competition.
x-go-type-skip-optional-pointer: true
+
GetEventForecastPercentilesHistoryResponse:
type: object
required:
@@ -8614,6 +7969,7 @@ components:
description: Array of forecast percentile data points over time.
items:
$ref: '#/components/schemas/ForecastPercentilesPoint'
+
ForecastPercentilesPoint:
type: object
required:
@@ -8638,6 +7994,7 @@ components:
description: Array of forecast values at different percentiles.
items:
$ref: '#/components/schemas/PercentilePoint'
+
PercentilePoint:
type: object
required:
@@ -8659,6 +8016,7 @@ components:
formatted_forecast:
type: string
description: The human-readable formatted forecast value.
+
EventData:
type: object
required:
@@ -8685,14 +8043,10 @@ components:
description: Full title of the event.
collateral_return_type:
type: string
- description: >-
- Specifies how collateral is returned when markets settle (e.g.,
- 'binary' for standard yes/no markets).
+ description: Specifies how collateral is returned when markets settle (e.g., 'binary' for standard yes/no markets).
mutually_exclusive:
type: boolean
- description: >-
- If true, only one market in this event can resolve to 'yes'. If
- false, multiple markets can resolve to 'yes'.
+ description: If true, only one market in this event can resolve to 'yes'. If false, multiple markets can resolve to 'yes'.
category:
type: string
description: Event category (deprecated, use series-level category instead).
@@ -8703,23 +8057,16 @@ components:
format: date-time
nullable: true
x-omitempty: true
- description: >-
- The specific date this event is based on. Only filled when the event
- uses a date strike (mutually exclusive with strike_period).
+ description: The specific date this event is based on. Only filled when the event uses a date strike (mutually exclusive with strike_period).
strike_period:
type: string
nullable: true
x-omitempty: true
- description: >-
- The time period this event covers (e.g., 'week', 'month'). Only
- filled when the event uses a period strike (mutually exclusive with
- strike_date).
+ description: The time period this event covers (e.g., 'week', 'month'). Only filled when the event uses a period strike (mutually exclusive with strike_date).
markets:
type: array
x-omitempty: true
- description: >-
- Array of markets associated with this event. Only populated when
- 'with_nested_markets=true' is specified in the request.
+ description: Array of markets associated with this event. Only populated when 'with_nested_markets=true' is specified in the request.
items:
$ref: '#/components/schemas/Market'
x-go-type-skip-optional-pointer: true
@@ -8737,9 +8084,7 @@ components:
nullable: true
items:
$ref: '#/components/schemas/SettlementSource'
- description: >-
- The official sources used for the determination of markets within
- this event. Methodology is defined in the rulebook.
+ description: The official sources used for the determination of markets within this event. Methodology is defined in the rulebook.
last_updated_ts:
type: string
format: date-time
@@ -8748,21 +8093,18 @@ components:
type: string
nullable: true
x-omitempty: true
- description: >-
- Fee type override for this event. When present, takes precedence
- over the series-level fee for this event's markets.
+ description: Fee type override for this event. When present, takes precedence over the series-level fee for this event's markets.
fee_multiplier_override:
type: number
format: double
nullable: true
x-omitempty: true
- description: >-
- Fee multiplier override for this event. Paired with
- fee_type_override.
+ description: Fee multiplier override for this event. Paired with fee_type_override.
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
Series:
type: object
required:
@@ -8783,16 +8125,10 @@ components:
description: Ticker that identifies this series.
frequency:
type: string
- description: >-
- Description of the frequency of the series. There is no fixed value
- set here, but will be something human-readable like weekly, daily,
- one-off.
+ description: Description of the frequency of the series. There is no fixed value set here, but will be something human-readable like weekly, daily, one-off.
title:
type: string
- description: >-
- Title describing the series. For full context use you should use
- this field with the title field of the events belonging to this
- series.
+ description: Title describing the series. For full context use you should use this field with the title field of the events belonging to this series.
category:
type: string
description: Category specifies the category which this series belongs to.
@@ -8801,28 +8137,19 @@ components:
nullable: true
items:
type: string
- description: >-
- Tags specifies the subjects that this series relates to, multiple
- series from different categories can have the same tags.
+ description: Tags specifies the subjects that this series relates to, multiple series from different categories can have the same tags.
settlement_sources:
type: array
nullable: true
items:
$ref: '#/components/schemas/SettlementSource'
- description: >-
- SettlementSources specifies the official sources used for the
- determination of markets within the series. Methodology is defined
- in the rulebook.
+ description: SettlementSources specifies the official sources used for the determination of markets within the series. Methodology is defined in the rulebook.
contract_url:
type: string
- description: >-
- ContractUrl provides a direct link to the original filing of the
- contract which underlies the series.
+ description: ContractUrl provides a direct link to the original filing of the contract which underlies the series.
contract_terms_url:
type: string
- description: >-
- ContractTermsUrl is the URL to the current terms of the contract
- underlying the series.
+ description: ContractTermsUrl is the URL to the current terms of the contract underlying the series.
product_metadata:
type: object
nullable: true
@@ -8831,36 +8158,24 @@ components:
fee_type:
allOf:
- $ref: '#/components/schemas/FeeType'
- description: >-
- FeeType is a string representing the series' fee structure. Fee
- structures can be found at
- https://kalshi.com/docs/kalshi-fee-schedule.pdf. 'quadratic' is
- described by the General Trading Fees Table,
- 'quadratic_with_maker_fees' is described by the General Trading Fees
- Table with maker fees described in the Maker Fees section, 'flat' is
- described by the Specific Trading Fees Table.
+ description: "FeeType is a string representing the series' fee structure. Fee structures can be found at https://kalshi.com/docs/kalshi-fee-schedule.pdf. 'quadratic' is described by the General Trading Fees Table, 'quadratic_with_maker_fees' is described by the General Trading Fees Table with maker fees described in the Maker Fees section, 'flat' is described by the Specific Trading Fees Table."
fee_multiplier:
type: number
format: double
- description: >-
- FeeMultiplier is a floating point multiplier applied to the fee
- calculations.
+ description: FeeMultiplier is a floating point multiplier applied to the fee calculations.
additional_prohibitions:
type: array
items:
type: string
- description: >-
- AdditionalProhibitions is a list of additional trading prohibitions
- for this series.
+ description: AdditionalProhibitions is a list of additional trading prohibitions for this series.
volume_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the total number of contracts traded across
- all events in this series.
+ description: String representation of the total number of contracts traded across all events in this series.
last_updated_ts:
type: string
format: date-time
description: Timestamp of when this series' metadata was last updated.
+
SeriesFeeChange:
type: object
required:
@@ -8888,6 +8203,7 @@ components:
type: string
format: date-time
description: Timestamp when this fee change is scheduled to take effect
+
GetSeriesResponse:
type: object
required:
@@ -8895,6 +8211,7 @@ components:
properties:
series:
$ref: '#/components/schemas/Series'
+
GetSeriesListResponse:
type: object
required:
@@ -8904,6 +8221,7 @@ components:
type: array
items:
$ref: '#/components/schemas/Series'
+
GetSeriesFeeChangesResponse:
type: object
required:
@@ -8913,6 +8231,7 @@ components:
type: array
items:
$ref: '#/components/schemas/SeriesFeeChange'
+
SettlementSource:
type: object
properties:
@@ -8924,6 +8243,7 @@ components:
type: string
description: URL to the settlement source
x-go-type-skip-optional-pointer: true
+
GetMarketsResponse:
type: object
required:
@@ -8936,6 +8256,7 @@ components:
$ref: '#/components/schemas/Market'
cursor:
type: string
+
GetMarketResponse:
type: object
required:
@@ -8943,6 +8264,7 @@ components:
properties:
market:
$ref: '#/components/schemas/Market'
+
MveSelectedLeg:
type: object
properties:
@@ -8962,9 +8284,8 @@ components:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: true
- description: >-
- The settlement value of the YES/LONG side of the contract in
- dollars. Only filled after determination
+ description: The settlement value of the YES/LONG side of the contract in dollars. Only filled after determination
+
PriceRange:
type: object
required:
@@ -8981,6 +8302,7 @@ components:
step:
type: string
description: Price step/tick size for this range in dollars
+
Market:
type: object
required:
@@ -9013,7 +8335,6 @@ components:
- open_interest_fp
- result
- can_close_early
- - fractional_trading_enabled
- expiration_value
- rules_primary
- rules_secondary
@@ -9026,9 +8347,7 @@ components:
type: string
market_type:
type: string
- enum:
- - binary
- - scalar
+ enum: [binary, scalar]
description: Identifies the type of market
title:
type: string
@@ -9077,39 +8396,20 @@ components:
description: The amount of time after determination that the market settles
status:
type: string
- enum:
- - initialized
- - inactive
- - active
- - closed
- - determined
- - disputed
- - amended
- - finalized
+ enum: [initialized, inactive, active, closed, determined, disputed, amended, finalized]
description: The current status of the market in its lifecycle.
- response_price_units:
- type: string
- enum:
- - usd_cent
- deprecated: true
- description: 'DEPRECATED: Use price_level_structure and price_ranges instead.'
- x-go-type-skip-optional-pointer: true
yes_bid_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Price for the highest YES buy offer on this market in dollars
yes_bid_size_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Total contract size of orders to buy YES at the best bid price
- (fixed-point count string).
+ description: Total contract size of orders to buy YES at the best bid price (fixed-point count string).
yes_ask_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Price for the lowest YES sell offer on this market in dollars
yes_ask_size_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Total contract size of orders to sell YES at the best ask price
- (fixed-point count string).
+ description: Total contract size of orders to sell YES at the best ask price (fixed-point count string).
no_bid_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: Price for the highest NO buy offer on this market in dollars
@@ -9127,63 +8427,39 @@ components:
description: String representation of the 24h market volume in contracts
result:
type: string
- enum:
- - 'yes'
- - 'no'
- - scalar
- - ''
+ enum: ['yes', 'no', 'scalar', '']
can_close_early:
type: boolean
- fractional_trading_enabled:
- type: boolean
- deprecated: true
- description: >-
- Deprecated. This flag is always `true` and carries no information.
- Will be removed after a pre-announcement with the removal date.
open_interest_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the number of contracts bought on this
- market disconsidering netting
+ description: String representation of the number of contracts bought on this market disconsidering netting
notional_value_dollars:
$ref: '#/components/schemas/FixedPointDollars'
description: The total value of a single contract at settlement in dollars
previous_yes_bid_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Price for the highest YES buy offer on this market a day ago in
- dollars
+ description: Price for the highest YES buy offer on this market a day ago in dollars
previous_yes_ask_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Price for the lowest YES sell offer on this market a day ago in
- dollars
+ description: Price for the lowest YES sell offer on this market a day ago in dollars
previous_price_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Price for the last traded YES contract on this market a day ago in
- dollars
+ description: Price for the last traded YES contract on this market a day ago in dollars
liquidity_dollars:
$ref: '#/components/schemas/FixedPointDollars'
deprecated: true
- description: >-
- DEPRECATED: This field is deprecated and will always return
- "0.0000".
+ description: 'DEPRECATED: This field is deprecated and will always return "0.0000".'
settlement_value_dollars:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: true
- description: >-
- The settlement value of the YES/LONG side of the contract in
- dollars. Only filled after determination
+ description: The settlement value of the YES/LONG side of the contract in dollars. Only filled after determination
settlement_ts:
type: string
format: date-time
nullable: true
x-omitempty: true
- description: >-
- Timestamp when the market was settled. Only filled for settled
- markets
+ description: Timestamp when the market was settled. Only filled for settled markets
expiration_value:
type: string
description: The value that was considered for the settlement
@@ -9191,9 +8467,7 @@ components:
type: string
format: date-time
nullable: true
- description: >-
- The recorded datetime when the underlying event occurred, if
- available
+ description: The recorded datetime when the underlying event occurred, if available
fee_waiver_expiration_time:
type: string
format: date-time
@@ -9208,15 +8482,7 @@ components:
x-go-type-skip-optional-pointer: true
strike_type:
type: string
- enum:
- - greater
- - greater_or_equal
- - less
- - less_or_equal
- - between
- - functional
- - custom
- - structured
+ enum: [greater, greater_or_equal, less, less_or_equal, between, functional, custom, structured]
x-omitempty: true
description: Strike type defines how the market strike is defined and evaluated
x-go-type-skip-optional-pointer: true
@@ -9265,9 +8531,7 @@ components:
x-omitempty: true
price_level_structure:
type: string
- description: >-
- Price level structure for this market, defining price ranges and
- tick sizes
+ description: Price level structure for this market, defining price ranges and tick sizes
price_ranges:
type: array
description: Valid price ranges for orders on this market
@@ -9276,14 +8540,13 @@ components:
is_provisional:
type: boolean
x-omitempty: true
- description: >-
- If true, the market may be removed after determination if there is
- no activity on it
+ description: If true, the market may be removed after determination if there is no activity on it
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+
tags:
- name: api-keys
description: API key management endpoints
diff --git a/specs/perps_openapi.yaml b/specs/perps_openapi.yaml
index 6070805..814f1ca 100644
--- a/specs/perps_openapi.yaml
+++ b/specs/perps_openapi.yaml
@@ -2,14 +2,14 @@ openapi: 3.0.0
info:
title: Kalshi Trade API Manual Endpoints
version: 0.0.1
- description: >-
- Manually defined OpenAPI spec for endpoints being migrated to spec-first
- approach
+ description: Manually defined OpenAPI spec for endpoints being migrated to spec-first approach
+
servers:
- url: https://external-api.kalshi.com/trade-api/v2
description: Production perps REST API server
- url: https://external-api.demo.kalshi.co/trade-api/v2
description: Demo perps REST API server
+
paths:
/account/limits/perps:
get:
@@ -33,11 +33,12 @@ paths:
description: Unauthorized
'500':
description: Internal server error
+
/margin/exchange/status:
get:
operationId: GetMarginExchangeStatus
summary: Get Exchange Status
- description: Endpoint for getting the margin exchange status.
+ description: 'Endpoint for getting the margin exchange status.'
tags:
- exchange
responses:
@@ -65,13 +66,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ExchangeStatus'
+
/margin/risk_parameters:
get:
operationId: GetMarginRiskParameters
summary: Get Risk Parameters
- description: >-
- Returns system-wide margin risk parameters including liquidation
- thresholds and per-market initial margin multipliers.
+ description: 'Returns system-wide margin risk parameters including liquidation thresholds and per-market initial margin multipliers.'
tags:
- risk
responses:
@@ -81,11 +81,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/GetMarginRiskParametersResponse'
+
/margin/orders:
get:
operationId: GetMarginOrders
summary: Get Orders
- description: Endpoint for listing margin orders with optional filtering.
+ description: 'Endpoint for listing margin orders with optional filtering.'
tags:
- orders
security:
@@ -146,15 +147,14 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/fcm/orders:
get:
operationId: GetMarginFCMOrders
summary: Get FCM Orders
- description: >
+ description: |
Endpoint for FCM members to get margin orders filtered by subtrader ID.
-
- This endpoint requires FCM member access level and allows filtering
- margin orders by subtrader ID.
+ This endpoint requires FCM member access level and allows filtering margin orders by subtrader ID.
tags:
- fcm
security:
@@ -165,9 +165,7 @@ paths:
- name: subtrader_id
in: query
required: true
- description: >-
- Restricts the response to margin orders for a specific subtrader
- (FCM members only)
+ description: Restricts the response to margin orders for a specific subtrader (FCM members only)
schema:
type: string
- $ref: '#/components/parameters/TickerQuery'
@@ -189,6 +187,7 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/orders/{order_id}:
get:
operationId: GetMarginOrder
@@ -215,12 +214,11 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
delete:
operationId: CancelMarginOrder
summary: Cancel Order
- description: >-
- Endpoint for canceling an order. Cancels all remaining resting contracts
- and returns the canceled order details.
+ description: Endpoint for canceling an order. Cancels all remaining resting contracts and returns the canceled order details.
tags:
- orders
security:
@@ -243,14 +241,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/orders/{order_id}/decrease:
post:
operationId: DecreaseMarginOrder
summary: Decrease Order
- description: >-
- Endpoint for decreasing the number of contracts in an existing order.
- Exactly one of `reduce_by` or `reduce_to` must be provided. Canceling an
- order is equivalent to decreasing to zero.
+ description: Endpoint for decreasing the number of contracts in an existing order. Exactly one of `reduce_by` or `reduce_to` must be provided. Canceling an order is equivalent to decreasing to zero.
tags:
- orders
security:
@@ -281,22 +277,16 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/orders/{order_id}/amend:
post:
operationId: AmendMarginOrder
summary: Amend Order
- description: >-
- Endpoint for amending the price and/or max number of fillable contracts
- in an existing margin order.
+ description: Endpoint for amending the price and/or max number of fillable contracts in an existing margin order.
x-mint:
- content: >
+ content: |
-
- Amending a resting order preserves queue position only when the
- amendment decreases size. All other amendments — like increasing size
- or changing price forfeit queue position and place the order at the
- back of the queue.
-
+ Amending a resting order preserves queue position only when the amendment decreases size. All other amendments — like increasing size or changing price forfeit queue position and place the order at the back of the queue.
tags:
- orders
@@ -328,6 +318,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/markets:
get:
operationId: GetMarginMarkets
@@ -356,13 +347,12 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/markets/{ticker}:
get:
operationId: GetMarginMarket
summary: Get Market
- description: >-
- Endpoint for fetching a margin market with trading stats (price, volume,
- open interest).
+ description: Endpoint for fetching a margin market with trading stats (price, volume, open interest).
tags:
- market
parameters:
@@ -387,6 +377,7 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/markets/{ticker}/orderbook:
get:
operationId: GetMarginMarketOrderbook
@@ -411,9 +402,7 @@ paths:
default: 0
- name: aggregation_tick_size
in: query
- description: >-
- Tick size in dollars for aggregating price levels (e.g., 0.10 for 10
- cent buckets)
+ description: Tick size in dollars for aggregating price levels (e.g., 0.10 for 10 cent buckets)
required: false
schema:
type: string
@@ -432,6 +421,7 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/markets/{ticker}/candlesticks:
get:
operationId: GetMarginMarketCandlesticks
@@ -449,49 +439,34 @@ paths:
- name: start_ts
in: query
required: true
- description: >-
- Start timestamp (Unix timestamp). Candlesticks will include those
- ending on or after this time.
+ description: Start timestamp (Unix timestamp). Candlesticks will include those ending on or after this time.
schema:
type: integer
format: int64
- name: end_ts
in: query
required: true
- description: >-
- End timestamp (Unix timestamp). Candlesticks will include those
- ending on or before this time.
+ description: End timestamp (Unix timestamp). Candlesticks will include those ending on or before this time.
schema:
type: integer
format: int64
- name: period_interval
in: query
required: true
- description: >-
- Time period length of each candlestick in minutes. Valid values are
- 1 (1 minute), 60 (1 hour), or 1440 (1 day).
+ description: Time period length of each candlestick in minutes. Valid values are 1 (1 minute), 60 (1 hour), or 1440 (1 day).
schema:
type: integer
- enum:
- - 1
- - 60
- - 1440
+ enum: [1, 60, 1440]
x-oapi-codegen-extra-tags:
- validate: required,oneof=1 60 1440
+ validate: "required,oneof=1 60 1440"
- name: include_latest_before_start
in: query
required: false
- description: >
- If true, prepends the latest candlestick available before the
- start_ts. This synthetic candlestick is created by:
-
+ description: |
+ If true, prepends the latest candlestick available before the start_ts. This synthetic candlestick is created by:
1. Finding the most recent real candlestick before start_ts
-
- 2. Projecting it forward to the first period boundary (calculated as
- the next period interval after start_ts)
-
- 3. Setting all OHLC prices to null, and `price.previous` to the
- close price from the real candlestick
+ 2. Projecting it forward to the first period boundary (calculated as the next period interval after start_ts)
+ 3. Setting all OHLC prices to null, and `price.previous` to the close price from the real candlestick
schema:
type: boolean
default: false
@@ -508,6 +483,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/fills:
get:
operationId: GetMarginFills
@@ -571,11 +547,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/positions:
get:
operationId: GetMarginPositions
summary: Get Positions
- description: Endpoint for retrieving the authenticated user's margin positions.
+ description: 'Endpoint for retrieving the authenticated user''s margin positions.'
tags:
- portfolio
security:
@@ -609,14 +586,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/trades:
get:
operationId: GetMarginTrades
summary: Get Trades
- description: >-
- Endpoint for retrieving public margin trades for a given market ticker.
- Returns a paginated response. Use the cursor value from the previous
- response to get the next page.
+ description: 'Endpoint for retrieving public margin trades for a given market ticker. Returns a paginated response. Use the cursor value from the previous response to get the next page.'
tags:
- market
parameters:
@@ -668,13 +643,12 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/enabled:
get:
operationId: GetMarginEnabled
summary: Get Enabled Status
- description: >-
- Endpoint for checking if margin trading is enabled for the authenticated
- user.
+ description: Endpoint for checking if margin trading is enabled for the authenticated user.
tags:
- exchange
security:
@@ -692,13 +666,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/notional_risk_limit:
get:
operationId: GetMarginNotionalRiskLimit
summary: Get Notional Risk Limit
- description: >-
- Endpoint for retrieving the notional value risk limit for the
- authenticated margin user.
+ description: 'Endpoint for retrieving the notional value risk limit for the authenticated margin user.'
tags:
- risk
security:
@@ -716,24 +689,16 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/balance:
get:
operationId: GetMarginBalance
summary: Get Balance
- description: >-
- Endpoint for retrieving the balance breakdown for the authenticated
- direct margin user. Returns cash balance (aggregate and per-subaccount),
- position value, total balance, and maintenance margin requirement.
+ description: 'Endpoint for retrieving the balance breakdown for the authenticated direct margin user. Returns cash balance (aggregate and per-subaccount), position value, total balance, and maintenance margin requirement.'
x-mint:
- content: >
+ content: |
-
- **Rate limit:** 5 tokens per request, or 50 tokens when
- `compute_available_balance=true` (the available-balance computation
- scans all resting orders). See `GET
- /trade-api/v2/account/endpoint_costs` for current non-default endpoint
- costs.
-
+ **Rate limit:** 5 tokens per request, or 50 tokens when `compute_available_balance=true` (the available-balance computation scans all resting orders). See `GET /trade-api/v2/account/endpoint_costs` for current non-default endpoint costs.
tags:
- portfolio
@@ -749,10 +714,7 @@ paths:
type: boolean
default: false
x-go-type-skip-optional-pointer: true
- description: >-
- When true, computes available_balance per subaccount at an increased
- rate limit cost. Available balance is 0 when the flag is false or
- omitted.
+ description: 'When true, computes available_balance per subaccount at an increased rate limit cost. Available balance is 0 when the flag is false or omitted.'
responses:
'200':
description: Margin balance retrieved successfully
@@ -768,15 +730,12 @@ paths:
$ref: '#/components/responses/RateLimitError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/risk:
get:
operationId: GetMarginRisk
summary: Get Risk
- description: >-
- Endpoint for retrieving leverage and liquidation price data for the
- authenticated direct margin user. Returns account-level leverage plus
- per-position leverage and liquidation prices, grouped by subaccount and
- market.
+ description: 'Endpoint for retrieving leverage and liquidation price data for the authenticated direct margin user. Returns account-level leverage plus per-position leverage and liquidation prices, grouped by subaccount and market.'
tags:
- risk
security:
@@ -796,14 +755,12 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/fee_tiers:
get:
operationId: GetMarginFeeTiers
summary: Get Fee Tiers
- description: >-
- Endpoint for retrieving the margin fee tiers for the authenticated
- direct margin user. Returns a map of margin market tickers to their fee
- tier strings.
+ description: 'Endpoint for retrieving the margin fee tiers for the authenticated direct margin user. Returns a map of margin market tickers to their fee tier strings.'
tags:
- fees
security:
@@ -821,15 +778,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/funding_history:
get:
operationId: GetMarginFundingHistory
summary: Get Funding History
- description: >-
- Endpoint for retrieving the authenticated user's historical margin
- funding payments joined with funding rates for a specific market, or
- across all markets when ticker is empty, over an inclusive UTC date
- range.
+ description: 'Endpoint for retrieving the authenticated user''s historical margin funding payments joined with funding rates for a specific market, or across all markets when ticker is empty, over an inclusive UTC date range.'
tags:
- funding
security:
@@ -840,18 +794,14 @@ paths:
- name: ticker
in: query
required: false
- description: >-
- Market ticker for funding history. Leave empty to query across all
- markets.
+ description: Market ticker for funding history. Leave empty to query across all markets.
schema:
type: string
x-go-type-skip-optional-pointer: true
- name: start_date
in: query
required: true
- description: >-
- Inclusive UTC start date for funding history range (YYYY-MM-DD
- format)
+ description: Inclusive UTC start date for funding history range (YYYY-MM-DD format)
schema:
type: string
format: date
@@ -884,13 +834,12 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/funding_rates/historical:
get:
operationId: GetMarginHistoricalFundingRates
summary: Get Historical Funding Rates
- description: >-
- Endpoint for retrieving historical margin funding rates for a market, or
- across all markets when ticker is empty.
+ description: Endpoint for retrieving historical margin funding rates for a market, or across all markets when ticker is empty.
tags:
- funding
parameters:
@@ -904,18 +853,14 @@ paths:
- name: start_ts
in: query
required: false
- description: >-
- Start timestamp (Unix timestamp in seconds). If omitted, defaults to
- the earliest available data.
+ description: Start timestamp (Unix timestamp in seconds). If omitted, defaults to the earliest available data.
schema:
type: integer
format: int64
- name: end_ts
in: query
required: false
- description: >-
- End timestamp (Unix timestamp in seconds). If omitted, defaults to
- the current time.
+ description: End timestamp (Unix timestamp in seconds). If omitted, defaults to the current time.
schema:
type: integer
format: int64
@@ -930,16 +875,13 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/funding_rates/estimate:
get:
operationId: GetMarginFundingRateEstimate
summary: Get Funding Rate Estimate
- description: >
- Returns the estimated funding rate for the current, in-progress funding
- period. The value is a time-weighted average of the premium index
- computed over `[last_funding_time, now)`, so it continues to move as new
- data accumulates through the window and is only finalized at
- `next_funding_time`.
+ description: |
+ Returns the estimated funding rate for the current, in-progress funding period. The value is a time-weighted average of the premium index computed over `[last_funding_time, now)`, so it continues to move as new data accumulates through the window and is only finalized at `next_funding_time`.
tags:
- funding
parameters:
@@ -963,6 +905,7 @@ paths:
$ref: '#/components/responses/BadRequestError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/intra_exchange_instance_transfer:
post:
operationId: IntraExchangeInstanceTransfer
@@ -995,14 +938,12 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/margin/subaccounts:
post:
operationId: CreateMarginSubaccount
summary: Create Subaccount
- description: >-
- Creates a new subaccount for the authenticated user in the margin
- exchange. Subaccounts are numbered sequentially starting from 1. Maximum
- 63 numbered subaccounts per user (64 including the primary account).
+ description: 'Creates a new subaccount for the authenticated user in the margin exchange. Subaccounts are numbered sequentially starting from 1. Maximum 63 numbered subaccounts per user (64 including the primary account).'
tags:
- portfolio
security:
@@ -1024,13 +965,12 @@ paths:
$ref: '#/components/responses/ForbiddenError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/portfolio/margin/subaccounts/transfer:
post:
operationId: ApplyMarginSubaccountTransfer
summary: Transfer Between Subaccounts
- description: >-
- Transfers funds between the authenticated user's margin subaccounts. Use
- 0 for the primary account, or 1-63 for numbered subaccounts.
+ description: 'Transfers funds between the authenticated user''s margin subaccounts. Use 0 for the primary account, or 1-63 for numbered subaccounts.'
tags:
- portfolio
security:
@@ -1056,13 +996,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups:
get:
operationId: GetMarginOrderGroups
summary: Get Order Groups
- description: >-
- Retrieves all order groups for the authenticated user on the margin
- exchange.
+ description: 'Retrieves all order groups for the authenticated user on the margin exchange.'
tags:
- order-groups
security:
@@ -1084,14 +1023,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups/create:
post:
operationId: CreateMarginOrderGroup
summary: Create Order Group
- description: >-
- Creates a new order group on the margin exchange with a contracts limit
- measured over a rolling window. When the limit is hit, all orders in the
- group are cancelled and no new orders can be placed until reset.
+ description: 'Creates a new order group on the margin exchange with a contracts limit measured over a rolling window. When the limit is hit, all orders in the group are cancelled and no new orders can be placed until reset.'
tags:
- order-groups
security:
@@ -1117,13 +1054,12 @@ paths:
$ref: '#/components/responses/UnauthorizedError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups/{order_group_id}:
get:
operationId: GetMarginOrderGroup
summary: Get Order Group
- description: >-
- Retrieves details for a single order group on the margin exchange
- including all order IDs and auto-cancel status.
+ description: 'Retrieves details for a single order group on the margin exchange including all order IDs and auto-cancel status.'
tags:
- order-groups
security:
@@ -1149,9 +1085,7 @@ paths:
delete:
operationId: DeleteMarginOrderGroup
summary: Delete Order Group
- description: >-
- Deletes an order group on the margin exchange and cancels all orders
- within it.
+ description: 'Deletes an order group on the margin exchange and cancels all orders within it.'
tags:
- order-groups
security:
@@ -1174,14 +1108,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups/{order_group_id}/reset:
put:
operationId: ResetMarginOrderGroup
summary: Reset Order Group
- description: >-
- Resets the order group matched contracts counter to zero on the margin
- exchange, allowing new orders to be placed again after the limit was
- hit.
+ description: 'Resets the order group matched contracts counter to zero on the margin exchange, allowing new orders to be placed again after the limit was hit.'
tags:
- order-groups
security:
@@ -1210,13 +1142,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups/{order_group_id}/trigger:
put:
operationId: TriggerMarginOrderGroup
summary: Trigger Order Group
- description: >-
- Triggers the order group on the margin exchange, canceling all orders in
- the group and preventing new orders until the group is reset.
+ description: 'Triggers the order group on the margin exchange, canceling all orders in the group and preventing new orders until the group is reset.'
tags:
- order-groups
security:
@@ -1245,14 +1176,12 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
/margin/order_groups/{order_group_id}/limit:
put:
operationId: UpdateMarginOrderGroupLimit
summary: Update Order Group Limit
- description: >-
- Updates the order group contracts limit on the margin exchange. If the
- updated limit would immediately trigger the group, all orders in the
- group are canceled and the group is triggered.
+ description: 'Updates the order group contracts limit on the margin exchange. If the updated limit would immediately trigger the group, all orders in the group are canceled and the group is triggered.'
tags:
- order-groups
security:
@@ -1283,6 +1212,7 @@ paths:
$ref: '#/components/responses/NotFoundError'
'500':
$ref: '#/components/responses/InternalServerError'
+
components:
securitySchemes:
kalshiAccessKey:
@@ -1332,9 +1262,7 @@ components:
schema:
$ref: '#/components/schemas/ErrorResponse'
RateLimitError:
- description: >-
- Rate limit exceeded. The default cost is 10 tokens per request. Use GET
- /trade-api/v2/account/endpoint_costs to list non-default endpoint costs.
+ description: 'Rate limit exceeded. The default cost is 10 tokens per request. Use GET /trade-api/v2/account/endpoint_costs to list non-default endpoint costs.'
content:
application/json:
schema:
@@ -1359,17 +1287,13 @@ components:
format: uuid
description: Unique client-provided transfer ID for idempotency.
x-oapi-codegen-extra-tags:
- validate: required
+ validate: "required"
from_subaccount:
type: integer
- description: >-
- Source subaccount number (0 for primary, 1-63 for numbered
- subaccounts).
+ description: Source subaccount number (0 for primary, 1-63 for numbered subaccounts).
to_subaccount:
type: integer
- description: >-
- Destination subaccount number (0 for primary, 1-63 for numbered
- subaccounts).
+ description: Destination subaccount number (0 for primary, 1-63 for numbered subaccounts).
amount_cents:
type: integer
format: int64
@@ -1383,31 +1307,21 @@ components:
subaccount:
type: integer
minimum: 0
- description: >-
- Optional subaccount number to use for this order group (0 for
- primary, 1-63 for subaccounts)
+ description: Optional subaccount number to use for this order group (0 for primary, 1-63 for subaccounts)
default: 0
x-go-type-skip-optional-pointer: true
contracts_limit:
type: integer
format: int64
minimum: 1
- description: >-
- Specifies the maximum number of contracts that can be matched within
- this group over a rolling 15-second window. Whole contracts only.
- Provide contracts_limit or contracts_limit_fp; if both provided they
- must match.
+ description: Specifies the maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
validate: omitempty,gte=1
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the maximum number of contracts that can be
- matched within this group over a rolling 15-second window. Provide
- contracts_limit or contracts_limit_fp; if both provided they must
- match.
+ description: String representation of the maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
exchange_index:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
@@ -1425,9 +1339,7 @@ components:
subaccount:
type: integer
minimum: 0
- description: >-
- Subaccount number that owns the created order group (0 for primary,
- 1-63 for subaccounts).
+ description: Subaccount number that owns the created order group (0 for primary, 1-63 for subaccounts).
x-go-type-skip-optional-pointer: true
exchange_index:
allOf:
@@ -1441,6 +1353,7 @@ components:
subaccount_number:
type: integer
description: The sequential number assigned to this subaccount (1-63).
+ # Order Group schemas
EmptyResponse:
type: object
description: An empty response body
@@ -1461,15 +1374,11 @@ components:
description: The name of the service that generated the error
ExchangeIndex:
type: integer
- description: >-
- Identifier for an exchange shard. Defaults to 0 if unspecified. Note:
- currently only 0 supported.
+ description: "Identifier for an exchange shard. Defaults to 0 if unspecified. Note: currently only 0 supported."
example: 0
ExchangeInstance:
type: string
- enum:
- - event_contract
- - margined
+ enum: ['event_contract', 'margined']
description: The exchange instance type
BucketLimit:
type: object
@@ -1511,10 +1420,7 @@ components:
$ref: '#/components/schemas/BucketLimit'
grants:
type: array
- description: >-
- The caller's active API usage level grants across exchange lanes,
- where each grant applies to its exchange_instance and usage_tier
- reflects the effective tier for the lane reported by this endpoint.
+ description: The caller's active API usage level grants across exchange lanes, where each grant applies to its exchange_instance and usage_tier reflects the effective tier for the lane reported by this endpoint.
items:
$ref: '#/components/schemas/ApiUsageLevelGrant'
ApiUsageLevelGrant:
@@ -1533,33 +1439,19 @@ components:
type: integer
format: int64
nullable: true
- description: >-
- Unix timestamp (seconds) when the grant expires. Absent for
- permanent grants.
+ description: Unix timestamp (seconds) when the grant expires. Absent for permanent grants.
source:
type: string
- description: >-
- How the grant was created: "volume" (earned from trading volume) or
- "manual" (assigned by Kalshi).
+ description: 'How the grant was created: "volume" (earned from trading volume) or "manual" (assigned by Kalshi).'
FixedPointCount:
type: string
- description: >-
- Fixed-point contract count string (2 decimals, e.g., "10.00"; referred
- to as "fp" in field names). Requests accept 0–2 decimal places (e.g.,
- "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional
- contract values (e.g., "2.50") are supported on markets with fractional
- trading enabled; the minimum granularity is 0.01 contracts. Integer
- contract count fields are legacy and will be deprecated; when both
- integer and fp fields are provided, they must match.
- example: '10.00'
+ description: Fixed-point contract count string (2 decimals, e.g., "10.00"; referred to as "fp" in field names). Requests accept 0-2 decimal places (e.g., "10", "10.0", "10.00"); responses always emit 2 decimals. Fractional contract values (e.g., "2.50") are supported; the minimum granularity is 0.01 contracts.
+ example: "10.00"
+ # Common schemas
FixedPointDollars:
type: string
- description: >-
- US dollar amount as a fixed-point decimal string with up to 6 decimal
- places of precision. This is the maximum supported precision; valid
- quote intervals for a given market are constrained by that market's
- price level structure.
- example: '0.5600'
+ description: US dollar amount as a fixed-point decimal string with up to 6 decimal places of precision. This is the maximum supported precision; valid quote intervals for a given market are constrained by that market's price level structure.
+ example: "0.5600"
GetOrderGroupResponse:
type: object
required:
@@ -1571,9 +1463,7 @@ components:
description: Whether auto-cancel is enabled for this order group
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the current maximum contracts allowed over
- a rolling 15-second window.
+ description: String representation of the current maximum contracts allowed over a rolling 15-second window.
x-go-type-skip-optional-pointer: true
orders:
type: array
@@ -1640,9 +1530,7 @@ components:
x-go-type-skip-optional-pointer: true
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- String representation of the current maximum contracts allowed over
- a rolling 15-second window.
+ description: String representation of the current maximum contracts allowed over a rolling 15-second window.
x-go-type-skip-optional-pointer: true
is_auto_cancel_enabled:
type: boolean
@@ -1652,31 +1540,20 @@ components:
allOf:
- $ref: '#/components/schemas/ExchangeIndex'
x-go-type-skip-optional-pointer: true
+ # Market Orderbook schemas
PriceLevelDollarsCountFp:
type: array
minItems: 2
maxItems: 2
- example:
- - '0.1500'
- - '100.00'
+ example: ["0.1500", "100.00"]
items:
type: string
- description: >-
- Price level in dollars represented as [dollars_string, fp] where
- dollars_string is like "0.1500" and fp is a FixedPointCount string
- (fixed-point contract count). The second element is the contract
- quantity (not price).
+ description: Price level in dollars represented as [dollars_string, fp] where dollars_string is like "0.1500" and fp is a FixedPointCount string (fixed-point contract count). The second element is the contract quantity (not price).
SelfTradePreventionType:
type: string
- enum:
- - taker_at_cross
- - maker
- description: >
- The self-trade prevention type for orders. `taker_at_cross` cancels the
- taker order when it would trade against another order from the same
- user; execution stops and any partial fills already matched are
- executed. `maker` cancels the resting maker order and continues
- matching.
+ enum: ['taker_at_cross', 'maker']
+ description: |
+ The self-trade prevention type for orders. `taker_at_cross` cancels the taker order when it would trade against another order from the same user; execution stops and any partial fills already matched are executed. `maker` cancels the resting maker order and continues matching.
UpdateOrderGroupLimitRequest:
type: object
properties:
@@ -1684,22 +1561,14 @@ components:
type: integer
format: int64
minimum: 1
- description: >-
- New maximum number of contracts that can be matched within this
- group over a rolling 15-second window. Whole contracts only. Provide
- contracts_limit or contracts_limit_fp; if both provided they must
- match.
+ description: New maximum number of contracts that can be matched within this group over a rolling 15-second window. Whole contracts only. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
x-go-type-skip-optional-pointer: true
x-oapi-codegen-extra-tags:
validate: omitempty,gte=1
contracts_limit_fp:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the new maximum number of contracts that
- can be matched within this group over a rolling 15-second window.
- Provide contracts_limit or contracts_limit_fp; if both provided they
- must match.
+ description: String representation of the new maximum number of contracts that can be matched within this group over a rolling 15-second window. Provide contracts_limit or contracts_limit_fp; if both provided they must match.
ExchangeStatus:
type: object
required:
@@ -1708,14 +1577,11 @@ components:
properties:
exchange_active:
type: boolean
- description: >-
- False if the exchange is no longer taking any state changes at all.
- True unless under maintenance.
+ description: False if the exchange is no longer taking any state changes at all. True unless under maintenance.
trading_active:
type: boolean
- description: >-
- True if trading is currently permitted on the exchange. False
- outside exchange hours or during pauses.
+ description: True if trading is currently permitted on the exchange. False outside exchange hours or during pauses.
+
GetMarginRiskParametersResponse:
type: object
required:
@@ -1736,10 +1602,7 @@ components:
additionalProperties:
type: number
format: double
- description: >-
- Map of market ticker to initial margin multiplier. The initial
- margin requirement is the maintenance margin multiplied by this
- value.
+ description: Map of market ticker to initial margin multiplier. The initial margin requirement is the maintenance margin multiplied by this value.
CreateMarginOrderRequest:
type: object
required:
@@ -1774,10 +1637,7 @@ components:
format: int64
time_in_force:
type: string
- enum:
- - fill_or_kill
- - good_till_canceled
- - immediate_or_cancel
+ enum: ['fill_or_kill', 'good_till_canceled', 'immediate_or_cancel']
x-oapi-codegen-extra-tags:
validate: required,oneof=fill_or_kill good_till_canceled immediate_or_cancel
x-go-type-skip-optional-pointer: true
@@ -1791,28 +1651,21 @@ components:
x-go-type-skip-optional-pointer: true
cancel_order_on_pause:
type: boolean
- description: >-
- If this flag is set to true, the order will be canceled if the order
- is open and trading on the exchange is paused for any reason.
+ description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
reduce_only:
type: boolean
- description: >-
- Specifies whether the order place count should be capped by the
- member's current position. Orders with reduce_only set to true will
- be rejected unless time_in_force is immediate_or_cancel or
- fill_or_kill.
+ description: Specifies whether the order place count should be capped by the member's current position. Orders with reduce_only set to true will be rejected unless time_in_force is immediate_or_cancel or fill_or_kill.
subaccount:
type: integer
minimum: 0
default: 0
- description: >-
- The subaccount number to use for this margin order. 0 is the primary
- subaccount.
+ description: The subaccount number to use for this margin order. 0 is the primary subaccount.
x-go-type-skip-optional-pointer: true
order_group_id:
type: string
description: The order group this order is part of
x-go-type-skip-optional-pointer: true
+
CreateMarginOrderResponse:
type: object
required:
@@ -1829,19 +1682,14 @@ components:
description: Number of contracts filled immediately upon placement.
remaining_count:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts remaining after placement. For IOC orders, this
- reflects the final state after unfilled contracts are canceled.
+ description: Number of contracts remaining after placement. For IOC orders, this reflects the final state after unfilled contracts are canceled.
average_fill_price:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Volume-weighted average fill price. Only present when fill_count >
- 0.
+ description: Volume-weighted average fill price. Only present when fill_count > 0.
average_fee_paid:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Volume-weighted average fee paid per contract for fills resulting
- from this request. Only present when fill_count > 0.
+ description: Volume-weighted average fee paid per contract for fills resulting from this request. Only present when fill_count > 0.
+
GetMarginOrderResponse:
type: object
required:
@@ -1849,6 +1697,7 @@ components:
properties:
order:
$ref: '#/components/schemas/MarginOrder'
+
GetMarginOrdersResponse:
type: object
required:
@@ -1861,6 +1710,7 @@ components:
$ref: '#/components/schemas/MarginOrder'
cursor:
type: string
+
MarginOrder:
type: object
required:
@@ -1917,17 +1767,17 @@ components:
x-omitempty: false
cancel_order_on_pause:
type: boolean
- description: >-
- If this flag is set to true, the order will be canceled if the order
- is open and trading on the exchange is paused for any reason.
+ description: If this flag is set to true, the order will be canceled if the order is open and trading on the exchange is paused for any reason.
order_group_id:
type: string
description: The order group this order is part of
order_source:
$ref: '#/components/schemas/OrderSource'
- description: >-
- The source of the order. Indicates whether the order was placed by
- the user or by the system on behalf of the user.
+ description: The source of the order. Indicates whether the order was placed by the user or by the system on behalf of the user.
+ order_reason:
+ $ref: '#/components/schemas/OrderReason'
+ description: The reason for a system-generated order, when applicable.
+
CancelMarginOrderResponse:
type: object
required:
@@ -1940,24 +1790,20 @@ components:
type: string
reduced_by:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts that were canceled (i.e. the remaining count at
- time of cancellation).
+ description: Number of contracts that were canceled (i.e. the remaining count at time of cancellation).
+
DecreaseMarginOrderRequest:
type: object
properties:
reduce_by:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the number of contracts to reduce by.
- Exactly one of `reduce_by` or `reduce_to` must be provided.
+ description: String representation of the number of contracts to reduce by. Exactly one of `reduce_by` or `reduce_to` must be provided.
reduce_to:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
- description: >-
- String representation of the number of contracts to reduce to.
- Exactly one of `reduce_by` or `reduce_to` must be provided.
+ description: String representation of the number of contracts to reduce to. Exactly one of `reduce_by` or `reduce_to` must be provided.
+
DecreaseMarginOrderResponse:
type: object
required:
@@ -1971,6 +1817,7 @@ components:
remaining_count:
$ref: '#/components/schemas/FixedPointCount'
description: Number of contracts remaining after the decrease.
+
AmendMarginOrderRequest:
type: object
required:
@@ -2005,6 +1852,7 @@ components:
type: string
description: The new client-specified order ID after amendment
x-go-type-skip-optional-pointer: true
+
AmendMarginOrderResponse:
type: object
required:
@@ -2018,30 +1866,23 @@ components:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
x-omitempty: false
- description: >-
- Number of contracts remaining after the amend. Only present when the
- amend caused a fill or changed the resting size.
+ description: Number of contracts remaining after the amend. Only present when the amend caused a fill or changed the resting size.
fill_count:
$ref: '#/components/schemas/FixedPointCount'
nullable: true
x-omitempty: false
- description: >-
- Number of contracts filled as a result of the amend crossing the
- book. Only present when fills occurred or remaining size changed.
+ description: Number of contracts filled as a result of the amend crossing the book. Only present when fills occurred or remaining size changed.
average_fill_price:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fill price for fills resulting from the
- amend. Only present when fills occurred.
+ description: Volume-weighted average fill price for fills resulting from the amend. Only present when fills occurred.
average_fee_paid:
$ref: '#/components/schemas/FixedPointDollars'
nullable: true
x-omitempty: false
- description: >-
- Volume-weighted average fee paid per contract for fills resulting
- from the amend. Only present when fills occurred.
+ description: Volume-weighted average fee paid per contract for fills resulting from the amend. Only present when fills occurred.
+
MarginOrderbookCount:
type: object
required:
@@ -2050,18 +1891,15 @@ components:
properties:
bids:
type: array
- description: >-
- Bid price levels, ordered from best bid downward. Each level is
- [price, quantity].
+ description: Bid price levels, ordered from best bid downward. Each level is [price, quantity].
items:
$ref: '#/components/schemas/PriceLevelDollarsCountFp'
asks:
type: array
- description: >-
- Ask price levels, ordered from best ask upward. Each level is
- [price, quantity].
+ description: Ask price levels, ordered from best ask upward. Each level is [price, quantity].
items:
$ref: '#/components/schemas/PriceLevelDollarsCountFp'
+
MarginOrderbookResponse:
type: object
required:
@@ -2069,6 +1907,7 @@ components:
properties:
orderbook:
$ref: '#/components/schemas/MarginOrderbookCount'
+
MarginMarket:
type: object
required:
@@ -2097,9 +1936,8 @@ components:
type: number
format: double
description: >
- Leverage estimate (1 / margin_rate) evaluated at a small
- retail-sized notional position. Actual leverage may be lower for
- larger positions as the liquidation margin rate grows with size.
+ Leverage estimate (1 / margin_rate) evaluated at a small retail-sized notional position.
+ Actual leverage may be lower for larger positions as the liquidation margin rate grows with size.
Null when margin config or price data is unavailable.
leverage_estimates:
type: object
@@ -2107,10 +1945,10 @@ components:
type: number
format: double
description: >
- Leverage estimates (1 / margin_rate) keyed by notional position size
- in dollars ("1000", "10000", "100000", "1000000"). Leverage
- decreases at larger notionals as the liquidation margin rate grows
- with size. Null when margin config or price data is unavailable.
+ Leverage estimates (1 / margin_rate) keyed by notional position size in dollars
+ ("1000", "10000", "100000", "1000000"). Leverage decreases at larger notionals as
+ the liquidation margin rate grows with size.
+ Null when margin config or price data is unavailable.
price:
$ref: '#/components/schemas/FixedPointDollars'
description: Last trade price in dollars.
@@ -2131,9 +1969,7 @@ components:
description: One sided trade volume in the last 24 hours.
volume_24h_notional_value_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Total notional value of one sided trade volume in the last 24 hours
- in dollars.
+ description: Total notional value of one sided trade volume in the last 24 hours in dollars.
bid:
$ref: '#/components/schemas/FixedPointDollars'
description: Best bid price in dollars.
@@ -2149,6 +1985,7 @@ components:
reference_price:
$ref: '#/components/schemas/TickerPrice'
description: Underlying reference price, scaled per contract.
+
TickerPrice:
type: object
required:
@@ -2162,32 +1999,26 @@ components:
type: integer
format: int64
description: Source timestamp in epoch milliseconds.
+
MarginMarketStatus:
type: string
- enum:
- - inactive
- - active
- - closed
+ enum: [inactive, active, closed]
description: The status of a margin market
+
OrderSource:
type: string
- enum:
- - user
- - system
- description: >-
- The source of the order. 'user' indicates a user-placed order, 'system'
- indicates a system-generated liquidation order.
+ enum: ['user', 'system']
+ description: The source of the order. 'user' indicates a user-placed order, 'system' indicates a system-generated order.
+
+ OrderReason:
+ type: string
+ enum: ['liquidation', 'take_profit_stop_loss']
+ description: The reason for a system-generated order. Present for liquidation and TP/SL orders.
+
LastUpdateReason:
type: string
- enum:
- - ''
- - Decrease
- - Amend
- - MarginCancel
- - SelfTradeCancel
- - ExpiryCancel
- - Trade
- - PostOnlyCrossCancel
+ enum: ['', 'Decrease', 'Amend', 'MarginCancel', 'SelfTradeCancel', 'ExpiryCancel', 'Trade', 'PostOnlyCrossCancel']
+
MarginMarketResponse:
type: object
required:
@@ -2195,6 +2026,7 @@ components:
properties:
market:
$ref: '#/components/schemas/MarginMarket'
+
GetMarginMarketsResponse:
type: object
required:
@@ -2204,6 +2036,7 @@ components:
type: array
items:
$ref: '#/components/schemas/MarginMarket'
+
GetMarginFillsResponse:
type: object
required:
@@ -2216,6 +2049,7 @@ components:
$ref: '#/components/schemas/MarginFill'
cursor:
type: string
+
MarginFill:
type: object
required:
@@ -2256,19 +2090,16 @@ components:
description: Fill price in fixed-point dollars
entry_price:
type: string
- description: >-
- Position entry price used to compute incremental realized PnL for
- this fill
+ description: Position entry price used to compute incremental realized PnL for this fill
fees:
type: string
description: Fees paid on filled contracts, in dollars
realized_pnl:
type: string
- description: >-
- Incremental realized PnL contributed by this fill, in fixed-point
- dollars
+ description: Incremental realized PnL contributed by this fill, in fixed-point dollars
order_source:
$ref: '#/components/schemas/OrderSource'
+
GetMarginPositionsResponse:
type: object
required:
@@ -2278,6 +2109,7 @@ components:
type: array
items:
$ref: '#/components/schemas/MarginPosition'
+
MarginPosition:
type: object
required:
@@ -2286,22 +2118,18 @@ components:
- position
- entry_price
- unrealized_pnl
- - margin_used
- fees
+ - is_portfolio
properties:
subaccount:
type: integer
- description: >-
- The subaccount number that holds this position (0 for primary, 1-63
- for subaccounts)
+ description: The subaccount number that holds this position (0 for primary, 1-63 for subaccounts)
market_ticker:
type: string
description: Market ticker symbol
position:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Position size as a fixed-point count string (positive = long,
- negative = short)
+ description: Position size as a fixed-point count string (positive = long, negative = short)
entry_price:
$ref: '#/components/schemas/FixedPointDollars'
description: Weighted average entry price of the open position
@@ -2310,19 +2138,20 @@ components:
description: Mark-to-market unrealized PnL for the open position
margin_used:
$ref: '#/components/schemas/FixedPointDollars'
- description: Maintenance-margin-based capital usage for the open position
+ nullable: true
+ description: Maintenance-margin-based capital usage for the open position. Null when the position shares its asset class with other portfolio-margin positions in the subaccount, since margin is then computed jointly for the group and cannot be attributed to a single market.
fees:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Total fees accumulated over the lifetime of the current open
- position, resets when position is fully closed
+ description: Total fees accumulated over the lifetime of the current open position, resets when position is fully closed
roe:
type: number
format: double
nullable: true
- description: >-
- Return on equity as a percentage (unrealized_pnl / margin_used *
- 100), null when margin_used is zero
+ description: Return on equity as a percentage (unrealized_pnl / margin_used * 100). Null when margin_used is zero or not attributable to this market.
+ is_portfolio:
+ type: boolean
+ description: 'True when this position is hedged within a portfolio, so margin_used and roe cannot be attributed to it individually and are not reported.'
+
GetMarginTradesResponse:
type: object
required:
@@ -2335,6 +2164,7 @@ components:
$ref: '#/components/schemas/MarginTrade'
cursor:
type: string
+
MarginTrade:
type: object
required:
@@ -2366,10 +2196,9 @@ components:
description: Side of the taker in this trade
BookSide:
type: string
- enum:
- - bid
- - ask
+ enum: ['bid', 'ask']
description: The side of an order or trade (bid or ask)
+
MarginEnabledResponse:
type: object
required:
@@ -2378,6 +2207,7 @@ components:
enabled:
type: boolean
description: Indicates whether margin trading is enabled for the user
+
NotionalRiskLimitResponse:
type: object
required:
@@ -2386,21 +2216,16 @@ components:
properties:
default_notional_value_risk_limit:
type: string
- description: >-
- The notional value risk limit for the user as a fixed-point dollar
- string with 4 decimal places (e.g., "5000.0000")
- example: '5000.0000'
+ description: The notional value risk limit for the user as a fixed-point dollar string with 4 decimal places (e.g., "5000.0000")
+ example: "5000.0000"
notional_value_risk_limits_by_market_ticker:
type: object
additionalProperties:
type: string
- description: >-
- Map of market_ticker to notional value risk limit as a fixed-point
- dollar string with 4 decimal places (e.g., "5000.0000"). If present,
- the market-level risk limit overrides the default notional value
- risk limit.
+ description: Map of market_ticker to notional value risk limit as a fixed-point dollar string with 4 decimal places (e.g., "5000.0000"). If present, the market-level risk limit overrides the default notional value risk limit.
example:
- market-abc-123: '5000.0000'
+ "market-abc-123": "5000.0000"
+
MarginSubaccountBalance:
type: object
required:
@@ -2417,34 +2242,23 @@ components:
description: The subaccount number (0 for primary, 1-63 for subaccounts)
position_value:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Mark-to-market value of open positions for this subaccount in
- fixed-point dollars
+ description: Mark-to-market value of open positions for this subaccount in fixed-point dollars
account_equity:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Account equity for this subaccount in fixed-point dollars. 0 for
- self clearing members.
+ description: Account equity for this subaccount in fixed-point dollars. 0 for self clearing members.
maintenance_margin:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Maintenance margin requirement for this subaccount in fixed-point
- dollars
+ description: Maintenance margin requirement for this subaccount in fixed-point dollars
initial_margin:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Initial margin requirement for this subaccount in fixed-point
- dollars. 0 for self clearing members.
+ description: Initial margin requirement for this subaccount in fixed-point dollars. 0 for self clearing members.
resting_orders_margin:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Margin locked by resting orders for this subaccount in fixed-point
- dollars. 0 unless compute_available_balance is passed.
+ description: Margin locked by resting orders for this subaccount in fixed-point dollars. 0 unless compute_available_balance is passed.
available_balance:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Available balance for this subaccount in fixed-point dollars. 0 for
- institutional users or if compute_available_balance was not passed.
+ description: Available balance for this subaccount in fixed-point dollars. 0 for institutional users or if compute_available_balance was not passed.
+
GetMarginBalanceResponse:
type: object
required:
@@ -2459,6 +2273,7 @@ components:
settled_funds:
$ref: '#/components/schemas/FixedPointDollars'
description: Total settled funds across all subaccounts in fixed-point dollars
+
MarginRiskPosition:
type: object
required:
@@ -2467,6 +2282,7 @@ components:
- position
- mark_price
- position_notional
+ - is_portfolio
properties:
subaccount:
type: integer
@@ -2482,29 +2298,24 @@ components:
description: Current mark price for the market in fixed-point dollars
position_notional:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Absolute notional value of the position (|qty| * mark_price) in
- fixed-point dollars
+ description: Absolute notional value of the position (|qty| * mark_price) in fixed-point dollars
maintenance_margin_required:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Maintenance margin requirement for this position in fixed-point
- dollars. Null if margin config is missing.
+ description: Maintenance margin requirement for this position in fixed-point dollars. Null if margin config is missing.
nullable: true
position_leverage:
type: number
format: double
- description: >-
- Position leverage ratio (position_notional /
- maintenance_margin_required). Null when maintenance margin is zero
- or config is missing.
+ description: 'Position leverage ratio (position_notional / maintenance_margin_required). Null when maintenance margin is zero or config is missing.'
nullable: true
estimated_liquidation_price:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Estimated portfolio-aware liquidation price for this position within
- the subaccount. Null when no valid liquidation price exists.
+ description: 'Estimated portfolio-aware liquidation price for this position within the subaccount. Null when no valid liquidation price exists.'
nullable: true
+ is_portfolio:
+ type: boolean
+ description: 'True when this position is hedged within a portfolio, so maintenance_margin_required, position_leverage, and estimated_liquidation_price cannot be attributed to it individually and are not reported.'
+
GetMarginRiskResponse:
type: object
required:
@@ -2515,26 +2326,20 @@ components:
account_leverage:
type: number
format: double
- description: >-
- Account-level leverage (total_position_notional /
- total_maintenance_margin). Null when total maintenance margin is
- zero.
+ description: 'Account-level leverage (total_position_notional / total_maintenance_margin). Null when total maintenance margin is zero.'
nullable: true
total_position_notional:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Sum of absolute position notional values across all positions in
- fixed-point dollars
+ description: Sum of absolute position notional values across all positions in fixed-point dollars
total_maintenance_margin:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Sum of maintenance margin requirements across all positions in
- fixed-point dollars
+ description: Sum of maintenance margin requirements across all positions in fixed-point dollars
positions:
type: array
items:
$ref: '#/components/schemas/MarginRiskPosition'
description: Per-position risk breakdown grouped by subaccount and market
+
GetMarginFeeTiersResponse:
type: object
required:
@@ -2546,19 +2351,14 @@ components:
additionalProperties:
type: number
format: double
- description: >-
- A map of margin market ticker to the maker-side fee rate as a
- decimal fraction of notional (e.g. 0.0005 = 0.05% = 5 bps). Multiply
- notional by this value to compute the fee.
+ description: A map of margin market ticker to the maker-side fee rate as a decimal fraction of notional (e.g. 0.0005 = 0.05% = 5 bps). Multiply notional by this value to compute the fee.
taker_fee_rates:
type: object
additionalProperties:
type: number
format: double
- description: >-
- A map of margin market ticker to the taker-side fee rate as a
- decimal fraction of notional (e.g. 0.0012 = 0.12% = 12 bps).
- Multiply notional by this value to compute the fee.
+ description: A map of margin market ticker to the taker-side fee rate as a decimal fraction of notional (e.g. 0.0012 = 0.12% = 12 bps). Multiply notional by this value to compute the fee.
+
MarginFundingHistoryEntry:
type: object
required:
@@ -2586,9 +2386,7 @@ components:
description: Mark price at the time of funding
funding_amount:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Dollar amount of the funding payment (positive = received, negative
- = paid)
+ description: Dollar amount of the funding payment (positive = received, negative = paid)
quantity:
$ref: '#/components/schemas/FixedPointCount'
description: Position size at time of funding as a fixed-point count string
@@ -2596,6 +2394,7 @@ components:
type: integer
nullable: true
description: Subaccount number (0 for primary)
+
GetMarginFundingHistoryResponse:
type: object
required:
@@ -2606,6 +2405,7 @@ components:
items:
$ref: '#/components/schemas/MarginFundingHistoryEntry'
description: Array of historical funding payment entries
+
MarginFundingRate:
type: object
required:
@@ -2628,6 +2428,7 @@ components:
mark_price:
$ref: '#/components/schemas/FixedPointDollars'
description: Mark price at the time of funding
+
GetMarginHistoricalFundingRatesResponse:
type: object
required:
@@ -2638,6 +2439,7 @@ components:
items:
$ref: '#/components/schemas/MarginFundingRate'
description: Array of historical funding rate entries
+
GetMarginFundingRateEstimateResponse:
type: object
required:
@@ -2661,6 +2463,7 @@ components:
type: string
format: date-time
description: Timestamp of the next scheduled funding event
+
GetMarginMarketCandlesticksResponse:
type: object
required:
@@ -2675,6 +2478,7 @@ components:
description: Array of candlestick data points for the specified time range.
items:
$ref: '#/components/schemas/MarginMarketCandlestick'
+
MarginMarketCandlestick:
type: object
required:
@@ -2693,39 +2497,26 @@ components:
description: Unix timestamp for the inclusive end of the candlestick period.
bid:
$ref: '#/components/schemas/BidAskDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) data for buy offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for buy offers on the market during the candlestick period.
ask:
$ref: '#/components/schemas/BidAskDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) data for sell offers on the market
- during the candlestick period.
+ description: Open, high, low, close (OHLC) data for sell offers on the market during the candlestick period.
price:
$ref: '#/components/schemas/PriceDistributionHistorical'
- description: >-
- Open, high, low, close (OHLC) and more data for trade prices on the
- market during the candlestick period.
+ description: Open, high, low, close (OHLC) and more data for trade prices on the market during the candlestick period.
volume:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts traded on the market during the candlestick
- period.
+ description: Number of contracts traded on the market during the candlestick period.
volume_notional_value_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Notional value of contracts traded on the market during the
- candlestick period.
+ description: Notional value of contracts traded on the market during the candlestick period.
open_interest:
$ref: '#/components/schemas/FixedPointCount'
- description: >-
- Number of contracts held on the market by end of the candlestick
- period (end_period_ts).
+ description: Number of contracts held on the market by end of the candlestick period (end_period_ts).
open_interest_notional_value_dollars:
$ref: '#/components/schemas/FixedPointDollars'
- description: >-
- Notional value of contracts held on the market by end of the
- candlestick period (end_period_ts).
+ description: Notional value of contracts held on the market by end of the candlestick period (end_period_ts).
+
BidAskDistributionHistorical:
type: object
required:
@@ -2733,10 +2524,7 @@ components:
- low
- high
- close
- description: >-
- OHLC data for quoted prices on one side of the orderbook during the
- candlestick period. These values reflect bid or ask quotes, not executed
- trade prices.
+ description: OHLC data for quoted prices on one side of the orderbook during the candlestick period. These values reflect bid or ask quotes, not executed trade prices.
properties:
open:
$ref: '#/components/schemas/FixedPointDollars'
@@ -2750,6 +2538,7 @@ components:
close:
$ref: '#/components/schemas/FixedPointDollars'
description: Quoted price at the end of the candlestick period (in dollars).
+
PriceDistributionHistorical:
type: object
required:
@@ -2764,52 +2553,38 @@ components:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Price of the first trade during the candlestick period (in dollars).
- Null if no trades occurred.
+ description: Price of the first trade during the candlestick period (in dollars). Null if no trades occurred.
low:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Lowest trade price during the candlestick period (in dollars). Null
- if no trades occurred.
+ description: Lowest trade price during the candlestick period (in dollars). Null if no trades occurred.
high:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Highest trade price during the candlestick period (in dollars). Null
- if no trades occurred.
+ description: Highest trade price during the candlestick period (in dollars). Null if no trades occurred.
close:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Price of the last trade during the candlestick period (in dollars).
- Null if no trades occurred.
+ description: Price of the last trade during the candlestick period (in dollars). Null if no trades occurred.
mean:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Volume-weighted average price during the candlestick period (in
- dollars). Null if no trades occurred.
+ description: Volume-weighted average price during the candlestick period (in dollars). Null if no trades occurred.
previous:
allOf:
- $ref: '#/components/schemas/FixedPointDollars'
nullable: true
- description: >-
- Close price from the previous candlestick period (in dollars). Null
- if this is the first candlestick or no prior trade exists.
+ description: Close price from the previous candlestick period (in dollars). Null if this is the first candlestick or no prior trade exists.
+
parameters:
CursorQuery:
name: cursor
in: query
- description: >-
- Pagination cursor. Use the cursor value returned from the previous
- response to get the next page of results. Leave empty for the first
- page.
+ description: Pagination cursor. Use the cursor value returned from the previous response to get the next page of results. Leave empty for the first page.
schema:
type: string
x-go-type-skip-optional-pointer: true
@@ -2824,7 +2599,7 @@ components:
maximum: 1000
default: 100
x-oapi-codegen-extra-tags:
- validate: omitempty,min=1,max=1000
+ validate: "omitempty,min=1,max=1000"
MarginOrdersLimitQuery:
name: limit
in: query
@@ -2836,7 +2611,7 @@ components:
maximum: 10000
default: 10000
x-oapi-codegen-extra-tags:
- validate: omitempty,min=1,max=10000
+ validate: "omitempty,min=1,max=10000"
MaxTsQuery:
name: max_ts
in: query
@@ -2882,9 +2657,7 @@ components:
name: subaccount
in: query
required: false
- description: >-
- Subaccount number (0 for primary, 1-63 for subaccounts). If omitted,
- defaults to all subaccounts.
+ description: Subaccount number (0 for primary, 1-63 for subaccounts). If omitted, defaults to all subaccounts.
schema:
type: integer
minimum: 0
diff --git a/specs/perps_scm_openapi.yaml b/specs/perps_scm_openapi.yaml
index c5810e0..e6e6ae4 100644
--- a/specs/perps_scm_openapi.yaml
+++ b/specs/perps_scm_openapi.yaml
@@ -96,10 +96,12 @@ paths:
description: >-
Positions of the authenticated clearing member that meet the CFTC
large-trader reporting levels for a settlement day (17 CFR 15.03(b);
- currently 25 contracts for crypto). Members with reportable positions
- are subject to their own CFTC Part 17 large-trader reporting
- obligations; this endpoint provides the position data needed to meet
- them. Empty when no positions meet the reporting levels. See the
+ currently 25 contracts for crypto), plus exit-day positions that were
+ reportable on the prior settlement day and are now below the threshold.
+ Members with reportable positions are subject to their own CFTC Part 17
+ large-trader reporting obligations; this endpoint provides the position
+ data needed to meet them. Empty when no positions meet the reporting
+ levels and no prior-day reportable positions need exit reporting. See the
CFTC's Large Trader Reporting Program
(https://www.cftc.gov/IndustryOversight/MarketSurveillance/LargeTraderReportingProgram/index.htm)
and reporting levels at 17 CFR 15.03
@@ -409,7 +411,8 @@ components:
type: object
properties:
market_ticker: { type: string }
- position: { type: integer, description: Signed reportable contract count; positive long, negative short. }
+ position: { type: integer, description: Signed contract count; positive long, negative short. Can be below the reportable threshold when exit_day is true. }
+ exit_day: { type: boolean, description: True when this row is included because the same market was reportable on the prior settlement day but is now below the reportable threshold. }
GetObligationHistoryResponse:
type: object
required: [obligations]
diff --git a/tests/_contract_support.py b/tests/_contract_support.py
index 4ff3481..6167cd3 100644
--- a/tests/_contract_support.py
+++ b/tests/_contract_support.py
@@ -645,6 +645,7 @@ class Exclusion:
sdk_method="kalshi.resources.subaccounts.SubaccountsResource.create",
http_method="POST",
path_template="/portfolio/subaccounts",
+ request_body_schema="#/components/schemas/CreateSubaccountRequest",
),
MethodEndpointEntry(
sdk_method="kalshi.resources.subaccounts.SubaccountsResource.transfer",
@@ -652,6 +653,12 @@ class Exclusion:
path_template="/portfolio/subaccounts/transfer",
request_body_schema="#/components/schemas/ApplySubaccountTransferRequest",
),
+ MethodEndpointEntry(
+ sdk_method="kalshi.resources.subaccounts.SubaccountsResource.transfer_position",
+ http_method="POST",
+ path_template="/portfolio/subaccounts/positions/transfer",
+ request_body_schema="#/components/schemas/ApplySubaccountPositionTransferRequest",
+ ),
MethodEndpointEntry(
sdk_method="kalshi.resources.subaccounts.SubaccountsResource.list_balances",
http_method="GET",
@@ -852,11 +859,6 @@ class Exclusion:
path_template="/multivariate_event_collections/{collection_ticker}/lookup",
request_body_schema="#/components/schemas/LookupTickersForMarketInMultivariateEventCollectionRequest",
),
- MethodEndpointEntry(
- sdk_method=("kalshi.resources.multivariate.MultivariateCollectionsResource.lookup_history"),
- http_method="GET",
- path_template="/multivariate_event_collections/{collection_ticker}/lookup",
- ),
]
@@ -1181,10 +1183,6 @@ class Exclusion:
# Each entry is a spec-documented deviation; flipping it to a hard fail
# would surface as a real bug (see issue #157 stack for the v2.1.0
# ``Balance.balance_dollars`` regression that motivated this PR).
- ("kalshi.models.markets.Market", "response_price_units"): Exclusion(
- reason="spec marks DEPRECATED; superseded by price_level_structure / price_ranges",
- kind="spec_deprecated",
- ),
("kalshi.models.orders.Order", "action"): Exclusion(
reason="spec marks Deprecated; superseded by outcome_side / book_side",
kind="spec_deprecated",
diff --git a/tests/integration/test_multivariate.py b/tests/integration/test_multivariate.py
index be2d10a..bd919dc 100644
--- a/tests/integration/test_multivariate.py
+++ b/tests/integration/test_multivariate.py
@@ -13,7 +13,6 @@
from kalshi.models.common import Page
from kalshi.models.multivariate import (
CreateMarketResponse,
- LookupPoint,
LookupTickersResponse,
MultivariateEventCollection,
TickerPair,
@@ -29,7 +28,6 @@
"get",
"create_market",
"lookup_tickers",
- "lookup_history",
],
)
@@ -145,21 +143,6 @@ def test_lookup_tickers(
assert resp.event_ticker
assert resp.market_ticker
- def test_lookup_history(
- self, sync_client: KalshiClient, demo_collection_ticker: str
- ) -> None:
- try:
- points = sync_client.multivariate_collections.lookup_history(
- demo_collection_ticker,
- lookback_seconds=3600,
- )
- except KalshiNotFoundError:
- pytest.skip("Demo collection has no lookup history")
- assert isinstance(points, list)
- for point in points:
- assert isinstance(point, LookupPoint)
- assert_model_fields(point)
-
@pytest.mark.integration
class TestMultivariateAsync:
@@ -233,18 +216,3 @@ async def test_lookup_tickers(
assert isinstance(resp, LookupTickersResponse)
assert resp.event_ticker
assert resp.market_ticker
-
- async def test_lookup_history(
- self, async_client: AsyncKalshiClient, demo_collection_ticker: str
- ) -> None:
- try:
- points = await async_client.multivariate_collections.lookup_history(
- demo_collection_ticker,
- lookback_seconds=3600,
- )
- except KalshiNotFoundError:
- pytest.skip("Demo collection has no lookup history")
- assert isinstance(points, list)
- for point in points:
- assert isinstance(point, LookupPoint)
- assert_model_fields(point)
diff --git a/tests/integration/test_subaccounts.py b/tests/integration/test_subaccounts.py
index 9f92db5..4d5d86f 100644
--- a/tests/integration/test_subaccounts.py
+++ b/tests/integration/test_subaccounts.py
@@ -45,6 +45,7 @@
"list_balances",
"list_transfers",
"transfer",
+ "transfer_position",
"update_netting",
],
)
@@ -175,6 +176,44 @@ def test_transfer_rejects_invalid_amount(
amount_cents=-1,
)
+ def test_transfer_position_rejects_invalid_price(
+ self, sync_client: KalshiClient,
+ ) -> None:
+ # price_cents is bounded 0-100 at the SDK model — a 101c price rejects
+ # before any network call, independent of demo position state.
+ with pytest.raises(ValueError):
+ sync_client.subaccounts.transfer_position(
+ client_transfer_id=str(uuid.uuid4()),
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-DOES-NOT-MATTER",
+ side="yes",
+ count=1,
+ price_cents=101,
+ )
+
+ def test_transfer_position_smoke(
+ self,
+ sync_client: KalshiClient,
+ ephemeral_subaccount: int,
+ ) -> None:
+ # Moving a position requires an open position in the primary subaccount,
+ # which demo may not have. Exercise the request path and skip cleanly if
+ # the server refuses (no position, unknown market, etc.).
+ try:
+ resp = sync_client.subaccounts.transfer_position(
+ client_transfer_id=str(uuid.uuid4()),
+ from_subaccount=0,
+ to_subaccount=ephemeral_subaccount,
+ market_ticker="KXBTCD-99DEC31-B1",
+ side="yes",
+ count=1,
+ price_cents=1,
+ )
+ except KalshiError as e:
+ pytest.skip(f"demo refused position transfer (no position to move?): {e}")
+ assert resp.position_transfer_id
+
@pytest.mark.integration
@pytest.mark.integration_real_api_only
diff --git a/tests/perps/test_margin_account.py b/tests/perps/test_margin_account.py
index f4cda6b..5d2468c 100644
--- a/tests/perps/test_margin_account.py
+++ b/tests/perps/test_margin_account.py
@@ -189,6 +189,7 @@ def test_happy_signed_position_and_nullables(self, perps_client: PerpsClient) ->
"maintenance_margin_required": "33.6000",
"position_leverage": 2.5,
"estimated_liquidation_price": "0.4200",
+ "is_portfolio": False,
},
{
"subaccount": 1,
@@ -199,6 +200,7 @@ def test_happy_signed_position_and_nullables(self, perps_client: PerpsClient) ->
"maintenance_margin_required": None,
"position_leverage": None,
"estimated_liquidation_price": None,
+ "is_portfolio": True,
},
],
},
diff --git a/tests/perps/test_portfolio.py b/tests/perps/test_portfolio.py
index 117659e..619ab8a 100644
--- a/tests/perps/test_portfolio.py
+++ b/tests/perps/test_portfolio.py
@@ -8,6 +8,7 @@
import httpx
import pytest
import respx
+from pydantic import ValidationError
from kalshi.errors import (
AuthRequiredError,
@@ -34,6 +35,7 @@ def _long_position() -> dict[str, object]:
"margin_used": "50.0000",
"fees": "1.2500",
"roe": 24.68,
+ "is_portfolio": False,
}
@@ -47,6 +49,7 @@ def _short_position() -> dict[str, object]:
"margin_used": "20.0000",
"fees": "0.8000",
"roe": -27.5,
+ "is_portfolio": True,
}
@@ -117,6 +120,14 @@ def test_roe_null(self, perps_client: PerpsClient) -> None:
resp = perps_client.portfolio.positions()
assert resp.positions[0].return_on_equity is None
+ def test_position_requires_is_portfolio(self) -> None:
+ # is_portfolio is spec-required (v3.23.0); a 3.23.0 server always sends
+ # it, so omitting it is a hard error rather than a silent default.
+ payload = _long_position()
+ del payload["is_portfolio"]
+ with pytest.raises(ValidationError):
+ MarginPosition.model_validate(payload)
+
@respx.mock
def test_empty_positions(self, perps_client: PerpsClient) -> None:
respx.get(f"{BASE}/margin/positions").mock(
diff --git a/tests/test_api_keys.py b/tests/test_api_keys.py
index 07f6b99..8ad3ca7 100644
--- a/tests/test_api_keys.py
+++ b/tests/test_api_keys.py
@@ -123,6 +123,41 @@ def test_generate_request_forbids_extra(self) -> None:
name="bot", phantom="x",
)
+ # ── #463 subaccount field (spec v3.23.0) ──
+ def test_api_key_parses_subaccount(self) -> None:
+ # Response model: optional; present only for subaccount-scoped keys.
+ k = ApiKey.model_validate(
+ {"api_key_id": "k-1", "name": "bot", "scopes": ["read"], "subaccount": 5},
+ )
+ assert k.subaccount == 5
+
+ def test_api_key_subaccount_absent_is_none(self) -> None:
+ k = ApiKey.model_validate(
+ {"api_key_id": "k-1", "name": "bot", "scopes": ["read"]},
+ )
+ assert k.subaccount is None
+
+ def test_create_request_serializes_subaccount(self) -> None:
+ req = CreateApiKeyRequest(name="bot", public_key=_PUBKEY_PEM, subaccount=5)
+ body = req.model_dump(exclude_none=True, by_alias=True, mode="json")
+ assert body["subaccount"] == 5
+
+ @pytest.mark.parametrize("bad", [-1, 64, 99])
+ def test_create_request_rejects_out_of_range_subaccount(self, bad: int) -> None:
+ # Spec bounds subaccount to 0-63 (minimum/maximum); reject client-side.
+ with pytest.raises(ValidationError):
+ CreateApiKeyRequest(name="bot", public_key=_PUBKEY_PEM, subaccount=bad)
+
+ def test_generate_request_serializes_subaccount(self) -> None:
+ req = GenerateApiKeyRequest(name="bot", subaccount=0)
+ body = req.model_dump(exclude_none=True, by_alias=True, mode="json")
+ assert body["subaccount"] == 0
+
+ @pytest.mark.parametrize("bad", [-1, 64, 99])
+ def test_generate_request_rejects_out_of_range_subaccount(self, bad: int) -> None:
+ with pytest.raises(ValidationError):
+ GenerateApiKeyRequest(name="bot", subaccount=bad)
+
class TestApiKeysList:
@respx.mock
@@ -206,6 +241,16 @@ def test_create_with_scopes(self, api_keys: ApiKeysResource) -> None:
body = json.loads(route.calls[0].request.content)
assert body["scopes"] == ["read", "write"]
+ @respx.mock
+ def test_create_with_subaccount(self, api_keys: ApiKeysResource) -> None:
+ # #463 (v3.23.0): subaccount kwarg threads into the request body.
+ route = respx.post("https://test.kalshi.com/trade-api/v2/api_keys").mock(
+ return_value=httpx.Response(201, json={"api_key_id": "k-new"}),
+ )
+ api_keys.create(name="bot", public_key=_PUBKEY_PEM, subaccount=5)
+ body = json.loads(route.calls[0].request.content)
+ assert body["subaccount"] == 5
+
@respx.mock
def test_create_400_maps(self, api_keys: ApiKeysResource) -> None:
respx.post("https://test.kalshi.com/trade-api/v2/api_keys").mock(
@@ -239,6 +284,20 @@ def test_generate_returns_private_key(
body = json.loads(route.calls[0].request.content)
assert body == {"name": "bot"}
+ @respx.mock
+ def test_generate_with_subaccount(self, api_keys: ApiKeysResource) -> None:
+ # #463 (v3.23.0): subaccount kwarg threads into the request body.
+ route = respx.post(
+ "https://test.kalshi.com/trade-api/v2/api_keys/generate",
+ ).mock(
+ return_value=httpx.Response(
+ 201, json={"api_key_id": "k-auto", "private_key": "-----BEGIN..."}
+ ),
+ )
+ api_keys.generate(name="bot", subaccount=0)
+ body = json.loads(route.calls[0].request.content)
+ assert body["subaccount"] == 0
+
def test_generate_requires_auth(
self, unauth_api_keys: ApiKeysResource,
) -> None:
diff --git a/tests/test_contracts.py b/tests/test_contracts.py
index 8025774..de20584 100644
--- a/tests/test_contracts.py
+++ b/tests/test_contracts.py
@@ -1226,6 +1226,12 @@ def _assert_params_match(
"#/components/schemas/ApplySubaccountTransferRequest": (
"kalshi.models.subaccounts.ApplySubaccountTransferRequest"
),
+ "#/components/schemas/ApplySubaccountPositionTransferRequest": (
+ "kalshi.models.subaccounts.ApplySubaccountPositionTransferRequest"
+ ),
+ "#/components/schemas/CreateSubaccountRequest": (
+ "kalshi.models.subaccounts.CreateSubaccountRequest"
+ ),
"#/components/schemas/UpdateSubaccountNettingRequest": (
"kalshi.models.subaccounts.UpdateSubaccountNettingRequest"
),
diff --git a/tests/test_multivariate.py b/tests/test_multivariate.py
index da2bf8f..3188f35 100644
--- a/tests/test_multivariate.py
+++ b/tests/test_multivariate.py
@@ -174,45 +174,7 @@ def test_lookup_tickers_raises_on_204_spec_drift(
mv.lookup_tickers("MVC-1", selected_markets=[])
-class TestMultivariateLookupHistory:
- @respx.mock
- def test_lookup_history(self, mv: MultivariateCollectionsResource) -> None:
- respx.get(f"{BASE}/multivariate_event_collections/MVC-1/lookup").mock(
- return_value=httpx.Response(
- 200,
- json={
- "lookup_points": [
- {
- "event_ticker": "EVT-1",
- "market_ticker": "MKT-1",
- "selected_markets": [],
- "last_queried_ts": "2026-04-16T10:00:00Z",
- }
- ]
- },
- )
- )
- result = mv.lookup_history("MVC-1", lookback_seconds=60)
- assert len(result) == 1
- assert result[0].event_ticker == "EVT-1"
-
- @pytest.mark.parametrize("bad", [0, 1, 30, 600, 3601, -10])
- def test_lookup_history_rejects_off_enum_lookback(
- self, mv: MultivariateCollectionsResource, bad: int
- ) -> None:
- with pytest.raises(ValueError, match=r"lookback_seconds must be one of"):
- mv.lookup_history("MVC-1", lookback_seconds=bad)
-
- def test_lookup_history_emits_deprecation_warning(
- self, mv: MultivariateCollectionsResource
- ) -> None:
- with respx.mock(base_url=BASE) as router:
- router.get("/multivariate_event_collections/MVC-1/lookup").mock(
- return_value=httpx.Response(200, json={"lookup_points": []})
- )
- with pytest.warns(DeprecationWarning, match=r"predates RFQs"):
- mv.lookup_history("MVC-1", lookback_seconds=10)
-
+class TestMultivariateDeprecationWarnings:
def test_lookup_tickers_emits_deprecation_warning(
self, mv: MultivariateCollectionsResource
) -> None:
@@ -325,15 +287,6 @@ async def test_lookup_tickers_raises_on_204_spec_drift(
with pytest.raises(RuntimeError, match="spec drift"):
await async_mv.lookup_tickers("MVC-1", selected_markets=[])
- @respx.mock
- @pytest.mark.asyncio
- async def test_lookup_history(self, async_mv: AsyncMultivariateCollectionsResource) -> None:
- respx.get(f"{BASE}/multivariate_event_collections/MVC-1/lookup").mock(
- return_value=httpx.Response(200, json={"lookup_points": []})
- )
- result = await async_mv.lookup_history("MVC-1", lookback_seconds=300)
- assert result == []
-
class TestCreateMarketWireShape:
"""v0.8.0: create_market() builds CreateMarketInMultivariateEventCollectionRequest
diff --git a/tests/test_multivariate_models.py b/tests/test_multivariate_models.py
index be0b1da..9c90a28 100644
--- a/tests/test_multivariate_models.py
+++ b/tests/test_multivariate_models.py
@@ -4,7 +4,6 @@
from kalshi.models.multivariate import (
CreateMarketResponse,
- LookupPoint,
LookupTickersResponse,
MultivariateEventCollection,
TickerPair,
@@ -127,21 +126,3 @@ def test_parse(self) -> None:
}
)
assert r.event_ticker == "EVT-1"
-
-
-class TestLookupPointModel:
- def test_parse_with_selected_markets(self) -> None:
- lp = LookupPoint.model_validate(
- {
- "event_ticker": "EVT-1",
- "market_ticker": "MKT-1",
- "selected_markets": [
- {"market_ticker": "M-A", "event_ticker": "E-A", "side": "yes"},
- {"market_ticker": "M-B", "event_ticker": "E-B", "side": "no"},
- ],
- "last_queried_ts": "2026-04-16T10:00:00Z",
- }
- )
- assert len(lp.selected_markets) == 2
- assert lp.selected_markets[0].side == "yes"
- assert lp.last_queried_ts is not None
diff --git a/tests/test_subaccounts.py b/tests/test_subaccounts.py
index a5b6f96..3a705b3 100644
--- a/tests/test_subaccounts.py
+++ b/tests/test_subaccounts.py
@@ -21,7 +21,10 @@
KalshiValidationError,
)
from kalshi.models.subaccounts import (
+ ApplySubaccountPositionTransferRequest,
+ ApplySubaccountPositionTransferResponse,
ApplySubaccountTransferRequest,
+ CreateSubaccountRequest,
CreateSubaccountResponse,
GetSubaccountBalancesResponse,
GetSubaccountNettingResponse,
@@ -96,10 +99,57 @@ def test_subaccount_transfer_parses(self) -> None:
"to_subaccount": 1,
"amount_cents": 500,
"created_ts": 1_700_000_000,
+ "exchange_index": 0,
+ "transfer_type": "cash",
}
)
assert t.transfer_id == "xfer-1"
assert t.amount_cents == 500
+ assert t.exchange_index == 0
+ assert t.transfer_type == "cash"
+ # Position-only fields are absent on a cash transfer.
+ assert t.market_ticker is None
+ assert t.side is None
+
+ def test_subaccount_position_transfer_parses(self) -> None:
+ # v3.23.0: position transfers carry market_ticker/side/count/price_cents.
+ t = SubaccountTransfer.model_validate(
+ {
+ "transfer_id": "xfer-2",
+ "from_subaccount": 1,
+ "to_subaccount": 2,
+ "amount_cents": 0,
+ "created_ts": 1_700_000_100,
+ "exchange_index": 0,
+ "transfer_type": "position",
+ "market_ticker": "MKT-1",
+ "side": "yes",
+ "count": 10,
+ "price_cents": 55,
+ }
+ )
+ assert t.transfer_type == "position"
+ assert t.market_ticker == "MKT-1"
+ assert t.side == "yes"
+ assert t.count == 10
+ assert t.price_cents == 55
+
+ def test_subaccount_transfer_requires_v3_23_fields(self) -> None:
+ # exchange_index and transfer_type are spec-required (v3.23.0). A
+ # 3.23.0 server always sends them; omitting them is a hard error rather
+ # than silently defaulting — matches the drift suite's spec-required =>
+ # SDK-required enforcement.
+ with pytest.raises(ValidationError):
+ SubaccountTransfer.model_validate(
+ {
+ "transfer_id": "xfer-3",
+ "from_subaccount": 0,
+ "to_subaccount": 1,
+ "amount_cents": 100,
+ "created_ts": 1_700_000_200,
+ # exchange_index + transfer_type intentionally omitted
+ }
+ )
def test_subaccount_netting_config_parses(self) -> None:
cfg = SubaccountNettingConfig.model_validate(
@@ -218,6 +268,94 @@ def test_update_netting_request_forbids_extra(self) -> None:
subaccount_number=0, enabled=True, phantom=1,
)
+ # ── #465 CreateSubaccountRequest (v3.23.0) ──
+ def test_create_request_empty_serializes_to_empty_dict(self) -> None:
+ assert CreateSubaccountRequest().model_dump(exclude_none=True) == {}
+
+ def test_create_request_with_exchange_index(self) -> None:
+ body = CreateSubaccountRequest(exchange_index=0).model_dump(exclude_none=True)
+ assert body == {"exchange_index": 0}
+
+ def test_create_request_forbids_extra(self) -> None:
+ with pytest.raises(ValidationError):
+ CreateSubaccountRequest(phantom=1) # type: ignore[call-arg]
+
+ def test_create_request_rejects_negative_exchange_index(self) -> None:
+ with pytest.raises(ValidationError):
+ CreateSubaccountRequest(exchange_index=-1)
+
+ # ── #464 ApplySubaccountPositionTransferRequest (v3.23.0) ──
+ def test_position_transfer_request_serializes(self) -> None:
+ req = ApplySubaccountPositionTransferRequest(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=5,
+ price_cents=50,
+ )
+ body = req.model_dump(exclude_none=True, by_alias=True, mode="json")
+ assert body == {
+ "client_transfer_id": _TEST_XFER_ID,
+ "from_subaccount": 0,
+ "to_subaccount": 1,
+ "market_ticker": "MKT-1",
+ "side": "yes",
+ "count": 5,
+ "price_cents": 50,
+ }
+
+ def test_position_transfer_request_forbids_extra(self) -> None:
+ with pytest.raises(ValidationError):
+ ApplySubaccountPositionTransferRequest( # type: ignore[call-arg]
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=5,
+ price_cents=50,
+ phantom=1,
+ )
+
+ def test_position_transfer_request_rejects_bad_side(self) -> None:
+ with pytest.raises(ValidationError):
+ ApplySubaccountPositionTransferRequest(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="maybe", # type: ignore[arg-type]
+ count=5,
+ price_cents=50,
+ )
+
+ def test_position_transfer_request_rejects_zero_count(self) -> None:
+ with pytest.raises(ValidationError):
+ ApplySubaccountPositionTransferRequest(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=0,
+ price_cents=50,
+ )
+
+ @pytest.mark.parametrize("bad_price", [-1, 101])
+ def test_position_transfer_request_rejects_price_out_of_range(self, bad_price: int) -> None:
+ with pytest.raises(ValidationError):
+ ApplySubaccountPositionTransferRequest(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=5,
+ price_cents=bad_price,
+ )
+
class TestSubaccountsCreate:
@respx.mock
@@ -236,6 +374,18 @@ def test_create_sends_empty_json_body(
assert route.called
assert route.calls[0].request.content == b"{}"
+ @respx.mock
+ def test_create_with_exchange_index_sends_body(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ # #465 (v3.23.0): create() now serializes an optional CreateSubaccountRequest.
+ route = respx.post(
+ "https://test.kalshi.com/trade-api/v2/portfolio/subaccounts",
+ ).mock(return_value=httpx.Response(201, json={"subaccount_number": 6}))
+ resp = subaccounts.create(exchange_index=0)
+ assert resp.subaccount_number == 6
+ assert json.loads(route.calls[0].request.content) == {"exchange_index": 0}
+
@respx.mock
def test_create_500_raises(self, subaccounts: SubaccountsResource) -> None:
respx.post(
@@ -245,6 +395,109 @@ def test_create_500_raises(self, subaccounts: SubaccountsResource) -> None:
subaccounts.create()
+class TestSubaccountsTransferPosition:
+ @respx.mock
+ def test_transfer_position_sends_body_and_returns_id(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ route = respx.post(
+ "https://test.kalshi.com/trade-api/v2/portfolio/subaccounts/positions/transfer",
+ ).mock(return_value=httpx.Response(200, json={"position_transfer_id": "pt-1"}))
+ resp = subaccounts.transfer_position(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=10,
+ price_cents=55,
+ )
+ assert isinstance(resp, ApplySubaccountPositionTransferResponse)
+ assert resp.position_transfer_id == "pt-1"
+ assert json.loads(route.calls[0].request.content) == {
+ "client_transfer_id": _TEST_XFER_ID,
+ "from_subaccount": 0,
+ "to_subaccount": 1,
+ "market_ticker": "MKT-1",
+ "side": "yes",
+ "count": 10,
+ "price_cents": 55,
+ }
+
+ @respx.mock
+ def test_transfer_position_with_request_model(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ route = respx.post(
+ "https://test.kalshi.com/trade-api/v2/portfolio/subaccounts/positions/transfer",
+ ).mock(return_value=httpx.Response(200, json={"position_transfer_id": "pt-2"}))
+ req = ApplySubaccountPositionTransferRequest(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=1,
+ to_subaccount=2,
+ market_ticker="MKT-2",
+ side="no",
+ count=3,
+ price_cents=0,
+ )
+ resp = subaccounts.transfer_position(request=req)
+ assert resp.position_transfer_id == "pt-2"
+ assert route.called
+
+ def test_transfer_position_requires_args(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ with pytest.raises(TypeError, match="transfer_position"):
+ subaccounts.transfer_position(from_subaccount=0)
+
+ def test_transfer_position_rejects_malformed_uuid(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ with pytest.raises(ValueError):
+ subaccounts.transfer_position(
+ client_transfer_id="not-a-uuid",
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=1,
+ price_cents=1,
+ )
+
+ @respx.mock
+ def test_transfer_position_400_maps(
+ self, subaccounts: SubaccountsResource,
+ ) -> None:
+ respx.post(
+ "https://test.kalshi.com/trade-api/v2/portfolio/subaccounts/positions/transfer",
+ ).mock(return_value=httpx.Response(400, json={"message": "bad"}))
+ with pytest.raises(KalshiValidationError):
+ subaccounts.transfer_position(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=1,
+ price_cents=1,
+ )
+
+ def test_transfer_position_unauthenticated_raises_before_http(
+ self, config: KalshiConfig,
+ ) -> None:
+ client = SubaccountsResource(SyncTransport(None, config))
+ with pytest.raises(AuthRequiredError):
+ client.transfer_position(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="yes",
+ count=1,
+ price_cents=1,
+ )
+
+
class TestSubaccountsTransfer:
@respx.mock
def test_transfer_sends_body(self, subaccounts: SubaccountsResource) -> None:
@@ -352,6 +605,8 @@ def test_returns_paginated_transfers(
"to_subaccount": 1,
"amount_cents": 100,
"created_ts": 1,
+ "exchange_index": 0,
+ "transfer_type": "cash",
},
],
"cursor": "next",
@@ -380,6 +635,8 @@ def test_list_all_auto_paginates(
"to_subaccount": 1,
"amount_cents": 100,
"created_ts": 1,
+ "exchange_index": 0,
+ "transfer_type": "cash",
},
],
"cursor": "p2",
@@ -395,6 +652,8 @@ def test_list_all_auto_paginates(
"to_subaccount": 0,
"amount_cents": 50,
"created_ts": 2,
+ "exchange_index": 0,
+ "transfer_type": "cash",
},
],
},
@@ -490,6 +749,29 @@ async def test_transfer(
body = json.loads(route.calls[0].request.content)
assert body["amount_cents"] == 42
+ async def test_transfer_position(
+ self,
+ async_subaccounts: AsyncSubaccountsResource,
+ respx_mock: respx.MockRouter,
+ ) -> None:
+ route = respx_mock.post(
+ "https://test.kalshi.com/trade-api/v2/portfolio/subaccounts/positions/transfer",
+ ).mock(return_value=httpx.Response(200, json={"position_transfer_id": "pt-async"}))
+ resp = await async_subaccounts.transfer_position(
+ client_transfer_id=_TEST_XFER_ID,
+ from_subaccount=0,
+ to_subaccount=1,
+ market_ticker="MKT-1",
+ side="no",
+ count=4,
+ price_cents=25,
+ )
+ assert isinstance(resp, ApplySubaccountPositionTransferResponse)
+ assert resp.position_transfer_id == "pt-async"
+ body = json.loads(route.calls[0].request.content)
+ assert body["side"] == "no"
+ assert body["price_cents"] == 25
+
async def test_list_balances(
self,
async_subaccounts: AsyncSubaccountsResource,
@@ -545,6 +827,8 @@ async def test_list_all_transfers(
"to_subaccount": 1,
"amount_cents": 100,
"created_ts": 1,
+ "exchange_index": 0,
+ "transfer_type": "cash",
},
],
"cursor": "p2",
diff --git a/tests/ws/test_models.py b/tests/ws/test_models.py
index 42ee73a..18b12d5 100644
--- a/tests/ws/test_models.py
+++ b/tests/ws/test_models.py
@@ -974,6 +974,37 @@ def test_market_lifecycle_metadata_strike_structure_subtitle(self) -> None:
assert msg.msg.price_level_structure == "linear_cent"
assert msg.msg.yes_sub_title == "Will it happen?"
+ def test_market_lifecycle_price_ranges(self) -> None:
+ # #463 (v3.23.0): price_ranges rides created / price_level_structure_updated
+ # events alongside price_level_structure. Each band is {start, end, step}.
+ bands = [
+ {"start": "0.0100", "end": "0.9900", "step": "0.0100"},
+ {"start": "0.9900", "end": "1.0000", "step": "0.0001"},
+ ]
+ msg = MarketLifecycleMessage.model_validate(
+ {
+ "type": "market_lifecycle_v2",
+ "sid": 1,
+ "msg": {
+ "event_type": "price_level_structure_updated",
+ "market_ticker": "T",
+ "price_level_structure": "linear_cent",
+ "price_ranges": bands,
+ },
+ }
+ )
+ assert msg.msg.price_ranges == bands
+
+ def test_market_lifecycle_price_ranges_absent_is_none(self) -> None:
+ msg = MarketLifecycleMessage.model_validate(
+ {
+ "type": "market_lifecycle_v2",
+ "sid": 1,
+ "msg": {"event_type": "activated", "market_ticker": "T"},
+ }
+ )
+ assert msg.msg.price_ranges is None
+
def test_order_group_ts_ms(self) -> None:
msg = OrderGroupMessage.model_validate(
{