Skip to main content

OrderDeniedReason

Enum OrderDeniedReason 

Source
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:

  • CODE when the denial needs no diagnostic suffix.
  • CODE: value for one typed value or an opaque diagnostic detail.
  • CODE: key=value, key=value when multiple typed values need disambiguation.
  • CODE: value; free text when 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: OrderPriceField

The price field being validated.

§price: Price

The submitted price.

§price_precision: u8

The submitted price precision.

§max_precision: u8

The instrument’s maximum price precision.

§

PriceNotPositive

The price is not positive for an instrument that disallows negative prices.

Fields

§field: OrderPriceField

The price field being validated.

§price: Price

The submitted price.

§

QuantityPrecisionExceedsMaximum

The quantity precision exceeds the instrument maximum.

Fields

§quantity: Quantity

The submitted quantity.

§quantity_precision: u8

The submitted quantity precision.

§max_precision: u8

The instrument’s maximum quantity precision.

§

QuantityConversionFailed

The order quantity could not be converted for risk checks.

Fields

§detail: String

The underlying conversion error.

§

QuantityExceedsMaximum

The effective order quantity exceeds the instrument maximum.

Fields

§effective_quantity: Quantity

The order quantity after any quote-to-base conversion.

§max_quantity: Quantity

The instrument’s maximum tradable quantity.

§

QuantityBelowMinimum

The effective order quantity is below the instrument minimum.

Fields

§effective_quantity: Quantity

The order quantity after any quote-to-base conversion.

§min_quantity: Quantity

The instrument’s minimum tradable quantity.

§

InvalidMaxNotionalPerOrder

The configured maximum notional per order is invalid.

Fields

§instrument_id: InstrumentId

The instrument the setting applies to.

§value: Decimal

The invalid configured value.

§

InvalidOrderSide

The order side is invalid for this operation.

Fields

§order_side: Option<OrderSide>

The offending order side.

§

MissingExpireTime

A GTD order is missing its expire time.

§

ExpireTimeInPast

The order’s expire time is in the past.

Fields

§expire_time: String

The expire time that has already elapsed.

§

MissingTrailingOffsetType

The order is missing a required trailing offset type.

§

UnsupportedTrailingOffsetType

The order’s trailing offset type is not supported.

Fields

§offset_type: TrailingOffsetType

The 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: InstrumentId

The instrument that was not found.

§

PositionNotFound

The position for a reduce-only order was not found.

Fields

§position_id: PositionId

The position that was not found.

§

MarketPriceUnavailable

No market price is available for the order risk check.

Fields

§order_type: OrderType

The order type requiring a market price.

§instrument_id: InstrumentId

The instrument with no available market price.

§

TrailingStopCalculationFailed

The trailing stop trigger price could not be calculated.

Fields

§detail: String

The underlying calculation error.

§

NotionalCalculationFailed

The order notional value could not be calculated.

Fields

§detail: String

The underlying calculation error.

§

NotionalBelowMinimum

The order notional is below the instrument minimum.

Fields

§min_notional: Money

The instrument’s minimum notional.

§notional: Money

The order’s notional value.

§

NotionalExceedsMaximum

The order notional exceeds the instrument maximum.

Fields

§max_notional: Money

The instrument’s maximum notional.

§notional: Money

The order’s notional value.

§

NotionalExceedsMaxPerOrder

The order notional exceeds the configured maximum per order.

Fields

§max_notional: Money

The configured maximum notional per order.

§notional: Money

The order’s notional value.

§

NotionalExceedsFreeBalance

The order notional exceeds the account free balance.

Fields

§free_balance: Money

The account’s free balance.

§notional: Money

The order’s notional value.

§

InitialMarginCalculationFailed

The order initial margin could not be calculated.

Fields

§detail: String

The underlying calculation error.

§

InitialMarginExceedsFreeBalance

The order initial margin exceeds the account free balance.

Fields

§free_balance: Money

The account’s free balance.

§initial_margin: Money

The initial margin required for the order.

§

BettingBalanceLockedCalculationFailed

The balance to lock for the betting order could not be calculated.

Fields

§detail: String

The underlying calculation error.

§

CumulativeNotionalExceedsFreeBalance

The cumulative order notional exceeds the account free balance.

Fields

§free_balance: Money

The account’s free balance.

§cumulative_notional: Money

The cumulative notional across the checked orders.

§

CumulativeInitialMarginCalculationFailed

The cumulative initial margin could not be calculated.

Fields

§detail: String

The underlying calculation error.

§

CumulativeInitialMarginExceedsFreeBalance

The cumulative initial margin exceeds the account free balance.

Fields

§free_balance: Money

The account’s free balance.

§cumulative_initial_margin: Money

The cumulative initial margin across the checked orders.

§

ReduceOnlyWouldIncreasePosition

A reduce-only order would increase the position.

Fields

§position_id: PositionId

The position the order would increase.

§

OrderListIncomplete

The order list is missing orders in the cache.

Fields

§order_list_id: OrderListId

The order list with missing orders.

§

OrderListDenied

The order was denied because its order list failed risk checks.

Fields

§order_list_id: OrderListId

The order list that failed risk checks.

§

TradingHalted

Trading is halted; new orders are denied.

§

TradingStateReducing

Trading is reducing; the order would increase exposure.

Fields

§order_side: OrderSide

The side of the order that would increase exposure.

§instrument_id: InstrumentId

The 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

§client_id: Option<ClientId>

The explicitly requested client, if one was supplied.

§routing_context: String

The routing context used to look up an execution client.

§

ClientVenueMismatch

The execution client does not handle the order venue.

Fields

§client_id: ClientId

The routed execution client.

§order_venue: Venue

The order venue.

§client_venue: Venue

The execution client’s venue.

§

SubmitFailed

Submitting the order to the execution client failed.

Fields

§detail: String

The underlying submission error.

§

InvalidClientOrderId

The client order ID is invalid for the venue.

Fields

§detail: String

The validation failure detail.

§

InvalidPositionId

The supplied position ID is invalid for the order submission.

Fields

§position_id: PositionId

The invalid position ID.

§detail: String

The validation failure detail.

§

UnsupportedOrderList

The venue does not support the requested order list.

Fields

§detail: String

The reason the order list is unsupported.

§

UnsupportedOrderType

The order type is not supported.

Fields

§order_type: OrderType

The unsupported order type.

§

UnsupportedTimeInForce(TimeInForce)

The order’s time in force is not supported.

§

UnsupportedTpSl

The venue does not support the requested take-profit/stop-loss parameters.

Fields

§detail: String

The reason the take-profit/stop-loss parameters are unsupported.

§

ValidationFailed

The order failed validation before submission.

Fields

§detail: String

The validation failure detail.

Trait Implementations§

Source§

impl Clone for OrderDeniedReason

Source§

fn clone(&self) -> OrderDeniedReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OrderDeniedReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for OrderDeniedReason

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for OrderDeniedReason

Source§

impl Error for OrderDeniedReason

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<'_enum> From<&'_enum OrderDeniedReason> for OrderDeniedCode

Source§

fn from(val: &'_enum OrderDeniedReason) -> OrderDeniedCode

Converts to this type from the input type.
Source§

impl From<OrderDeniedReason> for OrderDeniedCode

Source§

fn from(val: OrderDeniedReason) -> OrderDeniedCode

Converts to this type from the input type.
Source§

impl IntoDiscriminant for OrderDeniedReason

Source§

type Discriminant = OrderDeniedCode

Enum listing the same variants as this enum but without any data fields
Source§

fn discriminant(&self) -> Self::Discriminant

Source§

impl PartialEq for OrderDeniedReason

Source§

fn eq(&self, other: &OrderDeniedReason) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OrderDeniedReason

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Ungil for T
where T: Send,