pub enum OrderDeniedReason {
Show 46 variants
PricePrecisionExceedsMaximum {
field: OrderPriceField,
price: Price,
price_precision: u8,
max_precision: u8,
},
PriceNotPositive {
field: OrderPriceField,
price: Price,
},
QuantityPrecisionExceedsMaximum {
quantity: Quantity,
quantity_precision: u8,
max_precision: u8,
},
QuantityConversionFailed {
detail: String,
},
QuantityExceedsMaximum {
effective_quantity: Quantity,
max_quantity: Quantity,
},
QuantityBelowMinimum {
effective_quantity: Quantity,
min_quantity: Quantity,
},
InvalidMaxNotionalPerOrder {
instrument_id: InstrumentId,
value: Decimal,
},
InvalidOrderSide {
order_side: Option<OrderSide>,
},
MissingExpireTime,
ExpireTimeInPast {
expire_time: String,
},
MissingTrailingOffsetType,
UnsupportedTrailingOffsetType {
offset_type: TrailingOffsetType,
},
MissingTriggerType,
MissingTrailingOffset,
InstrumentNotFound {
instrument_id: InstrumentId,
},
PositionNotFound {
position_id: PositionId,
},
MarketPriceUnavailable {
order_type: OrderType,
instrument_id: InstrumentId,
},
TrailingStopCalculationFailed {
detail: String,
},
NotionalCalculationFailed {
detail: String,
},
NotionalBelowMinimum {
min_notional: Money,
notional: Money,
},
NotionalExceedsMaximum {
max_notional: Money,
notional: Money,
},
NotionalExceedsMaxPerOrder {
max_notional: Money,
notional: Money,
},
NotionalExceedsFreeBalance {
free_balance: Money,
notional: Money,
},
InitialMarginCalculationFailed {
detail: String,
},
InitialMarginExceedsFreeBalance {
free_balance: Money,
initial_margin: Money,
},
BettingBalanceLockedCalculationFailed {
detail: String,
},
CumulativeNotionalExceedsFreeBalance {
free_balance: Money,
cumulative_notional: Money,
},
CumulativeInitialMarginCalculationFailed {
detail: String,
},
CumulativeInitialMarginExceedsFreeBalance {
free_balance: Money,
cumulative_initial_margin: Money,
},
ReduceOnlyWouldIncreasePosition {
position_id: PositionId,
},
OrderListIncomplete {
order_list_id: OrderListId,
},
OrderListDenied {
order_list_id: OrderListId,
},
TradingHalted,
TradingStateReducing {
order_side: OrderSide,
instrument_id: InstrumentId,
},
RateLimitExceeded,
StreamReconciling,
NoExecutionClient {
client_id: Option<ClientId>,
routing_context: String,
},
ClientVenueMismatch {
client_id: ClientId,
order_venue: Venue,
client_venue: Venue,
},
SubmitFailed {
detail: String,
},
InvalidClientOrderId {
detail: String,
},
InvalidPositionId {
position_id: PositionId,
detail: String,
},
UnsupportedOrderList {
detail: String,
},
UnsupportedOrderType {
order_type: OrderType,
},
UnsupportedTimeInForce(TimeInForce),
UnsupportedTpSl {
detail: String,
},
ValidationFailed {
detail: String,
},
}Expand description
A standardized reason an order was denied locally by the Nautilus system.
A denial is a local rejection: the order never reached a venue. Each variant carries the
context needed to render its message and maps to a stable OrderDeniedCode.
Rendered messages use these forms:
CODEwhen the denial needs no diagnostic suffix.CODE: valuefor one typed value or an opaque diagnostic detail.CODE: key=value, key=valuewhen multiple typed values need disambiguation.CODE: value; free textwhen one typed value precedes an opaque detail.
Only the leading code is canonical. Consumers must not recover classification or control flow from the diagnostic suffix.
Variants progress from direct field checks and required context through single-order, cumulative, policy, routing, and downstream validation failures. Declaration order does not define validation precedence.
Variants§
PricePrecisionExceedsMaximum
The price precision exceeds the instrument maximum.
Fields
field: OrderPriceFieldThe price field being validated.
PriceNotPositive
The price is not positive for an instrument that disallows negative prices.
QuantityPrecisionExceedsMaximum
The quantity precision exceeds the instrument maximum.
Fields
QuantityConversionFailed
The order quantity could not be converted for risk checks.
QuantityExceedsMaximum
The effective order quantity exceeds the instrument maximum.
Fields
QuantityBelowMinimum
The effective order quantity is below the instrument minimum.
Fields
InvalidMaxNotionalPerOrder
The configured maximum notional per order is invalid.
Fields
instrument_id: InstrumentIdThe instrument the setting applies to.
value: DecimalThe invalid configured value.
InvalidOrderSide
The order side is invalid for this operation.
MissingExpireTime
A GTD order is missing its expire time.
ExpireTimeInPast
The order’s expire time is in the past.
MissingTrailingOffsetType
The order is missing a required trailing offset type.
UnsupportedTrailingOffsetType
The order’s trailing offset type is not supported.
Fields
offset_type: TrailingOffsetTypeThe unsupported trailing offset type.
MissingTriggerType
The order is missing a required trigger type.
MissingTrailingOffset
The order is missing a required trailing offset.
InstrumentNotFound
The instrument was not found in the cache.
Fields
instrument_id: InstrumentIdThe instrument that was not found.
PositionNotFound
The position for a reduce-only order was not found.
Fields
position_id: PositionIdThe position that was not found.
No market price is available for the order risk check.
TrailingStopCalculationFailed
The trailing stop trigger price could not be calculated.
NotionalCalculationFailed
The order notional value could not be calculated.
NotionalBelowMinimum
The order notional is below the instrument minimum.
Fields
NotionalExceedsMaximum
The order notional exceeds the instrument maximum.
Fields
NotionalExceedsMaxPerOrder
The order notional exceeds the configured maximum per order.
Fields
NotionalExceedsFreeBalance
The order notional exceeds the account free balance.
InitialMarginCalculationFailed
The order initial margin could not be calculated.
InitialMarginExceedsFreeBalance
The order initial margin exceeds the account free balance.
Fields
BettingBalanceLockedCalculationFailed
The balance to lock for the betting order could not be calculated.
CumulativeNotionalExceedsFreeBalance
The cumulative order notional exceeds the account free balance.
Fields
CumulativeInitialMarginCalculationFailed
The cumulative initial margin could not be calculated.
CumulativeInitialMarginExceedsFreeBalance
The cumulative initial margin exceeds the account free balance.
Fields
ReduceOnlyWouldIncreasePosition
A reduce-only order would increase the position.
Fields
position_id: PositionIdThe position the order would increase.
OrderListIncomplete
The order list is missing orders in the cache.
Fields
order_list_id: OrderListIdThe order list with missing orders.
OrderListDenied
The order was denied because its order list failed risk checks.
Fields
order_list_id: OrderListIdThe order list that failed risk checks.
TradingHalted
Trading is halted; new orders are denied.
TradingStateReducing
Trading is reducing; the order would increase exposure.
Fields
instrument_id: InstrumentIdThe instrument the order applies to.
RateLimitExceeded
The order submission rate limit was exceeded.
StreamReconciling
The execution stream is unavailable or recovering; retry after recovery.
NoExecutionClient
No execution client was found for the routed command.
Fields
ClientVenueMismatch
The execution client does not handle the order venue.
Fields
SubmitFailed
Submitting the order to the execution client failed.
InvalidClientOrderId
The client order ID is invalid for the venue.
InvalidPositionId
The supplied position ID is invalid for the order submission.
Fields
position_id: PositionIdThe invalid position ID.
UnsupportedOrderList
The venue does not support the requested order list.
UnsupportedOrderType
The order type is not supported.
UnsupportedTimeInForce(TimeInForce)
The order’s time in force is not supported.
UnsupportedTpSl
The venue does not support the requested take-profit/stop-loss parameters.
ValidationFailed
The order failed validation before submission.
Trait Implementations§
Source§impl Clone for OrderDeniedReason
impl Clone for OrderDeniedReason
Source§fn clone(&self) -> OrderDeniedReason
fn clone(&self) -> OrderDeniedReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrderDeniedReason
impl Debug for OrderDeniedReason
Source§impl Display for OrderDeniedReason
impl Display for OrderDeniedReason
impl Eq for OrderDeniedReason
Source§impl Error for OrderDeniedReason
impl Error for OrderDeniedReason
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl<'_enum> From<&'_enum OrderDeniedReason> for OrderDeniedCode
impl<'_enum> From<&'_enum OrderDeniedReason> for OrderDeniedCode
Source§fn from(val: &'_enum OrderDeniedReason) -> OrderDeniedCode
fn from(val: &'_enum OrderDeniedReason) -> OrderDeniedCode
Source§impl From<OrderDeniedReason> for OrderDeniedCode
impl From<OrderDeniedReason> for OrderDeniedCode
Source§fn from(val: OrderDeniedReason) -> OrderDeniedCode
fn from(val: OrderDeniedReason) -> OrderDeniedCode
Source§impl IntoDiscriminant for OrderDeniedReason
impl IntoDiscriminant for OrderDeniedReason
Source§type Discriminant = OrderDeniedCode
type Discriminant = OrderDeniedCode
fn discriminant(&self) -> Self::Discriminant
Source§impl PartialEq for OrderDeniedReason
impl PartialEq for OrderDeniedReason
impl StructuralPartialEq for OrderDeniedReason
Auto Trait Implementations§
impl Freeze for OrderDeniedReason
impl RefUnwindSafe for OrderDeniedReason
impl Send for OrderDeniedReason
impl Sync for OrderDeniedReason
impl Unpin for OrderDeniedReason
impl UnsafeUnpin for OrderDeniedReason
impl UnwindSafe for OrderDeniedReason
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.