nautechsystems/nautilus_trader · error

No result in response

Error message

No result in response

What it means

request_instruments calls the raw Deribit get_instruments endpoint and then unwraps full_response.result. When the JSON-RPC response arrives without a 'result' field (no instrument data), the ok_or_else raises 'No result in response'. This indicates the API answered (no transport/HTTP error) but returned an empty or error-shaped payload.

Source

Thrown at crates/adapters/deribit/src/http/client.rs:1026

    ///
    /// Returns an error if the request fails or instruments cannot be parsed.
    pub async fn request_instruments(
        &self,
        currency: DeribitCurrency,
        product_type: Option<DeribitProductType>,
    ) -> anyhow::Result<Vec<InstrumentAny>> {
        // Build parameters
        let params = if let Some(pt) = product_type {
            GetInstrumentsParams::with_kind(currency, pt)
        } else {
            GetInstrumentsParams::new(currency)
        };

        // Call raw client
        let full_response = self.inner.get_instruments(params).await?;
        let result = full_response
            .result
            .ok_or_else(|| anyhow::anyhow!("No result in response"))?;
        let ts_event = extract_server_timestamp(full_response.us_out)?;
        let ts_init = self.generate_ts_init();
        let combo_by_id = self.combo_map_for_instruments(currency, &result).await;

        // Parse each instrument
        let mut instruments = Vec::new();
        let mut skipped_count = 0;
        let mut error_count = 0;

        for raw_instrument in result {
            match parse_deribit_instrument_any(&raw_instrument, ts_init, ts_event) {
                Ok(Some(mut instrument)) => {
                    if let Some(combo) = combo_by_id.get(&raw_instrument.instrument_name) {
                        Self::attach_combo_leg_info(&mut instrument, combo);
                    }
                    instruments.push(instrument);
                }
                Ok(None) => {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the currency and kind arguments are valid Deribit values (e.g. BTC, ETH; futures/options/perpetuals) and retry the request.
  2. Log or inspect the full get_instruments response (including any error code/message fields) to see why Deribit omitted result.
  3. Check Deribit API status and the adapter version for schema changes; update the adapter if Deribit changed the get_instruments response shape.
  4. Check whether the raw client should have surfaced a JSON-RPC error instead — an API-level error being silently dropped as a result-less response is a client bug worth reporting.

Example fix

// before
let result = full_response.result.ok_or_else(|| anyhow::anyhow!("No result in response"))?;
// after
let result = full_response.result.ok_or_else(|| {
    anyhow::anyhow!(
        "No result in get_instruments response for currency={currency:?}: error={:?}",
        full_response.error,
    )
})?;
Defensive patterns

Strategy: retry

Validate before calling

// Validate inputs before calling request_instruments
fn is_supported_deribit_currency(code: &str) -> bool {
    matches!(code, "BTC" | "ETH" | "USDT" | "USDC" | "EUR"")
}

Type guard

fn has_result<T>(resp: &JsonRpcResponse<T>) -> bool {
    resp.result.is_some()
}

Try / catch

match provider.request_instruments(currency, kind).await {
    Ok(instruments) => instruments,
    Err(e) if e.to_string().contains("No result in response") => {
        // log full raw response, back off, retry once
        tokio::time::sleep(Duration::from_secs(2)).await;
        provider.request_instruments(currency, kind).await?
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Calling request_instruments with a currency/kind combination that Deribit does not recognize (or an invalid currency code), so the API returns a response whose result field is absent; also possible during Deribit API outages or deprecations that alter the response schema.

Common situations: Typo'd or unsupported Currency/InstrumentKind mapping passed to the provider; querying a newly listed or delisted product the adapter hasn't mapped; Deribit returning an error payload that the raw client treats as a successful response with no result.

Understand the failure class

Background: "empty response", "returned no data", "empty embeddings": what HTTP 200-with-empty-body errors mean across libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/1e762b0f5f719871. Report an issue: GitHub.