{"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":2296,"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 = format_binance_symbol(&instrument_id);\n        let size_precision = self.get_size_precision(&symbol)?;\n        let price_precision = self.get_price_precision(&symbol)?;\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,","sourceCodeStart":2278,"sourceCodeEnd":2314,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/futures/http/client.rs#L2278-L2314","documentation":"The REST modify endpoint must identify the target order by orderId or origClientOrderId. modify_order rejects calls that provide neither identifier before building the request, so the venue is never asked to modify an unspecified order.","triggerScenarios":"ModifyOrder with both venue_order_id and client_order_id absent — typically a modify issued before the order was acknowledged (no venue ID assigned yet) with the client ID also not propagated.","commonSituations":"Modifying immediately after submission; custom routing or serialization layers dropping optional fields; replayed commands with missing fields.","solutions":["Wait for OrderSubmitted / OrderAccepted so venue_order_id is assigned before modifying","Ensure the ModifyOrder command carries at least client_order_id","Check command routing/serialization if optional fields are being stripped in transit"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before submitting a modify\nlet has_identifier = cmd.venue_order_id.is_some() || cmd.client_order_id.is_some();\nassert!(has_identifier, \"modify needs venue_order_id or client_order_id\");","typeGuard":"fn modify_identifiable(venue_order_id: Option<&VenueOrderId>, client_order_id: Option<&ClientOrderId>) -> bool {\n    venue_order_id.is_some() || client_order_id.is_some()\n}","tryCatchPattern":"On this local rejection, wait for the order's acknowledgment event so venue_order_id is assigned (or propagate client_order_id), then resubmit the modify.","preventionTips":["Track order submission state and only modify acknowledged orders","Ensure command routing preserves both identifier fields","Reconcile after restarts so venue IDs are repopulated before modifies"],"tags":["binance","futures","order-modify","missing-identifier","rust"],"backgroundTag":"missing-order-identifier","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}