nautechsystems/nautilus_trader · error

noid ' ' does not match new order oid

Error message

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

What it means

When an AX order-replace event arrives, `replacement_venue_order_id` requires the message's noid to equal the new order's oid; a mismatch means the venue reported an inconsistent replace event. The adapter bails rather than mapping a VenueOrderId it cannot trust, so the event dispatch fails.

Solutions

  1. Log and report the raw AxWsOrderReplaced payload to the adapter maintainers as a protocol inconsistency
  2. Verify adapter and AX gateway API versions are compatible
  3. Check for adapter parsing bugs where noid/oid fields are misread before escalating to the venue
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate replace-event consistency before using the mapped id
fn replace_event_consistent(m: &AxWsOrderReplaced) -> bool { m.noid == m.no.oid }

Try / catch

match replacement_venue_order_id(&msg) {
    Ok(vid) => apply_replace(vid),
    Err(e) => {
        log::error!("inconsistent AX replace event: {e}; payload={:?}", msg);
        // resync open-order state from venue snapshot instead of applying
        request_order_status_snapshot().await;
    }
}

Prevention

When it happens

Trigger: Processing an AxWsOrderReplaced websocket message where message.noid != message.no.oid — normally only on venue-side protocol anomalies, desync, or adapter version skew with the AX API.

Common situations: AX gateway firmware/API changes altering replace-event semantics; corrupted or out-of-order websocket frames; bugs in adapter message parsing.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


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

Appendix: source

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

    {
        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 18893faf8b)