{"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/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/factories.rs#L85-L121","documentation":"BinanceDataClientFactory only implements data clients for Spot (BinanceSpotDataClient) and futures (BinanceFuturesDataClient for UsdM/CoinM). BinanceProductType::Margin and BinanceProductType::Options have no v2 data client implementation, so the factory bails with this error naming the unsupported variant.","triggerScenarios":"BinanceDataClientConfig(product_type='MARGIN' or 'OPTIONS') passed to BinanceDataClientFactory.create / registered in a TradingNode's data client list.","commonSituations":"Assuming every BinanceProductType variant is implemented because the enum exposes it; configs from the legacy adapter that used Margin; exploring European Options (eapi.binance.com) support that has not been built yet.","solutions":["Use product_type='SPOT', 'USDM_FUTURES' or 'COINM_FUTURES' for market data.","For margin market data, note that margin trades on the spot symbols: use the Spot client with a margin exec config.","Track or contribute the missing product-type client rather than working around the factory."],"exampleFix":"# before\nBinanceDataClientConfig(product_type=BinanceProductType.OPTIONS)\n\n# after\nBinanceDataClientConfig(product_type=BinanceProductType.SPOT)","handlingStrategy":"validation","validationCode":"SUPPORTED_DATA = ('SPOT', 'USDM_FUTURES', 'COINM_FUTURES')\nassert config.product_type in SUPPORTED_DATA","typeGuard":"def binance_data_product_supported(pt) -> bool:\n    return pt in ('SPOT', 'USDM_FUTURES', 'COINM_FUTURES')","tryCatchPattern":null,"preventionTips":["Treat Margin and Options as unimplemented in the v2 adapter.","Use the Spot client for margin market data (same symbols).","Check the factory match arms when upgrading — the supported set may grow."],"tags":["binance","factory","product-type","unsupported","data-client"],"backgroundTag":"unsupported-product-type","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}