{"record":{"id":"807a7d4a7aeaf4e8","repo":"nautechsystems/nautilus_trader","slug":"invalid-binance-load-ids-value-raw-e","errorCode":null,"errorMessage":"invalid Binance load_ids value {raw:?}: {e}","messagePattern":"invalid Binance load_ids value (.+?): (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":97,"sourceCode":"    /// Returns an error for malformed IDs, unsupported filters, or a legacy\n    /// callable filter that Binance v2 cannot execute safely.\n    pub fn validate(&self, product_type: BinanceProductType) -> anyhow::Result<()> {\n        if let Some(filter_callable) = self\n            .filter_callable\n            .as_deref()\n            .map(str::trim)\n            .filter(|value| !value.is_empty())\n        {\n            anyhow::bail!(\n                \"Binance v2 does not support instrument filter_callable {filter_callable:?}; \\\n                 the legacy Binance provider never applied callable filters\"\n            );\n        }\n\n        if let Some(load_ids) = &self.load_ids {\n            for raw in load_ids {\n                let instrument_id = InstrumentId::from_str(raw)\n                    .map_err(|e| anyhow::anyhow!(\"invalid Binance load_ids value {raw:?}: {e}\"))?;\n                anyhow::ensure!(\n                    instrument_id.venue.as_str() == \"BINANCE\",\n                    \"Binance load_ids value {raw:?} must use venue BINANCE\"\n                );\n            }\n        }\n\n        for (key, value) in &self.filters {\n            let supported = matches!(key.as_str(), \"symbols\" | \"bases\" | \"quotes\")\n                || key == \"contract_types\"\n                    && matches!(\n                        product_type,\n                        BinanceProductType::UsdM | BinanceProductType::CoinM\n                    );\n            anyhow::ensure!(\n                supported,\n                \"unsupported Binance instrument filter {key:?} for {product_type:?}\"\n            );","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/config.rs#L79-L115","documentation":"BinanceDataClientConfig.validate parses every entry of load_ids with InstrumentId::from_str and forwards the parse failure when an entry is malformed. InstrumentId requires the exact 'SYMBOL.VENUE' shape (e.g. 'BTCUSDT.BINANCE'), and the adapter additionally checks the venue is BINANCE.","triggerScenarios":"Setting load_ids to a value that is not a valid instrument ID string, e.g. 'BTCUSDT' (missing venue), 'BTCUSDT PERP', 'btc_usdt.binance', or an empty/whitespace string, then creating the Binance data or exec client (validate runs in the factory).","commonSituations":"Generating load_ids from a symbols-only watchlist ('BTCUSDT', 'ETHUSDT'); hand-editing the config and dropping the venue suffix; futures perp IDs where users guess the format instead of copying 'BTCUSDT-PERP.BINANCE' from the ParquetDataCatalog or logs.","solutions":["Use the full 'SYMBOL.VENUE' form: load_ids=['BTCUSDT.BINANCE', 'ETHUSDT.BINANCE'].","For futures perps copy the exact ID from the catalog/logs, e.g. 'BTCUSDT-PERP.BINANCE'; margin instruments carry their own suffix.","If building IDs from parts, format them explicitly (f'{symbol}.BINANCE') and assert the venue suffix before passing the config."],"exampleFix":"# before\nload_ids=['BTCUSDT', 'ETH-USDT', ' ']  # missing venue / wrong shape\n\n# after\nload_ids=['BTCUSDT.BINANCE', 'ETHUSDT.BINANCE']","handlingStrategy":"validation","validationCode":"import re\n\nVALID_ID = re.compile(r'^[A-Z0-9-_]+\\.(BINANCE)$')\n\ndef valid_load_ids(ids) -> bool:\n    return all(isinstance(i, str) and VALID_ID.match(i) for i in ids)","typeGuard":"def is_binance_instrument_id(value: str) -> bool:\n    parts = value.split('.')\n    return len(parts) == 2 and parts[1] == 'BINANCE' and bool(parts[0])","tryCatchPattern":"try:\n    InstrumentId.from_str(raw_id)\nexcept Exception as e:\n    raise ValueError(f'load_ids entry {raw_id!r} is not SYMBOL.VENUE: {e}')","preventionTips":["Always fully qualify IDs as SYMBOL.VINANCE-style 'SYMBOL.BINANCE'.","Copy exact futures IDs (e.g. BTCUSDT-PERP.BINANCE) from the catalog or logs.","Unit-test ID formatting helpers that generate load_ids."],"tags":["binance","config","instrument-id","load-ids","validation"],"backgroundTag":"invalid-instrument-id","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}