nautechsystems/nautilus_trader · error · anyhow::Error

Binance Futures open order request has unresolved instrument

Error message

Binance Futures open order request has unresolved instrument {instrument_id}

What it means

While generating open-order status reports, an open order request references an instrument_id that could not be resolved in the instrument cache (and is not confirmed out-of-scope). Since a report cannot be built without symbol/symbol metadata, the adapter fails with this error instead of silently dropping.

Source

Thrown at crates/adapters/binance/src/futures/execution.rs:1113

    async fn generate_open_order_status_reports(
        &self,
        instrument_id: Option<InstrumentId>,
        ts_init: UnixNanos,
    ) -> anyhow::Result<Vec<OpenOrderStatusReport>> {
        if let Some(instrument_id) = instrument_id
            && self
                .http_client
                .instrument_reconciliation(&instrument_id)
                .is_none()
        {
            if self.is_instrument_out_of_scope(instrument_id) {
                log::debug!(
                    "Dropping out-of-scope Binance Futures order request for instrument {instrument_id}"
                );
                return Ok(Vec::new());
            }

            anyhow::bail!(
                "Binance Futures open order request has unresolved instrument {instrument_id}"
            );
        }

        let symbol = instrument_id.map(|id| format_binance_symbol(&id));
        let mut builder = BinanceOpenOrdersParamsBuilder::default();

        if let Some(symbol) = symbol {
            builder.symbol(symbol);
        }
        let params = builder.build().map_err(|e| anyhow::anyhow!("{e}"))?;

        let (orders, algo_orders) = tokio::try_join!(
            self.http_client.query_open_orders(&params),
            self.http_client.query_open_algo_orders(instrument_id),
        )?;
        let mut reports = Vec::with_capacity(orders.len() + algo_orders.len());

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Load/register the missing instrument into the cache before generating status reports.
  2. Widen the client's instrument scope so the open order's symbol is in scope.
  3. Reconcile the account's open orders: cancel stale exchange-side orders for instruments you don't track.
Defensive patterns

Strategy: validation

Validate before calling

for instrument_id in open_order_instrument_ids {
    if cache.instrument(&instrument_id).is_none() {
        log::warn!("missing instrument in cache: {instrument_id}");
    }
}
// load all missing instruments before generate_order_status_reports

Prevention

When it happens

Trigger: generate_order_status_reports finds an open order whose instrument is missing from the cache and is_instrument_out_of_scope returns false, so neither filtering nor report generation can proceed.

Common situations: Account holds orders for instruments never loaded into the cache (e.g. newly listed symbols, COIN-M vs USD-M mismatch with configured product scope); client restarted with a narrower instrument universe than the exchange account.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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