{"record":{"id":"8685c10cbb17c249","repo":"nautechsystems/nautilus_trader","slug":"unsupported-binance-instrument-filter-key-for","errorCode":null,"errorMessage":"unsupported Binance instrument filter {key:?} for {product_type:?}","messagePattern":"unsupported Binance instrument filter (.+?) for (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":112,"sourceCode":"        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            );\n            validate_filter_strings(key, value)?;\n        }\n\n        Ok(())\n    }\n}\n\nfn validate_filter_strings(name: &str, value: &serde_json::Value) -> anyhow::Result<()> {\n    let valid = match value {\n        serde_json::Value::String(value) => !value.trim().is_empty(),\n        serde_json::Value::Array(values) => {\n            !values.is_empty()\n                && values\n                    .iter()\n                    .all(|value| value.as_str().is_some_and(|value| !value.trim().is_empty()))","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/config.rs#L94-L130","documentation":"BinanceDataClientConfig.validate accepts only the instrument filter keys 'symbols', 'bases' and 'quotes', plus 'contract_types' when product_type is UsdM or CoinM. Any other key (or contract_types on Spot/Margin/Options) fails validation because the v2 provider has no code path to apply it.","triggerScenarios":"Passing filters={'assets': ['USDT']} or {'pairs': [...]} to the instrument provider config; using filters={'contract_types': ['PERPETUAL']} together with product_type='SPOT' (contract types only exist on futures venues).","commonSituations":"Copy-pasting filter dictionaries from other adapters (Bybit/OKX use different key names); old legacy-adapter configs whose filter names did not carry over to v2; assuming Spot supports contract_types because the key exists in the config schema.","solutions":["Rename unsupported keys to the supported ones: symbols (exact symbols), bases (base assets), quotes (quote assets).","Only use contract_types with BinanceProductType::UsdM or CoinM; remove it from Spot configs.","Run config.validate() right after building the config so the failure surfaces before node start."],"exampleFix":"# before (Spot config with futures-only filter)\nBinanceDataClientConfig(\n    product_type='SPOT',\n    instrument_provider=BinanceFuturesInstrumentProviderConfig(\n        filters={'contract_types': ['PERPETUAL']},\n    ),\n)\n\n# after\nBinanceDataClientConfig(\n    product_type='SPOT',\n    instrument_provider=BinanceFuturesInstrumentProviderConfig(\n        filters={'quotes': ['USDT']},\n    ),\n)","handlingStrategy":"validation","validationCode":"BASE_KEYS = {'symbols', 'bases', 'quotes'}\n\ndef filters_supported(filters: dict, product_type: str) -> bool:\n    for k in filters:\n        if k in BASE_KEYS:\n            continue\n        if k == 'contract_types' and product_type in ('USD_M', 'COIN_M'):\n            continue\n        return False\n    return True\n\nassert filters_supported(cfg_filters, product_type)","typeGuard":null,"tryCatchPattern":"try:\n    config.validate()\nexcept Exception as e:\n    raise SystemExit(f'Binance filter config invalid: {e}')","preventionTips":["Stick to symbols/bases/quotes; treat contract_types as futures-only.","Re-check filter keys when migrating configs between adapters.","Run validate() before node start so the offending key is named early."],"tags":["binance","config","filters","instrument-provider","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}