From 05f62062091e089c7bfef5c415f5d5a58bc1dd0d Mon Sep 17 00:00:00 2001 From: AbhilashG12 Date: Mon, 22 Jun 2026 18:35:15 +0530 Subject: [PATCH 1/2] fix(kalshi): sync Trade schema with v2 API drift (#1187) --- core/specs/kalshi/Kalshi.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/specs/kalshi/Kalshi.yaml b/core/specs/kalshi/Kalshi.yaml index 08ea6dbb..d08823bb 100644 --- a/core/specs/kalshi/Kalshi.yaml +++ b/core/specs/kalshi/Kalshi.yaml @@ -4711,7 +4711,6 @@ components: - no_price - yes_price_dollars - no_price_dollars - - taker_side properties: trade_id: type: string @@ -4744,7 +4743,19 @@ components: type: string enum: ['yes', 'no'] x-enum-varnames: ['TradeTakerSideYes', 'TradeTakerSideNo'] - description: Side for the taker of this trade + deprecated: true + description: Deprecated (removal deadline May 14, 2026). Use taker_outcome_side and taker_book_side instead. + taker_outcome_side: + type: string + enum: ['yes', 'no'] + description: '"yes" or "no" — which side of the outcome the taker is on' + taker_book_side: + type: string + enum: ['bid', 'ask'] + description: '"bid" or "ask" — taker''s side of the order book' + is_block_trade: + type: boolean + description: Whether this was a block trade created_time: type: string format: date-time From 7889a9050e5b8ce014e30e05b806e41d23efb18b Mon Sep 17 00:00:00 2001 From: AbhilashG12 Date: Mon, 22 Jun 2026 20:47:28 +0530 Subject: [PATCH 2/2] fix(kalshi): update fetcher interfaces and normalizer to support v2 trade/fill directions --- core/src/exchanges/kalshi/fetcher.ts | 18 +++++++++++++++--- core/src/exchanges/kalshi/normalizer.ts | 5 +++-- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/core/src/exchanges/kalshi/fetcher.ts b/core/src/exchanges/kalshi/fetcher.ts index f4d7722b..a089effc 100644 --- a/core/src/exchanges/kalshi/fetcher.ts +++ b/core/src/exchanges/kalshi/fetcher.ts @@ -108,7 +108,6 @@ export interface KalshiRawOrderBook { export interface KalshiRawOrderBooks { orderbooks: KalshiRawOrderBook[]; } - export interface KalshiRawTrade { trade_id: string; created_time: string; @@ -120,7 +119,13 @@ export interface KalshiRawTrade { count?: number; /** New API field: count as a string e.g. "424.00" */ count_fp?: string; - taker_side: string; + + /** @deprecated removal deadline May 14, 2026 */ + taker_side?: string; + /** New v2 directional fields */ + taker_outcome_side?: string; + taker_book_side?: string; + is_block_trade?: boolean; [key: string]: unknown; } @@ -134,9 +139,16 @@ export interface KalshiRawFill { /** @deprecated Old API field */ count?: number; count_fp?: string; - side: string; order_id: string; + /** @deprecated removal deadline May 14, 2026 */ + side?: string; + /** @deprecated removal deadline May 14, 2026 */ + action?: string; + /** New v2 directional fields */ + outcome_side?: string; + book_side?: string; + [key: string]: unknown; } diff --git a/core/src/exchanges/kalshi/normalizer.ts b/core/src/exchanges/kalshi/normalizer.ts index 0b5b288e..4b8fd76b 100644 --- a/core/src/exchanges/kalshi/normalizer.ts +++ b/core/src/exchanges/kalshi/normalizer.ts @@ -280,7 +280,8 @@ export class KalshiNormalizer implements IExchangeNormalizer