{"record":{"id":"2e2aabfba5586c28","repo":"nautechsystems/nautilus_trader","slug":"failed-to-build-order-query-params-e","errorCode":null,"errorMessage":"failed to build order query params: {e}","messagePattern":"failed to build order query params: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2930,"sourceCode":"                    Err(e) => log::warn!(\"Failed to query algo order status: {e}\"),\n                }\n\n                return Ok(());\n            }\n\n            let mut builder = BinanceOrderQueryParamsBuilder::default();\n            builder.symbol(symbol.clone());\n\n            if let Some(oid) = order_id {\n                builder.order_id(oid);\n            }\n\n            if let Some(coid) = orig_client_order_id {\n                builder.orig_client_order_id(coid);\n            }\n            let params = builder\n                .build()\n                .map_err(|e| anyhow::anyhow!(\"failed to build order query params: {e}\"))?;\n\n            let result = http_client.query_order(&params).await;\n\n            match result {\n                Ok(order) => {\n                    let ts_init = clock.get_time_ns();\n                    let report = order.to_order_status_report(\n                        account_id,\n                        command.instrument_id,\n                        price_precision,\n                        size_precision,\n                        treat_expired_as_canceled,\n                        ts_init,\n                    )?;\n                    let venue_position_id = make_venue_position_id(\n                        use_position_ids,\n                        command.instrument_id,\n                        order.position_side,","sourceCodeStart":2912,"sourceCodeEnd":2948,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L2912-L2948","documentation":"query_order assembles BinanceOrderQueryParams through its typed builder (symbol plus orderId and/or orig_client_order_id). If the builder's validation fails, the error is wrapped with this message before any HTTP call is made.","triggerScenarios":"generate/query_order where the built parameter set violates BinanceOrderQueryParams validation — e.g. missing symbol, empty order identifier, or both orderId and orig_client_order_id absent/conflicting per builder rules.","commonSituations":"Commands missing both venue_order_id and a valid client_order_id mapping (encode_broker_id produced an unexpected value), or an empty/invalid symbol from format_binance_symbol on a malformed instrument_id.","solutions":["Read the wrapped `{e}` message to identify the failing field.","Ensure the command carries a valid venue_order_id (numeric) or client_order_id issued by this adapter.","Verify command.instrument_id maps to a valid Binance Futures symbol via format_binance_symbol.","Confirm the order was placed through this adapter so the broker ID encoding matches."],"exampleFix":"// before\nclient.query_order(&BuildCommand::new(inst).build()?) // missing order identifier\n// after\nensure!(command.venue_order_id.is_some() || !command.client_order_id.is_nil(),\n        \"query_order requires venue_order_id or client_order_id\");","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    command.venue_order_id.is_some() || !command.client_order_id.is_nil(),\n    \"query_order needs venue_order_id or client_order_id\"\n);\nanyhow::ensure!(!format_binance_symbol(&command.instrument_id).is_empty(), \"invalid instrument_id\");","typeGuard":null,"tryCatchPattern":"match client.query_order(cmd).await {\n    Err(e) if e.to_string().contains(\"failed to build order query params\") => {\n        error!(\"order query params rejected: {e}\");\n    }\n    other => other?,\n}","preventionTips":["Ensure commands carry at least one valid order identifier.","Verify instrument_id resolution before issuing queries.","Only query orders originally placed through this adapter (matching broker ID encoding)."],"tags":["binance","builder","order-query","validation"],"backgroundTag":"schema-validation-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"}