{"record":{"id":"01b10be98118be58","repo":"nautechsystems/nautilus_trader","slug":"either-venue-order-id-or-client-order-id-must-be-p-01b10b","errorCode":null,"errorMessage":"Either venue_order_id or client_order_id must be provided","messagePattern":"Either venue_order_id or client_order_id must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/http/client.rs","lineNumber":2391,"sourceCode":"    ///\n    /// # Errors\n    ///\n    /// Returns an error if:\n    /// - Neither venue_order_id nor client_order_id is provided.\n    /// - The instrument is not cached.\n    /// - The request fails.\n    #[expect(clippy::too_many_arguments)]\n    pub async fn modify_order(\n        &self,\n        account_id: AccountId,\n        instrument_id: InstrumentId,\n        venue_order_id: Option<VenueOrderId>,\n        client_order_id: Option<ClientOrderId>,\n        order_side: OrderSide,\n        quantity: Quantity,\n        price: Price,\n    ) -> anyhow::Result<OrderStatusReport> {\n        anyhow::ensure!(\n            venue_order_id.is_some() || client_order_id.is_some(),\n            \"Either venue_order_id or client_order_id must be provided\"\n        );\n\n        let (symbol, price_precision, size_precision) =\n            self.cached_precisions_by_id(instrument_id)?;\n\n        let binance_side = BinanceSide::try_from(order_side)?;\n\n        let order_id = venue_order_id\n            .map(|id| id.inner().parse::<i64>())\n            .transpose()\n            .map_err(|_| anyhow::anyhow!(\"Invalid venue order ID\"))?;\n\n        let params = BinanceModifyOrderParams {\n            symbol,\n            order_id,\n            orig_client_order_id: client_order_id","sourceCodeStart":2373,"sourceCodeEnd":2409,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/http/client.rs#L2373-L2409","documentation":"`modify_order` on the Binance futures HTTP client requires at least one order identifier. Binance's API accepts either `orderId` or `origClientOrderId`; if both `venue_order_id` and `client_order_id` are `None`, the adapter cannot build a valid modify request and fails fast with `anyhow::ensure!`.","triggerScenarios":"Calling `modify_order(instrument_id, None, None, order_side, quantity, price)` — e.g. an execution layer that resolved neither identifier, or a partially constructed OrderModify command with empty IDs.","commonSituations":"Passing None after a failed order-ID lookup; constructing the modify call programmatically with optional IDs that were never populated; race where the client order ID was never persisted and the venue ID was not yet received.","solutions":["Pass the `VenueOrderId` obtained from the submit response/report.","Or pass the original `ClientOrderId` used at submission (it is broker-encoded automatically).","Add caller-side code that stores at least one of the two identifiers on every order before any modify path can run."],"exampleFix":"// before\nclient.modify_order(instrument_id, None, None, side, qty, price).await?;\n// after\nclient.modify_order(instrument_id, Some(venue_order_id), None, side, qty, price).await?;","handlingStrategy":"validation","validationCode":"fn ensure_modify_id(venue: Option<&VenueOrderId>, client: Option<&ClientOrderId>) -> Result<(), String> {\n    if venue.is_none() && client.is_none() {\n        return Err(\"modify_order needs venue_order_id or client_order_id\".into());\n    }\n    Ok(())\n}","typeGuard":"fn has_order_id(venue: &Option<VenueOrderId>, client: &Option<ClientOrderId>) -> bool {\n    venue.is_some() || client.is_some()\n}","tryCatchPattern":"match client.modify_order(instrument_id, venue_id, client_id, side, qty, price).await {\n    Err(e) if e.to_string().contains(\"must be provided\") => {\n        // look up an ID from the order cache before retrying\n    }\n    other => other?,\n}","preventionTips":["Persist both venue and client order IDs at submit time.","Never call modify on orders whose submit was never acknowledged.","Wrap modify calls with an ID-presence check."],"tags":["binance","modify-order","missing-argument","order-id"],"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"}