{"record":{"id":"f6a4daa01290d58c","repo":"nautechsystems/nautilus_trader","slug":"venue-order-id-required-for-modify","errorCode":null,"errorMessage":"venue_order_id required for modify","messagePattern":"venue_order_id required for modify","errorType":"validation","errorClass":"BinanceSpotHttpError::ValidationError","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/spot/execution.rs","lineNumber":1861,"sourceCode":"            self.spawn_task(\"modify_order_http\", async move {\n                let result = match command.venue_order_id {\n                    Some(venue_order_id) => {\n                        http_client\n                            .modify_order(\n                                account_id,\n                                command.instrument_id,\n                                venue_order_id,\n                                command.client_order_id,\n                                order_side,\n                                order_type,\n                                quantity,\n                                time_in_force,\n                                command.price,\n                                use_gtd,\n                            )\n                            .await\n                    }\n                    None => Err(anyhow::anyhow!(BinanceSpotHttpError::ValidationError(\n                        \"venue_order_id required for modify\".to_string()\n                    ))),\n                };\n\n                match result {\n                    Ok(report) => {\n                        let ts_now = clock.get_time_ns();\n                        let updated_event = OrderUpdated::new(\n                            trader_id,\n                            command.strategy_id,\n                            command.instrument_id,\n                            command.client_order_id,\n                            report.quantity,\n                            UUID4::new(),\n                            ts_now,\n                            ts_now,\n                            false,\n                            Some(report.venue_order_id),","sourceCodeStart":1843,"sourceCodeEnd":1879,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/spot/execution.rs#L1843-L1879","documentation":"A `ModifyOrder` command arrived without a `venue_order_id`, which Binance Spot requires to identify the order being amended (Spot modify uses the venue order ID). The client raises a `BinanceSpotHttpError::ValidationError` with this message.","triggerScenarios":"Calling `modify_order` with a command that only carries a client_order_id (or neither) and no venue_order_id, when the modify path requires the venue-assigned ID.","commonSituations":"Submitting an order modify from a strategy that only tracks client order IDs; an order submitted but not yet acknowledged (no venue order ID assigned yet); Bucharest/OCO paths where venue ID is unknown.","solutions":["Resolve the venue_order_id (e.g. from the execution reports/cache) before calling modify_order.","Only modify orders after their submitted→accepted transition so a venue_order_id exists.","Fall back to cancel + replace when the venue order ID is unknown.","Check the order cache lookup that populates the command's venue_order_id."],"exampleFix":"// before\nlet venue_order_id = None; // modify fails\n// after\nlet venue_order_id = cache.venue_order_id(&client_order_id)\n    .ok_or_else(|| anyhow::anyhow!(\"cannot modify: no venue_order_id yet\"))?;","handlingStrategy":"type-guard","validationCode":"if cmd.venue_order_id.is_none() { return Err(anyhow!(\"modify requires a venue_order_id; use cancel-replace instead\")); }","typeGuard":"fn can_modify(cmd: &ModifyOrder) -> bool {\n    cmd.venue_order_id.is_some()\n}","tryCatchPattern":"match client.modify_order(cmd).await {\n    Err(e) if e.to_string().contains(\"venue_order_id required\") => {\n        // fall back to cancel + new order\n    }\n    other => other?,\n}","preventionTips":["Only modify orders that have reached an accepted state with a venue_order_id","Track venue_order_id via the cache keyed on client_order_id","Implement cancel-replace fallback for orders lacking a venue ID"],"tags":["modify-order","validation","missing-identifier"],"backgroundTag":"missing-required-argument","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"}