{"record":{"id":"1304b164f537903e","repo":"nautechsystems/nautilus_trader","slug":"no-instruments-loaded-for-configured-types-instru","errorCode":null,"errorMessage":"No instruments loaded for configured types {instrument_types:?}, cannot initialize execution client","messagePattern":"No instruments loaded for configured types (.+?), cannot initialize execution client","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/okx/src/execution.rs","lineNumber":1395,"sourceCode":"                                \"No usable instruments for {instrument_type:?} family {family}, \\\n                                 cannot initialize execution client\"\n                            );\n                        }\n\n                        log::debug!(\n                            \"Loaded {} {instrument_type:?} instruments for family {family}\",\n                            instruments.len()\n                        );\n\n                        self.http_client.cache_instruments(&instruments);\n                        all_instruments.extend(instruments);\n                        all_inst_id_codes.extend(inst_id_codes);\n                    }\n                }\n            }\n\n            if all_instruments.is_empty() {\n                anyhow::bail!(\n                    \"No instruments loaded for configured types {instrument_types:?}, \\\n                     cannot initialize execution client\"\n                );\n            }\n\n            self.ws_private.cache_instruments(&all_instruments);\n            self.ws_private\n                .cache_inst_id_codes(all_inst_id_codes.clone());\n            self.ws_business.cache_instruments(&all_instruments);\n            self.ws_business.cache_inst_id_codes(all_inst_id_codes);\n            self.core.set_instruments_initialized();\n        }\n\n        self.ws_private.connect().await?;\n        self.ws_private.wait_until_active(10.0).await?;\n        log::info!(\"Connected to private WebSocket\");\n\n        {","sourceCodeStart":1377,"sourceCodeEnd":1413,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/okx/src/execution.rs#L1377-L1413","documentation":"After fetching instruments for all configured types (and families), if `all_instruments` is still empty the execution client cannot be initialized, so `establish_session` bails. This is the aggregate guard: every configured type/family produced zero usable instruments.","triggerScenarios":"`connect` -> `establish_session` with a configuration whose `instrument_types` all yield empty instrument lists — e.g. an entirely invalid config, all requests failing to return data, or filtering (e.g. by allowed instruments) eliminating everything.","commonSituations":"Copy-pasted config from another venue with unsupported type names; all configured types unavailable in the account's region; overly restrictive instrument filters; systemic OKX API problem returning empty bodies.","solutions":["Correct `instrument_types` in the execution client config to valid OKX types (SPOT, SWAP, FUTURES, OPTION).","Verify with a direct OKX API call that instruments are returned for your parameters.","Loosen any instrument filtering so at least one instrument is loaded.","Retry; if OKX is returning empty payloads for all types, treat it as an upstream outage."],"exampleFix":"// before\ninstrument_types = [\"PERP\", \"FUTURE\"]  // invalid OKX type names -> nothing loaded\n// after\ninstrument_types = [\"SWAP\", \"FUTURES\"]","handlingStrategy":"validation","validationCode":"let valid_okx_types = [\"SPOT\", \"SWAP\", \"FUTURES\", \"OPTION\"];\nfor t in &config.instrument_types {\n    if !valid_okx_types.contains(&t.as_str()) {\n        return Err(anyhow::anyhow!(\"invalid OKX instrument type: {t}\"));\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only canonical OKX type names in client config.","Ensure at least one configured type yields instruments; validate against the OKX API before connect.","Avoid overly restrictive instrument filters that can eliminate all instruments."],"tags":["okx","instruments","initialization","config","empty-response"],"backgroundTag":"module-init-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}