{"record":{"id":"a544c3a151cea9d6","repo":"nautechsystems/nautilus_trader","slug":"ws-submit-order-failed-e-a544c3","errorCode":null,"errorMessage":"WS submit order failed: {e}","messagePattern":"WS submit order failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/execution.rs","lineNumber":403,"sourceCode":"            dispatch_state.pending_requests.insert(\n                request_id.clone(),\n                PendingRequest {\n                    client_order_id,\n                    venue_order_id: None,\n                    operation: PendingOperation::Place,\n                },\n            );\n\n            self.spawn_task(\"submit_order_ws\", async move {\n                if let Err(e) = ws_client\n                    .place_order_with_id(request_id.clone(), params)\n                    .await\n                {\n                    dispatch_state.pending_requests.remove(&request_id);\n                    log::warn!(\n                        \"WS submit request failed for {client_order_id}, awaiting reconciliation: {e}\"\n                    );\n                    anyhow::bail!(\"WS submit order failed: {e}\");\n                }\n                Ok(())\n            });\n        } else {\n            let http_client = self.http_client.clone();\n            let dispatch_state = self.dispatch_state.clone();\n            log::debug!(\"WS trading not active, falling back to HTTP for submit_order\");\n\n            self.spawn_task(\"submit_order_http\", async move {\n                let result = http_client\n                    .submit_order(\n                        account_id,\n                        instrument_id,\n                        client_order_id,\n                        order_side,\n                        order_type,\n                        quantity,\n                        time_in_force,","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/execution.rs#L385-L421","documentation":"Thrown when a Binance Spot order submission over the User Data websocket API stream fails (the WS API request returned an error or the request errored). The code logs a warning that the client order id will be awaited via reconciliation and removes the pending request, then bails so the calling execution layer reports a denied/rejected submit.","triggerScenarios":"`submit_order_internal` sends a place-order request over the WebSocket API and the awaited response yields `Err(e)` — e.g. Binance returns an error code (insufficient balance, invalid symbol/lot size, signature failure), the request times out, or the WS connection drops mid-request.","commonSituations":"Trading with use_ws_api-style WS order entry during network instability; placing orders with a misconfigured quantity/price filter; expired or wrong API keys producing -1022/-2015 errors over WS.","solutions":["Inspect the inner error `e` (logged as 'WS submit request failed for {client_order_id}') for the Binance error code and fix the order parameters or credentials","Wait for reconciliation: the adapter intentionally leaves the order to be reconciled, so check subsequent order status reports before resubmitting to avoid duplicates","Verify WS API connectivity/keys; fall back to the HTTP submission path if WS is unstable","Retry the submit once order state is confirmed reconciled"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.submit_order(&order).await {\n    Ok(()) => {},\n    Err(e) => {\n        log::warn!(\"submit failed: {e}; awaiting reconciliation before retry\");\n        // do NOT resubmit immediately; wait for order status events\n    }\n}","preventionTips":["Validate order price/qty against instrument filters before submit","Keep API keys and clock skew healthy to avoid signature errors","Monitor WS connection health and reconnect before trading","Always reconcile via order status events before retrying a failed WS submit"],"tags":["binance","spot","websocket","order-submit","network"],"backgroundTag":"api-request-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}