{"record":{"id":"73b9375643799193","repo":"nautechsystems/nautilus_trader","slug":"binance-v2-does-not-support-instrument-filter-call","errorCode":null,"errorMessage":"Binance v2 does not support instrument filter_callable {filter_callable:?}; the legacy Binance provider never applied callable filters","messagePattern":"Binance v2 does not support instrument filter_callable (.+?); the legacy Binance provider never applied callable filters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":91,"sourceCode":"        Self::builder().build()\n    }\n}\n\nimpl BinanceInstrumentProviderConfig {\n    /// Validates instrument loading configuration.\n    ///\n    /// # Errors\n    ///\n    /// 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\")","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/config.rs#L73-L109","documentation":"BinanceConfig::validate rejects any non-empty instrument filter_callable. Binance v2 does not implement callable filters (the legacy provider accepted the field but never applied it), so supplying one is treated as an invalid configuration and instrument loading fails.","triggerScenarios":"Constructing a Binance data/execution client with filter_callable set (or set to whitespace-padded text) and then calling request_instruments_with_config, which runs validate first.","commonSituations":"Porting an adapter config from a provider that supports filter_callable (e.g. other venue adapters in the repo) and copying the field into the Binance config; leftover YAML/JSON config keys from the legacy Binance provider.","solutions":["Remove the filter_callable field from the Binance client configuration","Filter instruments client-side after loading (e.g. via load_ids or post-processing the instruments response)","If blank/whitespace-only, the field is accepted; trim or drop it in your config loader"],"exampleFix":"// before\nBinanceDataClientConfig { filter_callable: Some(\"predicates.is_crypto()\".into()), ..Default::default() }\n// after\nBinanceDataClientConfig { load_ids: Some(vec![\"BTCUSDT.BINANCE\".into()]), ..Default::default() }","handlingStrategy":"validation","validationCode":"if let Some(f) = &config.filter_callable {\n    if !f.trim().is_empty() {\n        panic!(\"filter_callable is not supported by the Binance v2 adapter; remove it from config\");\n    }\n}","typeGuard":"fn has_filter_callable(config: &BinanceDataClientConfig) -> bool {\n    config.filter_callable.as_deref().map_or(false, |v| !v.trim().is_empty())\n}","tryCatchPattern":"match create_data_client(&kernel, name, &config) {\n    Err(e) if e.to_string().contains(\"filter_callable\") => {\n        eprintln!(\"Remove filter_callable from Binance config: {e}\");\n    }\n    r => r?,\n}","preventionTips":["Strip venue-unsupported keys when porting configs between adapters","Use load_ids for instrument filtering on Binance instead of callables","Run client config validation early in node startup, before data requests"],"tags":["rust","binance","config-validation","instruments"],"backgroundTag":"unsupported-config-value","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"}