nautechsystems/nautilus_trader · error · anyhow::Error

noid '{}' does not match new order oid '{}'

Error message

noid '{}' does not match new order oid '{}'

What it means

A consistency check on the venue's orders-websocket Replace event: AxWsOrderReplaced carries both a top-level noid (new order id) and a nested new-order object no whose oid should identify the same order. If they differ, the adapter cannot tell which id is authoritative for the replacement, so it refuses to mint the new VenueOrderId and the replace cannot be applied to local state. This is a venue-protocol invariant violation, not something your order parameters cause.

Source

Thrown at crates/adapters/architect_ax/src/execution.rs:1464

    {
        return Some(metadata);
    }

    if let Some(cid) = order.cid
        && let Some(client_order_id) = caches.cid_to_client_order_id.get(&cid)
        && let Some(metadata) = caches.orders_metadata.get(&*client_order_id)
    {
        return Some(metadata);
    }

    None
}

pub(crate) fn replacement_venue_order_id(
    message: &crate::websocket::messages::AxWsOrderReplaced,
) -> anyhow::Result<VenueOrderId> {
    if message.noid != message.no.oid {
        anyhow::bail!(
            "noid '{}' does not match new order oid '{}'",
            message.noid,
            message.no.oid
        );
    }

    VenueOrderId::new_checked(&message.noid).map_err(anyhow::Error::from)
}

pub(crate) fn create_order_accepted(
    order: &AxWsOrder,
    event_ts: i64,
    event_tn: i64,
    caches: &OrdersCaches,
    account_id: AccountId,
    clock: &'static AtomicTime,
) -> Option<OrderAccepted> {
    let venue_order_id = VenueOrderId::new(&order.oid);

View on GitHub (pinned to a4b06ed870)

Solutions

  1. Capture the raw websocket frame (debug logs) and report the mismatch to Architect support
  2. Check the nautilus_trader changelog / AX API release notes for schema changes and update the adapter if a new version handles it
  3. As a stopgap, reconcile local order state from the REST order snapshot after a replace instead of the event
Defensive patterns

Strategy: try-catch

Try / catch

// replacement_venue_order_id returns Result; on Err, reconcile from REST
let new_vid = match replacement_venue_order_id(&replaced_msg) {
    Ok(v) => v,
    Err(e) => {
        log::error!("replace event inconsistent ({e}); reconciling via REST snapshot");
        reconcile_orders_from_rest().await?;
        return Ok(());
    }
};

Prevention

When it happens

Trigger: Architect changes the AxWsOrderReplaced schema or ships a bug where noid and no.oid disagree; a partial/malformed JSON message decoded into divergent fields. Triggered purely by inbound WS traffic after a successful order modify.

Common situations: Right after an AX API update that altered replace-event semantics; extremely rare otherwise. Appears as order-modify events failing to update local state in logs.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16). Data as JSON: /api/errors/5face668b20b6db6. Report an issue: GitHub.