malkhut(wire): BingX adapter uses standardized OrderType mapping

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.
This commit is contained in:
Codex
2026-07-14 13:16:52 +02:00
parent f48af7c405
commit a21f64e066

View File

@@ -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 = {