From 416d109080b40e17338429345f6b87d182487453 Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Sun, 24 May 2026 17:52:24 +0300 Subject: [PATCH] fix: sync Kalshi spec with upstream API changes Fixes #542 Fixes #517 Fixes #522 Fixes #433 --- core/specs/kalshi/Kalshi.yaml | 18 +++++++++++++++--- core/src/exchanges/kalshi/api.ts | 14 ++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/core/specs/kalshi/Kalshi.yaml b/core/specs/kalshi/Kalshi.yaml index f9735c23..36086514 100644 --- a/core/specs/kalshi/Kalshi.yaml +++ b/core/specs/kalshi/Kalshi.yaml @@ -863,6 +863,13 @@ paths: - kalshiAccessKey: [] kalshiAccessSignature: [] kalshiAccessTimestamp: [] + parameters: + - name: subaccount + in: query + required: false + schema: + type: integer + description: Subaccount number (0 for primary, 1-32 for subaccounts). When provided, returns only that subaccount's balance. responses: '200': description: Balance retrieved successfully @@ -4088,6 +4095,10 @@ components: type: integer format: int64 description: Unix timestamp of the last update to the balance. + balance_dollars: + type: number + format: double + description: Member's available balance in USD dollars. CreateSubaccountResponse: type: object @@ -4417,6 +4428,10 @@ components: nullable: true x-omitempty: true description: Subaccount number (0 for primary, 1-32 for subaccounts). Present for direct users. + ts_ms: + type: integer + format: int64 + description: Order timestamp in milliseconds (Unix epoch). Milestone: type: object @@ -4852,9 +4867,6 @@ components: order_id: type: string description: Unique identifier for the order that resulted in this fill - client_order_id: - type: string - description: Client-provided identifier for the order that resulted in this fill ticker: type: string description: Unique identifier for the market diff --git a/core/src/exchanges/kalshi/api.ts b/core/src/exchanges/kalshi/api.ts index ba9b1a9b..4687bd60 100644 --- a/core/src/exchanges/kalshi/api.ts +++ b/core/src/exchanges/kalshi/api.ts @@ -1,6 +1,6 @@ /** - * Auto-generated from /home/zihao/pmxt/core/specs/kalshi/Kalshi.yaml - * Generated at: 2026-05-10T23:00:51.402Z + * Auto-generated from /Users/samueltinnerholm/Documents/GitHub/pmxt/.claude/worktrees/agent-a6e1b73d/core/specs/kalshi/Kalshi.yaml + * Generated at: 2026-05-24T14:48:08.117Z * Do not edit manually -- run "npm run fetch:openapi" to regenerate. */ export const kalshiApiSpec = { @@ -644,6 +644,16 @@ export const kalshiApiSpec = { "kalshiAccessSignature": [], "kalshiAccessTimestamp": [] } + ], + "parameters": [ + { + "name": "subaccount", + "in": "query", + "required": false, + "schema": { + "type": "integer" + } + } ] } },