{"record":{"id":"d55afc8a59fc73d7","repo":"nautechsystems/nautilus_trader","slug":"spot-wallet-balances-carry-no-pair-identity-and-ca","errorCode":null,"errorMessage":"SPOT wallet balances carry no pair identity and cannot be attributed for a bulk position report request","messagePattern":"SPOT wallet balances carry no pair identity and cannot be attributed for a bulk position report request","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/bybit/src/http/client.rs","lineNumber":4705,"sourceCode":"    /// # Errors\n    ///\n    /// This function returns an error if the request fails, or if SPOT position reports are enabled\n    /// and no instrument is specified, because wallet balances carry no pair identity.\n    ///\n    /// # References\n    ///\n    /// <https://bybit-exchange.github.io/docs/v5/position>\n    pub async fn request_position_status_reports(\n        &self,\n        account_id: AccountId,\n        product_type: BybitProductType,\n        instrument_id: Option<InstrumentId>,\n    ) -> anyhow::Result<Vec<PositionStatusReport>> {\n        // Handle SPOT position reports via wallet balances if flag is enabled\n        if product_type == BybitProductType::Spot {\n            if self.use_spot_position_reports.load(Ordering::Relaxed) {\n                let Some(instrument_id) = instrument_id else {\n                    anyhow::bail!(\n                        \"SPOT wallet balances carry no pair identity and cannot be attributed for a bulk position report request\"\n                    );\n                };\n                return self\n                    .generate_spot_position_reports_from_wallet(account_id, instrument_id)\n                    .await;\n            } else {\n                // Return empty vector when SPOT position reports are disabled\n                return Ok(Vec::new());\n            }\n        }\n\n        let ts_init = self.generate_ts_init();\n        let mut reports = Vec::new();\n\n        // Build query parameters based on whether a specific instrument is requested\n        let symbol = if let Some(id) = instrument_id {\n            let symbol_str = id.symbol.as_str();","sourceCodeStart":4687,"sourceCodeEnd":4723,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/bybit/src/http/client.rs#L4687-L4723","documentation":"SPOT on Bybit has no positions, so the adapter synthesizes position reports from wallet balances. A bulk (no instrument_id) SPOT position report request cannot attribute balances to pairs, so the adapter bails when the spot-position-reports flag is enabled but no specific instrument ID is given.","triggerScenarios":"Calling generate_position_status_reports (or the reconciliation path) with product_type Spot, use_spot_position_reports enabled, and instrument_id = None.","commonSituations":"Full account reconciliation that requests all position reports without instrument filter on a SPOT account; enabling the spot reports flag but leaving the bulk request path in place.","solutions":["Pass a specific instrument_id when requesting SPOT position reports","Iterate over your SPOT instruments and request one report per instrument","Disable use_spot_position_reports if bulk behavior is expected and SPOT positions are not needed"],"exampleFix":"// before\nclient.generate_position_status_reports(account_id, BybitProductType::Spot, None).await?;\n// after\nfor id in spot_instruments {\n    client.generate_position_status_reports(account_id, BybitProductType::Spot, Some(id)).await?;\n}","handlingStrategy":"validation","validationCode":"anyhow::ensure!(\n    !(product_type == BybitProductType::Spot && instrument_id.is_none()),\n    \"SPOT position reports require a specific instrument_id\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Request SPOT position reports per instrument","Iterate instruments for bulk SPOT reporting","Disable the spot position reports flag if bulk semantics are required"],"tags":["bybit","spot","position-report"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}