nautechsystems/nautilus_trader · error

Derive request_instruments requires at least one configured

Error message

Derive request_instruments requires at least one configured currency (DeriveDataClientConfig::currencies)

What it means

Raised by `request_instruments` when the DeriveDataClientConfig has an empty `currencies` list. The Derive instruments REST query is per-currency, so at least one configured currency is required to know which instrument sets to fetch.

Source

Thrown at crates/adapters/derive/src/data.rs:1565

                    price,
                    clock.get_time_ns(),
                    params,
                ),
            );

            if let Err(e) = sender.send(DataEvent::Response(response)) {
                log::error!("Failed to send option-chain reference price response: {e}");
            }
            Ok(())
        });

        Ok(())
    }

    fn request_instruments(&self, request: RequestInstruments) -> anyhow::Result<()> {
        let currencies = self.config.currencies.clone();
        if currencies.is_empty() {
            anyhow::bail!(
                "Derive request_instruments requires at least one configured currency \
                 (DeriveDataClientConfig::currencies)"
            );
        }

        let http_client = self.http_client.clone();
        let include_expired = self.config.include_expired;
        let instruments_cache = Arc::clone(&self.instruments);
        let sender = self.data_sender.clone();
        let clock = self.clock;
        let venue = self.venue().unwrap_or(*DERIVE_VENUE);
        let client_id = request.client_id.unwrap_or(self.client_id);
        let request_id = request.request_id;
        let start_nanos = datetime_to_unix_nanos(request.start);
        let end_nanos = datetime_to_unix_nanos(request.end);
        let params = request.params;

        self.spawn_task("request_instruments", async move {

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Add at least one currency (e.g. ["ETH", "BTC"]) to DeriveDataClientConfig::currencies.
  2. Validate config.currencies is non-empty before creating the data client.
  3. List all currencies for the instruments you plan to subscribe to so lazy loading can find them.

Example fix

// before
let config = DeriveDataClientConfig { currencies: vec![], ..cfg };
// after
let config = DeriveDataClientConfig { currencies: vec!["ETH".into(), "BTC".into()], ..cfg };
Defensive patterns

Strategy: validation

Validate before calling

assert!(!config.currencies.is_empty(), "DeriveDataClientConfig::currencies must list at least one currency");

Try / catch

if let Err(e) = request_instruments(req).await {
    if e.to_string().contains("configured currency") {
        // repopulate currencies in config and retry
    }
}

Prevention

When it happens

Trigger: Calling request_instruments (or instrument loading flows that depend on it) while `DeriveDataClientConfig::currencies` is empty — e.g. building the config without the currencies field or with an empty vec.

Common situations: Copy-pasting a minimal config that omits currencies; dynamically building config and forgetting to populate currencies; clearing currencies to 'fetch everything' (not supported — Derive requires explicit currencies).

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source 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/9fe6f84da0a3b0a5. Report an issue: GitHub.