{"record":{"id":"0a6ae3ec19659690","repo":"nautechsystems/nautilus_trader","slug":"modify-order-failed-e","errorCode":null,"errorMessage":"Modify order failed: {e}","messagePattern":"Modify order failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2942,"sourceCode":"                            command.client_order_id,\n                            format!(\"modify-order-failed: {e}\").into(),\n                            UUID4::new(),\n                            ts_now,\n                            ts_now,\n                            false,\n                            command.venue_order_id,\n                            Some(account_id),\n                        );\n\n                        emitter.send_order_event(OrderEventAny::ModifyRejected(rejected));\n                    } else {\n                        log::warn!(\n                            \"Ambiguous modify failure for {}, awaiting reconciliation: {e}\",\n                            command.client_order_id\n                        );\n                    }\n\n                    anyhow::bail!(\"Modify order failed: {e}\");\n                }\n            }\n\n            Ok(())\n        });\n\n        Ok(())\n    }\n\n    fn cancel_order(&self, cmd: CancelOrder) -> anyhow::Result<()> {\n        self.cancel_order_internal(&cmd);\n        Ok(())\n    }\n\n    fn cancel_all_orders(&self, cmd: CancelAllOrders) -> anyhow::Result<()> {\n        let http_client = self.http_client.clone();\n        let instrument_id = cmd.instrument_id;\n","sourceCodeStart":2924,"sourceCodeEnd":2960,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/execution.rs#L2924-L2960","documentation":"The REST modify (PUT /fapi/v1/order or /dapi/v1/order) returned an error. The adapter distinguishes structured venue rejections (definitive Binance error codes), for which it emits an OrderModifyRejected event, from ambiguous transport failures where it logs 'Ambiguous modify failure ... awaiting reconciliation' because the modify may or may not have been applied; both paths then raise this error from the spawned task.","triggerScenarios":"ModifyOrder over HTTP fails: order already filled or canceled (-2011), the modification would immediately trigger the order, quantity/price violate tick or step size, rate limit exceeded, or a network timeout (ambiguous case).","commonSituations":"Racing a modify against a fill; prices/quantities not scaled to instrument precision; clock skew affecting recvWindow; IP rate limits during bursts of modifications.","solutions":["Read the appended {e}: Binance error codes pinpoint the cause (e.g. -2011 means the order is gone)","Re-query the order (QueryOrder) to learn its current state before re-modifying","Align price and quantity to the instrument's tick and step sizes from the instrument definitions","For ambiguous network failures, let reconciliation resolve state instead of blind re-submission"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Consume OrderModifyRejected events for structured venue rejections (fix parameters, do not blind-retry); for ambiguous transport failures, re-query the order via QueryOrder and retry the modify only if it is still open.","preventionTips":["Modify only orders confirmed open (after OrderAccepted) and re-check before large changes","Round prices and quantities to instrument precision before modifying","Back off and respect rate limits when modifying in bursts"],"tags":["binance","futures","order-modify","http","rust"],"backgroundTag":"order-modify-rejected","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}