nautechsystems/nautilus_trader · error · anyhow::Error
Order not found in open orders or events: {venue_order_id}
Error message
Order not found in open orders or events: {venue_order_id} What it means
After submitting an order, submit_order tries to locate its status report first in open orders and then across order events. If the venue order ID appears in neither, this error is raised — the exchange accepted/acknowledged differently than expected or the report is not yet visible.
Source
Thrown at crates/adapters/kraken/src/http/futures/client.rs:2213
anyhow::bail!("No order, orderTrigger, or orderPriorExecution data in event");
};
return parse_futures_order_event_status_report(
&event,
Some(send_event.event_type),
&instrument,
account_id,
ts_init,
);
}
// Fall back to querying order events
let events_response = self.inner.get_order_events(None, None, None).await?;
let event_wrapper = events_response
.order_events
.iter()
.find(|e| e.order.order_id == venue_order_id)
.ok_or_else(|| {
anyhow::anyhow!("Order not found in open orders or events: {venue_order_id}")
})?;
parse_futures_order_event_status_report(
&event_wrapper.order,
Some(event_wrapper.event_type),
&instrument,
account_id,
ts_init,
)
}
.await;
report.map_err(|source| KrakenSubmitOrderError::PostSubmitLookup { source }.into())
}
/// Modifies an existing order on the Kraken Futures exchange.
///
/// Returns the new venue order ID assigned to the modified order.View on GitHub (pinned to 18893faf8b)
Solutions
- Check whether the order was actually rejected — inspect any rejection status returned earlier in submit_order.
- Add a short retry/delay and re-query order status (eventual consistency lag).
- Verify venue_order_id matches what the venue returned in the submit response.
- Confirm the client's credentials target the same account the order was submitted to.
Defensive patterns
Strategy: retry
Try / catch
// wrap the lookup phase with a bounded retry for eventual-consistency lag
for attempt in 0..3 {
if let Ok(report) = find_order_report(venue_order_id).await { return Ok(report); }
tokio::time::sleep(Duration::from_millis(200 * (attempt + 1))).await;
}
Err(anyhow!("Order not found in open orders or events: {venue_order_id}")) Prevention
- Allow a short grace period after submit before resolving order status.
- Treat instant 'not found' as a possible venue rejection and check submit responses first.
- Ensure the client credentials match the account orders are submitted to.
- Log the venue_order_id from the submit response for correlation.
When it happens
Trigger: submit_order calls get_open_orders, doesn't find venue_order_id, then calls get_order_events(None, None, None) and find() fails — e.g. order was rejected instantly, filled and archived outside the event window, or eventual-consistency lag means the event hasn't appeared yet.
Common situations: Racing the exchange's eventual consistency right after submit; orders rejected at the venue (never appear in open orders or events); API credential scoped to a different account than the order.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Failed to get open orders: {error_msg}
- No order found for client_order_id={cid}
- get_open_orders failed: {e}
- get_order_events failed: {e}
- Failed to build order params: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/1f8aa07baccff4be.
Report an issue: GitHub.