pub type UnindexedOrderError = OrderError<AssetNameExchange, InstrumentNameExchange>;Expand description
Type alias for a OrderError that is keyed on AssetNameExchange and
InstrumentNameExchange (yet to be indexed).
Aliased Type§
pub enum UnindexedOrderError {
Connectivity(ConnectivityError),
Rejected(ApiError<AssetNameExchange, InstrumentNameExchange>),
UnsupportedOrderType(String),
InvalidPrecision(PrecisionViolation),
OutOfBounds(BoundsViolation),
UnsupportedMarginEffect(MarginEffect),
}Variants§
Connectivity(ConnectivityError)
Connectivity-based error (timeout, socket failure, exchange offline), or a venue failure that leaves the order’s status unknown.
Transient — retry with backoff. See ConnectivityError for details. The order may or
may not have reached the matching engine, so before resubmitting an open request,
reconcile its state (open orders, fills); a blind retry can place it twice.
Rejected(ApiError<AssetNameExchange, InstrumentNameExchange>)
API-based error (rate limit, invalid instrument, order rejected, etc.).
Retry semantics depend on the specific ApiError variant. Only
ApiError::RateLimit is transient; other variants are not.
UnsupportedOrderType(String)
The order type is not supported by this connector, or the venue refused it as a type it does not take for this account or instrument.
Non-transient — place a different order type. A connector usually returns this without sending the request (e.g., trailing stop orders on a connector that only supports market/limit); when the venue’s own refusal says so, it can also come back after the round trip.
InvalidPrecision(PrecisionViolation)
A quantity or price in the request has more precision than the venue accepts, so the client refused it without sending it.
Non-transient — change the request. A client that refuses this way never rounds a value itself, because rounding would place a different order than the one requested; it documents how to read the venue’s precision so the caller can round first.
OutOfBounds(BoundsViolation)
A value in the request is outside the range the venue accepts for the instrument, so the client refused it without sending it.
Non-transient — change the request. Unlike InvalidPrecision,
which says a value is badly formed, this says a well-formed value is too small or too
large: below a minimum price, quantity or notional, or above a maximum. The error carries
the limit that was broken, so the caller can resize the order. A client checks only the
rules it has loaded (see OrderRules); a request that passes
can still be rejected by the venue.
UnsupportedMarginEffect(MarginEffect)
The request names a MarginEffect this client cannot honour, so it refused the order
without sending it.
Non-transient — drop the effect (RequestOpen::margin_effect of None takes the client’s
default) or send the order to a client that honours it. A client refuses rather than
ignores an effect it cannot honour, because placing the order without it would borrow, or
not repay, against the caller’s intent. Which effects a client honours is on its type: a
spot or cash account takes only NoSideEffect, a venue
with account-level margin takes none.