nautechsystems/nautilus_trader · error

Instrument {instrument_id} not found, and `auto_load_missing

Error message

Instrument {instrument_id} not found, and `auto_load_missing_instruments` is disabled

What it means

subscribe_resolution (used by subscribe_instrument_status and subscribe_instrument_close) requires the instrument to be present in the adapter's cache, because resolution/status streams are keyed off known instruments. If the instrument is not cached and config option `auto_load_missing_instruments` is false, the adapter cannot resolve it and bails out instead of silently subscribing to nothing.

Source

Thrown at crates/adapters/polymarket/src/data/mod.rs:461

        }
        remove_data_resolve_watch_entry(
            &self.resolve_poll_watchlist,
            instrument_id,
            has_data_subscription,
        );
        token_id
    }

    fn subscribe_resolution(
        &self,
        instrument_id: InstrumentId,
        subscriptions: &Arc<AtomicSet<InstrumentId>>,
    ) -> anyhow::Result<()> {
        // Expiration bounds recovery; it does not disqualify metadata needed for settlement
        let cached = self.instruments.load().contains_key(&instrument_id);

        if !cached && !self.config.auto_load_missing_instruments {
            anyhow::bail!(
                "Instrument {instrument_id} not found, and `auto_load_missing_instruments` is disabled"
            );
        }

        if !self.add_resolution_subscription_intent(instrument_id, subscriptions) {
            return Ok(());
        }

        if !cached {
            self.queue_pending_load(instrument_id);
            return Ok(());
        }

        self.sync_ws_subscription(instrument_id);
        Ok(())
    }

    fn add_live_subscription_intent_with_state(

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Set `auto_load_missing_instruments: true` in the Polymarket data client config.
  2. Explicitly load the instrument (via the instrument provider / load_instruments) before subscribing to its status/close events.
  3. Verify the instrument_id string matches a Polymarket market that exists and was loaded.

Example fix

// before
PolymarketDataClientConfig { auto_load_missing_instruments: false, .. }

// after
PolymarketDataClientConfig { auto_load_missing_instruments: true, .. }
Defensive patterns

Strategy: validation

Validate before calling

if !instruments_cache.contains_key(&instrument_id) && !config.auto_load_missing_instruments {
    load_instrument(&instrument_id)?; // or enable auto_load_missing_instruments
}

Prevention

When it happens

Trigger: Calling subscribe_instrument_status or subscribe_instrument_close with an InstrumentId never loaded into self.instruments while `auto_load_missing_instruments` is disabled in the PolymarketDataClientConfig.

Common situations: Users relying on instruments loaded in a previous session whose cache was rebuilt; configs that disable auto-loading for determinism but reference instruments that were never explicitly added; typos in instrument IDs that don't match any cached instrument.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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