From a21f64e0665e41d35213fe1b00b0ef07876af872 Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 14 Jul 2026 13:16:52 +0200 Subject: [PATCH] malkhut(wire): BingX adapter uses standardized OrderType mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit adapter.py now uses normalize_to_exchange(action.order_type, 'bingx') to translate normalized order types to BingX-native strings. Falls back to LIMIT/MARKET/POST_ONLY for backward compatibility. This is the critical integration point: standardized order types flow from FulfilmentAction → CWM → VenueAdapter → exchange API. --- MALKHUT/malkhut/venue/bingx/adapter.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MALKHUT/malkhut/venue/bingx/adapter.py b/MALKHUT/malkhut/venue/bingx/adapter.py index cdc1c07..64da81b 100644 --- a/MALKHUT/malkhut/venue/bingx/adapter.py +++ b/MALKHUT/malkhut/venue/bingx/adapter.py @@ -177,12 +177,16 @@ class BingXVenueAdapter: self._order_seq += 1 client_id = f"m_{state.ts_ns}_{self._order_seq}" - # Determine order type - order_type = "LIMIT" - if action.kind.value == "CROSS_SPREAD": + # Determine order type — use standardized OrderType, map to BingX-native + from malkhut.training.order_types import normalize_to_exchange + if action.order_type is not None: + order_type = normalize_to_exchange(action.order_type.value, "bingx") or "LIMIT" + elif action.kind.value == "CROSS_SPREAD": order_type = "MARKET" elif action.post_only: order_type = "POST_ONLY" + else: + order_type = "LIMIT" # Build order order = {