{"record":{"id":"bdfbdc48c493d01d","repo":"nautechsystems/nautilus_trader","slug":"binance-us-supports-spot-clients-only","errorCode":null,"errorMessage":"Binance US supports Spot clients only","messagePattern":"Binance US supports Spot clients only","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/config.rs","lineNumber":254,"sourceCode":"\nimpl Default for BinanceDataClientConfig {\n    fn default() -> Self {\n        Self::builder().build()\n    }\n}\n\nimpl BinanceDataClientConfig {\n    /// Validates Binance data client configuration.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error for invalid receive-window, provider, or Binance US settings.\n    pub fn validate(&self) -> anyhow::Result<()> {\n        validate_recv_window(self.recv_window_ms)?;\n        self.instrument_provider.validate(self.product_type)?;\n\n        if self.us {\n            anyhow::ensure!(\n                self.product_type == BinanceProductType::Spot,\n                \"Binance US supports Spot clients only\"\n            );\n            anyhow::ensure!(\n                self.environment == BinanceEnvironment::Live,\n                \"Binance US supports the Live environment only\"\n            );\n            anyhow::ensure!(\n                self.spot_market_data_mode == BinanceSpotMarketDataMode::Json,\n                \"Binance US market data requires spot_market_data_mode=Json\"\n            );\n        }\n\n        Ok(())\n    }\n}\n\nimpl ClientConfig for BinanceDataClientConfig {","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/config.rs#L236-L272","documentation":"When us=True the data client config requires product_type to be Spot, because binance.us (the US-regulated endpoint set) offers spot markets only. The check runs in BinanceDataClientConfig.validate before the client is built, together with the Live-environment and Json market-data-mode requirements.","triggerScenarios":"BinanceDataClientConfig(us=True, product_type='USDM_FUTURES' or 'MARGIN') passed to BinanceDataClientFactory, i.e. registering a US-routed futures/margin data client in a TradingNode.","commonSituations":"Reusing a global config template with us=True across all clients in a node; enabling us for compliance reasons then adding a futures strategy to the same node; copy-pasting a US spot example and changing only product_type.","solutions":["Set product_type='SPOT' (the default) for the binance.us client.","For futures/margin markets, drop the US routing: us=False and use the global exchange (subject to your jurisdiction/access).","Split US and global clients into separate nodes/configs so the us flag only applies to the spot client."],"exampleFix":"# before\nBinanceDataClientConfig(us=True, product_type=BinanceProductType.USDM_FUTURES)\n\n# after\nBinanceDataClientConfig(us=True, product_type=BinanceProductType.SPOT)","handlingStrategy":"validation","validationCode":"if config.us:\n    assert config.product_type == BinanceProductType.SPOT, \\\n        'binance.us supports SPOT only'\nconfig.validate()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scope the us flag to a single Spot client config rather than a shared template.","Keep futures clients on separate, us=False configs.","Call validate() at config build time, before the node starts."],"tags":["binance","config","binance-us","product-type","validation"],"backgroundTag":"config-validation-failed","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}