{"record":{"id":"d25b564013c3a248","repo":"nautechsystems/nautilus_trader","slug":"unsupported-product-type-for-binance-data-client","errorCode":null,"errorMessage":"Unsupported product type for Binance data client: {product_type:?}","messagePattern":"Unsupported product type for Binance data client: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/factories.rs","lineNumber":103,"sourceCode":"\n        let client_id = ClientId::from(name);\n\n        binance_config.validate()?;\n\n        let product_type = binance_config.product_type;\n\n        match product_type {\n            BinanceProductType::Spot => {\n                let client = BinanceSpotDataClient::new(client_id, binance_config)?;\n                Ok(Box::new(client))\n            }\n            BinanceProductType::UsdM | BinanceProductType::CoinM => {\n                let client =\n                    BinanceFuturesDataClient::new(client_id, binance_config, product_type)?;\n                Ok(Box::new(client))\n            }\n            _ => {\n                anyhow::bail!(\"Unsupported product type for Binance data client: {product_type:?}\")\n            }\n        }\n    }\n\n    fn name(&self) -> &'static str {\n        BINANCE\n    }\n\n    fn config_type(&self) -> &'static str {\n        stringify!(BinanceDataClientConfig)\n    }\n}\n\n/// Factory for creating Binance Spot execution clients.\n#[derive(Debug, Clone)]\n#[cfg_attr(\n    feature = \"python\",\n    pyo3::pyclass(module = \"nautilus_trader.adapters.binance\", from_py_object)","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/factories.rs#L85-L121","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set product_type to a supported variant (Spot for spot data, UsdM or CoinM for futures data)","Check the BinanceProductType enum value in your config file for typos or casing","If you need the unsupported product type, use the legacy adapter or contribute a new client implementation"],"exampleFix":"// before\nproduct_type: BinanceProductType::Options\n// after\nproduct_type: BinanceProductType::UsdM","handlingStrategy":"validation","validationCode":"use nautilus_binance::common::enums::BinanceProductType;\nfn is_supported_data_product(pt: BinanceProductType) -> bool {\n    matches!(pt, BinanceProductType::Spot | BinanceProductType::UsdM | BinanceProductType::CoinM)\n}","typeGuard":"fn is_supported_data_product(pt: BinanceProductType) -> bool {\n    matches!(pt, BinanceProductType::Spot | BinanceProductType::UsdM | BinanceProductType::CoinM)\n}","tryCatchPattern":"match factory.create(client_id, &config) {\n    Err(e) if e.to_string().contains(\"Unsupported product type for Binance data client\") => {\n        eprintln!(\"Set product_type to Spot, UsdM, or CoinM: {e}\");\n    }\n    r => r?,\n}","preventionTips":["Validate product_type against supported variants at config load","Copy data-client configs only from Binance adapter examples","When Binance ships new product types, wait for adapter support before switching"],"tags":["rust","binance","factory","product-type"],"backgroundTag":"unsupported-enum-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"}