{"record":{"id":"d2fe041c664d19a4","repo":"nautechsystems/nautilus_trader","slug":"binance-futures-position-request-has-unresolved-in","errorCode":null,"errorMessage":"Binance Futures position request has unresolved instrument {instrument_id}","messagePattern":"Binance Futures position request has unresolved instrument (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":2613,"sourceCode":"    }\n\n    async fn generate_position_status_reports(\n        &self,\n        cmd: &GeneratePositionStatusReports,\n    ) -> anyhow::Result<Vec<PositionStatusReport>> {\n        if let Some(instrument_id) = cmd.instrument_id\n            && self\n                .http_client\n                .instrument_reconciliation(&instrument_id)\n                .is_none()\n        {\n            if self.is_instrument_out_of_scope(instrument_id) {\n                log::debug!(\n                    \"Dropping out-of-scope Binance Futures position request for instrument {instrument_id}\"\n                );\n                return Ok(Vec::new());\n            }\n            anyhow::bail!(\n                \"Binance Futures position request has unresolved instrument {instrument_id}\"\n            );\n        }\n        let symbol = cmd.instrument_id.map(|id| format_binance_symbol(&id));\n\n        let mut builder = BinancePositionRiskParamsBuilder::default();\n\n        if let Some(s) = symbol {\n            builder.symbol(s);\n        }\n        let params = builder.build().map_err(|e| anyhow::anyhow!(\"{e}\"))?;\n\n        let positions = self.http_client.query_positions(&params).await?;\n\n        let mut reports = Vec::new();\n        let mut position_reports_failed = 0usize;\n\n        for position in positions {","sourceCodeStart":2595,"sourceCodeEnd":2631,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L2595-L2631","documentation":"This error is raised by the Binance Futures execution client when a position status request references an instrument_id that is not resolvable to a Binance symbol (not in the execution cache and not in scope). Before building the positionRisk request the adapter checks whether the instrument is out of scope; if it is not out of scope but also has no usable mapping, it bails instead of sending a malformed request. It prevents submitting a request with an empty/invalid symbol.","triggerScenarios":"Calling generate_order_status_reports/generate_position_status_reports with an instrument_id that was never registered or whose Binance metadata is missing from the cache, e.g. querying positions for a freshly added symbol before the instrument was defined or after cache invalidation.","commonSituations":"Requesting position reports for an instrument defined only locally, using a wrong or stale instrument ID (wrong venue suffix), or running before instruments were warmed up in the cache.","solutions":["Add the instrument definition for the instrument_id before issuing the request so it resolves in the cache","Verify the instrument_id venue matches the Binance Futures venue (not spot/USDT-M vs COIN-M mismatch)","Check the out-of-scope config: the check log says out-of-scope instruments are dropped with Ok, so if you hit the bail the ID is 'known' but unresolvable — reinitialize or refresh the instrument cache","Log the instrument_id and confirm it matches the instrument exactly as added (case and venue)"],"exampleFix":"// before\nlet reports = client.generate_position_status_reports(Some(instrument_id_from_config))\n// after\nassert!(client.is_instrument_cached(instrument_id_from_config), \"add instrument first\");\nlet reports = client.generate_position_status_reports(Some(instrument_id_from_config))","handlingStrategy":"validation","validationCode":"if !client.is_instrument_cached(instrument_id) { add_instrument_or_abort(instrument_id); }","typeGuard":null,"tryCatchPattern":"match client.generate_position_status_reports(Some(id)) { Err(e) if e.to_string().contains(\"unresolved instrument\") => warn_and_reconcile(), r => r }","preventionTips":["Always add instrument definitions before issuing report requests","Validate instrument IDs against the configured venue at startup","Log and inspect instrument cache contents after warm-up"],"tags":["rust","binance","instrument-not-found","reconciliation"],"backgroundTag":"instrument-not-in-cache","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}