{"record":{"id":"5a360acde5109708","repo":"nautechsystems/nautilus_trader","slug":"no-result-in-book-summary-response","errorCode":null,"errorMessage":"No result in book summary response","messagePattern":"No result in book summary response","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/deribit/src/http/client.rs","lineNumber":1932,"sourceCode":"    ///\n    /// Returns an error if the request fails.\n    pub async fn request_book_summaries_kind(\n        &self,\n        currency: &str,\n        kind: Option<&str>,\n    ) -> anyhow::Result<Vec<DeribitBookSummaryRaw>> {\n        let params = GetBookSummaryByCurrencyParams {\n            currency: currency.to_string(),\n            kind: kind.map(str::to_string),\n        };\n        let full_response = self\n            .inner\n            .get_book_summary_by_currency(params)\n            .await\n            .map_err(|e| anyhow::anyhow!(e))?;\n        full_response\n            .result\n            .ok_or_else(|| anyhow::anyhow!(\"No result in book summary response\"))\n    }\n\n    /// Requests traded option expirations for a settlement currency.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the request fails.\n    pub async fn request_option_expirations(\n        &self,\n        currency: DeribitCurrency,\n    ) -> anyhow::Result<Vec<String>> {\n        let params = GetExpirationsParams::new(currency.as_str(), DeribitExpirationKind::Option);\n        let full_response = self\n            .inner\n            .get_expirations(params)\n            .await\n            .map_err(|e| anyhow::anyhow!(e))?;\n        let response = full_response","sourceCodeStart":1914,"sourceCodeEnd":1950,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/deribit/src/http/client.rs#L1914-L1950","documentation":"request_book_summaries_kind requires a `result` array from public/get_book_summary_by_currency. The call succeeded at HTTP level but the response had no `result`, so no book summaries can be returned. Deribit omits `result` when it returns an error object.","triggerScenarios":"Calling request_book_summaries/request_book_summaries_kind with a currency that has no instruments or an invalid currency code, yielding an error response with null result.","commonSituations":"Typo'd or lowercase currency code, querying a currency not listed on the connected environment, or brand-new currency with no published summaries yet.","solutions":["Confirm the currency code is exact and supported on this environment (test vs main).","Check the response `error` field for the JSON-RPC error code.","If the currency legitimately has no books, treat empty as expected rather than an error in caller logic."],"exampleFix":"// before\nfull_response\n    .result\n    .ok_or_else(|| anyhow::anyhow!(\"No result in book summary response\"))\n// after\nfull_response.result.ok_or_else(|| {\n    anyhow::anyhow!(\n        \"No result in book summary response for {currency} (error: {:?})\",\n        full_response.error\n    )\n})","handlingStrategy":"validation","validationCode":"// Ensure currency is supported on this environment before querying\nlet currencies = [\"BTC\", \"ETH\", \"SOL\", \"USDT\", \"USDC\"];\nassert!(currencies.contains(&currency.to_uppercase().as_str()));","typeGuard":null,"tryCatchPattern":"match client.request_book_summaries(currency).await {\n    Ok(s) if s.is_empty() => info!(\"no books for {currency}\"),\n    Ok(s) => handle(s),\n    Err(e) if e.to_string().contains(\"No result in book summary\") => treat_as_no_market(currency),\n    Err(e) => return Err(e),\n}","preventionTips":["Check the response `error` field to distinguish invalid currency from empty market","Verify testnet vs mainnet currency availability","Normalize currency codes to Deribit's canonical form"],"tags":["http","api","empty-response","rust"],"backgroundTag":"empty-api-response","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"}