nautechsystems/nautilus_trader · error

Unsupported product type for Binance data client

Error message

Unsupported product type for Binance data client: {product_type:?}

What it means

The Binance data client factory only supports Spot-eligible product types and USD-M/Coin-M futures. Any other BinanceProductType reaching the factory's create method cannot be mapped to a data client implementation and bails with this error.

Solutions

  1. Set product_type to a supported variant (Spot for spot data, UsdM or CoinM for futures data)
  2. Check the BinanceProductType enum value in your config file for typos or casing
  3. If you need the unsupported product type, use the legacy adapter or contribute a new client implementation

Example fix

// before
product_type: BinanceProductType::Options
// after
product_type: BinanceProductType::UsdM
Defensive patterns

Strategy: validation

Validate before calling

use nautilus_binance::common::enums::BinanceProductType;
fn is_supported_data_product(pt: BinanceProductType) -> bool {
    matches!(pt, BinanceProductType::Spot | BinanceProductType::UsdM | BinanceProductType::CoinM)
}

Type guard

fn is_supported_data_product(pt: BinanceProductType) -> bool {
    matches!(pt, BinanceProductType::Spot | BinanceProductType::UsdM | BinanceProductType::CoinM)
}

Try / catch

match factory.create(client_id, &config) {
    Err(e) if e.to_string().contains("Unsupported product type for Binance data client") => {
        eprintln!("Set product_type to Spot, UsdM, or CoinM: {e}");
    }
    r => r?,
}

Prevention

When it happens

Trigger: Creating a Binance data client via the client factory with a BinanceProductType that is not handled by the factory's match arms, e.g. an unsupported/experimental product type enum variant.

Common situations: Setting product_type in the Binance config to a variant not yet supported by the v2 adapter (the adapter covers spot, USD-M and Coin-M futures); typos or upgrades introducing newer Binance product types like options.

Related errors


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

Appendix: source

Thrown at crates/adapters/binance/src/factories.rs:103

        let client_id = ClientId::from(name);

        binance_config.validate()?;

        let product_type = binance_config.product_type;

        match product_type {
            BinanceProductType::Spot => {
                let client = BinanceSpotDataClient::new(client_id, binance_config)?;
                Ok(Box::new(client))
            }
            BinanceProductType::UsdM | BinanceProductType::CoinM => {
                let client =
                    BinanceFuturesDataClient::new(client_id, binance_config, product_type)?;
                Ok(Box::new(client))
            }
            _ => {
                anyhow::bail!("Unsupported product type for Binance data client: {product_type:?}")
            }
        }
    }

    fn name(&self) -> &'static str {
        BINANCE
    }

    fn config_type(&self) -> &'static str {
        stringify!(BinanceDataClientConfig)
    }
}

/// Factory for creating Binance Spot execution clients.
#[derive(Debug, Clone)]
#[cfg_attr(
    feature = "python",
    pyo3::pyclass(module = "nautilus_trader.adapters.binance", from_py_object)

View on GitHub (pinned to 18893faf8b)