diff --git a/prod/clean_arch/dita_v2/bingx_venue.py b/prod/clean_arch/dita_v2/bingx_venue.py index 467426c..6448f0a 100644 --- a/prod/clean_arch/dita_v2/bingx_venue.py +++ b/prod/clean_arch/dita_v2/bingx_venue.py @@ -345,11 +345,11 @@ class BingxVenueAdapter(VenueAdapter): result = getattr(self.backend, "connect", None) if result is not None: self._run(result()) - self._backend_snapshot(include_history=True) + # backend.connect() already called refresh_state() — no second fetch needed return True def cancel(self, order: VenueOrder, *, reason: str = "") -> List[VenueEvent]: - snapshot_before = self._backend_snapshot(include_history=True) + # _events_from_cancel never reads before/after — snapshots are dead weight response = None if hasattr(self.backend, "cancel_order"): response = self._call_backend("cancel_order", order, reason=reason) @@ -382,8 +382,7 @@ class BingxVenueAdapter(VenueAdapter): except BingxHttpError as exc: # W10: map HTTP error class to status — 429/5xx are transient, 4xx are real rejections response = {"status": _http_error_status(str(exc)), "msg": str(exc), "orderId": order.venue_order_id, "clientOrderId": order.venue_client_id} - snapshot_after = self._backend_snapshot(include_history=True) - return self._events_from_cancel(order, response, snapshot_before, snapshot_after, reason=reason) + return self._events_from_cancel(order, response, None, None, reason=reason) def open_orders(self) -> List[VenueOrder]: snapshot = self._backend_snapshot(include_history=False) @@ -420,10 +419,9 @@ class BingxVenueAdapter(VenueAdapter): return self._events_from_snapshot(snapshot) def submit(self, intent: KernelIntent) -> List[VenueEvent]: - snapshot_before = self._backend_snapshot(include_history=True) + # Snapshots dropped: receipt executedQty fields take precedence (same as submit_async) receipt = self._call_backend("submit_intent", self._legacy_intent(intent)) - snapshot_after = self._backend_snapshot(include_history=True) - return self._events_from_submit(intent, receipt, snapshot_before, snapshot_after) + return self._events_from_submit(intent, receipt, None, None) async def submit_async(self, intent: KernelIntent) -> List[VenueEvent]: """Async submit — runs in the caller's event loop, no thread-pool deadlock.