{"record":{"id":"a27f4bfbcc0fefd0","repo":"nautechsystems/nautilus_trader","slug":"binancefuturesexecutionclient-requires-usdm-or-coi","errorCode":null,"errorMessage":"BinanceFuturesExecutionClient requires UsdM or CoinM product type, was {product_type:?}","messagePattern":"BinanceFuturesExecutionClient requires UsdM or CoinM product type, was (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/futures/execution.rs","lineNumber":212,"sourceCode":"}\n\nimpl BinanceFuturesExecutionClient {\n    /// Creates a new [`BinanceFuturesExecutionClient`].\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the HTTP client fails to initialize, credentials are\n    /// missing, or the product type is not a futures type (UsdM or CoinM).\n    pub fn new(\n        core: ExecutionClientCore,\n        config: BinanceExecutionClientConfig,\n    ) -> anyhow::Result<Self> {\n        config.validate()?;\n        let product_type = config.product_type;\n        match product_type {\n            BinanceProductType::UsdM | BinanceProductType::CoinM => {}\n            _ => {\n                anyhow::bail!(\n                    \"BinanceFuturesExecutionClient requires UsdM or CoinM product type, was {product_type:?}\"\n                );\n            }\n        }\n\n        let (api_key, api_secret) = resolve_credentials(\n            config\n                .api_key\n                .as_ref()\n                .map(|value| value.expose_secret().to_owned()),\n            config\n                .api_secret\n                .as_ref()\n                .map(|value| value.expose_secret().to_owned()),\n            config.environment,\n            product_type,\n        )?;\n        let proxy_url = config","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/binance/src/futures/execution.rs#L194-L230","documentation":"BinanceFuturesExecutionClient::new validates the config's product_type after running config.validate(). Only UsdM (USD-Margined) and CoinM (Coin-Margined) futures are supported by this execution client; other Binance product types (e.g. Spot or Options) are rejected.","triggerScenarios":"Constructing BinanceFuturesExecutionClient with a BinanceProductType other than UsdM or CoinM (e.g. Options, Spot), passed via BinanceExecutionClientConfig.","commonSituations":"Reusing a shared Binance config across spot/futures adapters; typo or default product type not set; swapping API endpoints without updating product_type.","solutions":["Set product_type to BinanceProductType::UsdM for USD-M futures.","Set product_type to BinanceProductType::CoinM for COIN-M futures.","If you need spot, use the Binance spot execution client instead of the futures one."],"exampleFix":"// before\nlet config = BinanceExecutionClientConfig { product_type: BinanceProductType::Options, .. };\n// after\nlet config = BinanceExecutionClientConfig { product_type: BinanceProductType::UsdM, .. };","handlingStrategy":"validation","validationCode":"match config.product_type {\n    BinanceProductType::UsdM | BinanceProductType::CoinM => {},\n    other => return Err(anyhow::anyhow!(\"unsupported product type {other:?} for futures execution client\")),\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate product_type in your config loader before constructing the client.","Use separate config structs for spot vs futures adapters.","Never share one Binance config file across adapter types."],"tags":["binance","futures","configuration","product-type","enum"],"backgroundTag":"invalid-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"}