{"record":{"id":"91f058fc1dcb2fbf","repo":"nautechsystems/nautilus_trader","slug":"no-usable-instruments-for-instrument-type-fami","errorCode":null,"errorMessage":"No usable instruments for {instrument_type:?} family {family}, cannot initialize execution client","messagePattern":"No usable instruments for (.+?) family (.+?), cannot initialize execution client","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/okx/src/execution.rs","lineNumber":1376,"sourceCode":"                    );\n\n                    self.http_client.cache_instruments(&instruments);\n                    all_instruments.extend(instruments);\n                    all_inst_id_codes.extend(inst_id_codes);\n                } else {\n                    for family in &families {\n                        let (instruments, inst_id_codes) = self\n                            .http_client\n                            .request_instruments(*instrument_type, Some(family.clone()))\n                            .await\n                            .with_context(|| {\n                                format!(\n                                    \"failed to request OKX instruments for {instrument_type:?} family {family}\"\n                                )\n                            })?;\n\n                        if instruments.is_empty() {\n                            anyhow::bail!(\n                                \"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() {","sourceCodeStart":1358,"sourceCodeEnd":1394,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/okx/src/execution.rs#L1358-L1394","documentation":"Same as the per-type instrument check, but for a specific option family: `establish_session` requests instruments for `{instrument_type} family {family}` (e.g. OPTION for a specific underlying/expiry family) and bails when the response is empty. Without instruments in that family the execution client cannot initialize.","triggerScenarios":"`connect` -> `establish_session` iterates configured option families and the family-scoped instruments request returns an empty list — e.g. a family/underlying string that does not match any OKX listing, a delisted underlying, or a typo in the family config.","commonSituations":"Typo in underlying (e.g. `BTC-USDT` vs `BTC-USD` family format); requesting an expired/delisted option family; region-restricted products returning empty results.","solutions":["Verify the family/underlying identifier format against OKX (check the exact instId family on the OKX instruments endpoint).","Remove families with no active listings from the config or switch to a live underlying.","Confirm the family exists via `/api/v5/public/instruments?instType=OPTION&uly=...` before configuring it.","Check OKX announcements for delistings affecting the configured family."],"exampleFix":"// before\noption_families = [\"BTC-USD-20260931\"]  // nonexistent expiry -> empty\n// after\noption_families = [\"BTC-USD\"]  // valid underlying family with active listings","handlingStrategy":"validation","validationCode":"// confirm the option family exists before configuring\nlet url = format!(\"https://www.okx.com/api/v5/public/instruments?instType=OPTION&uly={family}\");\nlet resp = reqwest::get(&url).await?.json::<serde_json::Value>().await?;\nif resp[\"data\"].as_array().map_or(true, |a| a.is_empty()) {\n    return Err(anyhow::anyhow!(\"family {family} has no OKX option instruments\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate family/underlying strings against OKX's exact format (e.g. BTC-USD).","Remove delisted/expired families from config; monitor OKX delist announcements.","Keep family config in sync with live OKX listings via periodic checks."],"tags":["okx","options","instruments","initialization","empty-response"],"backgroundTag":"empty-result-set","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}