Interactive Brokers: a replayed execution is dropped when the instrument provider has not yet loaded its instrument

Author: jweltmerCreated Sep 5, 2026Updated Sep 29, 2026

On restart, IB replays the session's execDetails on connect. The execution client resolves each one through the process-local instrument provider, which starts empty. The Cache — restored from the backing database before the client connects — already holds the instrument, but the execution path never asks it.

Verified against the v2.0.0rc4 tag.

Where the fill is discarded

rust
// crates/adapters/interactive_brokers/src/execution/parse.rs:109
let instrument = instrument_provider
    .find(&instrument_id)
    .context("Instrument not found")?;

That Err reaches execution/core_updates.rs, whose only handler is tracing::error!("Error handling order update: {e}") (:143) — the FillReport is never emitted. core_updates.rs:864-872 fails the same way resolving the tracked fill's quote_currency.

Two paths are quieter still. core_updates.rs:387-389 and :921-923 both return Ok(()) on the same provider miss with no log line at all:

rust
let Some(instrument) = instrument_provider.find(&instrument_id) else {
    return Ok(());
};

so an OrderUpdated simply disappears with no diagnostic of any kind.

The adapter already knows about this race, and mitigates half of it

execution/core_helpers.rs:35 preloads instruments referenced by cached orders before reconciliation — but :22 gates the set on is_spread_instrument_id(&instrument_id). BAG orders are covered; every single-leg instrument is left in exactly the race the preload exists to close.

The v1 Python adapter carries the same guard with the same gate, and its docstring states the mechanism outright:

orders from previous sessions are deserialized from the cache database with their spread instrument_id intact, but the instrument provider starts empty

The Cache is already in hand

core_helpers.rs:40 reads self.core.cache() to build the preload set, so the execution path could fall back to cache.instrument(&instrument_id) on a provider miss without acquiring anything or widening the preload.

Observed in production

Measured on our paper trading engine (v1 form, 1.231.0, 2026-08-21): ten dropped executions across three task restarts, each +16 s after that process's first log line, none during the preceding 12.5 hours of steady-state streaming. The instrument provider qualified the two dropped contracts 135 ms after the drop, and the Cache had restored 17,496 instruments 10 seconds before it. The provider did not have them; the Cache did.

Three phantom …-EXTERNAL inferred-fill positions followed, all on those two instruments and none on the other 46 cached positions.

Two possible fixes, either works

  1. Fall back to the Cache when the provider misses.
  2. Drop the is_spread_instrument_id gate so the preload covers every cached order's instrument.

(1) is cheaper and adds no startup cost.

One caveat worth handling in either fix: on a provider miss, get_price_magnifier returns its default of 1, which is correct for a normally-quoted instrument and wrong by 100x for one of IB's minor-unit quotes. A Cache fallback should refuse rather than guess where the quote currency implies a magnifier.

Duplicate check

Searched for "Instrument not found", instrument provider fill dropped, and every IB issue opened since 2026-08-20. The only closely related thread is the preload commit itself, which frames the problem as spread-specific. Nothing covers the single-leg case.

Source: nautechsystems/nautilus_trader