nautechsystems/nautilus_trader · error

Binance v2 does not support instrument filter_callable

Error message

Binance v2 does not support instrument filter_callable {filter_callable:?}; the legacy Binance provider never applied callable filters

What it means

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.

Solutions

  1. Remove the filter_callable field from the Binance client configuration
  2. Filter instruments client-side after loading (e.g. via load_ids or post-processing the instruments response)
  3. If blank/whitespace-only, the field is accepted; trim or drop it in your config loader

Example fix

// before
BinanceDataClientConfig { filter_callable: Some("predicates.is_crypto()".into()), ..Default::default() }
// after
BinanceDataClientConfig { load_ids: Some(vec!["BTCUSDT.BINANCE".into()]), ..Default::default() }
Defensive patterns

Strategy: validation

Validate before calling

if let Some(f) = &config.filter_callable {
    if !f.trim().is_empty() {
        panic!("filter_callable is not supported by the Binance v2 adapter; remove it from config");
    }
}

Type guard

fn has_filter_callable(config: &BinanceDataClientConfig) -> bool {
    config.filter_callable.as_deref().map_or(false, |v| !v.trim().is_empty())
}

Try / catch

match create_data_client(&kernel, name, &config) {
    Err(e) if e.to_string().contains("filter_callable") => {
        eprintln!("Remove filter_callable from Binance config: {e}");
    }
    r => r?,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/73b9375643799193. Report an issue: GitHub.

Appendix: source

Thrown at crates/adapters/binance/src/config.rs:91

        Self::builder().build()
    }
}

impl BinanceInstrumentProviderConfig {
    /// Validates instrument loading configuration.
    ///
    /// # Errors
    ///
    /// Returns an error for malformed IDs, unsupported filters, or a legacy
    /// callable filter that Binance v2 cannot execute safely.
    pub fn validate(&self, product_type: BinanceProductType) -> anyhow::Result<()> {
        if let Some(filter_callable) = self
            .filter_callable
            .as_deref()
            .map(str::trim)
            .filter(|value| !value.is_empty())
        {
            anyhow::bail!(
                "Binance v2 does not support instrument filter_callable {filter_callable:?}; \
                 the legacy Binance provider never applied callable filters"
            );
        }

        if let Some(load_ids) = &self.load_ids {
            for raw in load_ids {
                let instrument_id = InstrumentId::from_str(raw)
                    .map_err(|e| anyhow::anyhow!("invalid Binance load_ids value {raw:?}: {e}"))?;
                anyhow::ensure!(
                    instrument_id.venue.as_str() == "BINANCE",
                    "Binance load_ids value {raw:?} must use venue BINANCE"
                );
            }
        }

        for (key, value) in &self.filters {
            let supported = matches!(key.as_str(), "symbols" | "bases" | "quotes")

View on GitHub (pinned to 18893faf8b)