#[non_exhaustive]pub enum PerpRejectionReasonCode {
Show 17 variants
InsufficientMargin,
ModeChangeWithPosition,
StalePositionSnapshot,
MarketNotSupported,
UnifiedModeRequired,
ReduceOnlyExceedsPosition,
TradingHalted,
AccountNotPm,
VenueRiskUnavailable,
PriceUnavailable,
LiquidationPending,
AccountHealthUnavailable,
LeverageRequiresFlatAccount,
ActionNotSupported,
InvalidOrder,
EngineRejected,
Unrecognized,
}Expand description
Stable machine code for why a perp action is (or would be) rejected. The preview and the real submit responses carry the same code for the same rejection.
Values the server adds after this SDK release deserialize as
PerpRejectionReasonCode::Unrecognized.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InsufficientMargin
Portfolio margin does not cover the action.
ModeChangeWithPosition
A cross/isolated switch was requested on an open position.
StalePositionSnapshot
The HyperCore position or equity observation is missing or too old.
MarketNotSupported
The asset is not a configured collateral perp.
UnifiedModeRequired
Risk-increasing perp orders require HyperCore unified account mode.
ReduceOnlyExceedsPosition
A reduce-only order would increase or flip the position.
TradingHalted
Trading is halted globally or for the market.
AccountNotPm
Perp admission requires a portfolio-margin account.
The HyperCore venue risk observation is missing or mismatched.
The valuation spot price is missing or stale.
LiquidationPending
A full liquidation of the account is pending.
The account’s health is unavailable, so risk-increasing orders are disabled.
LeverageRequiresFlatAccount
Leverage changes currently require no open perp positions or orders.
ActionNotSupported
The current TEE policy does not enable this action kind.
InvalidOrder
The order terms are invalid (precision, grouping, identity).
EngineRejected
Any other engine rejection; the response text carries the reason.
Unrecognized
A code this SDK version does not know.
Implementations§
Source§impl PerpRejectionReasonCode
impl PerpRejectionReasonCode
Sourcepub const ALL: [PerpRejectionReasonCode; 16]
pub const ALL: [PerpRejectionReasonCode; 16]
Every code the server documents, in server order.
Sourcepub const fn is_retryable(self) -> bool
pub const fn is_retryable(self) -> bool
Whether the condition is a transient read (venue observation, price, or account health) and the same action may pass when re-checked shortly. The Hypercall order panel re-runs the preview once for these.
Trait Implementations§
Source§impl Clone for PerpRejectionReasonCode
impl Clone for PerpRejectionReasonCode
Source§fn clone(&self) -> PerpRejectionReasonCode
fn clone(&self) -> PerpRejectionReasonCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PerpRejectionReasonCode
Source§impl Debug for PerpRejectionReasonCode
impl Debug for PerpRejectionReasonCode
Source§impl<'de> Deserialize<'de> for PerpRejectionReasonCode
impl<'de> Deserialize<'de> for PerpRejectionReasonCode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PerpRejectionReasonCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PerpRejectionReasonCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for PerpRejectionReasonCode
Source§impl Hash for PerpRejectionReasonCode
impl Hash for PerpRejectionReasonCode
Source§impl PartialEq for PerpRejectionReasonCode
impl PartialEq for PerpRejectionReasonCode
Source§impl Serialize for PerpRejectionReasonCode
impl Serialize for PerpRejectionReasonCode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for PerpRejectionReasonCode
Auto Trait Implementations§
impl Forget for PerpRejectionReasonCode
impl Freeze for PerpRejectionReasonCode
impl Move for PerpRejectionReasonCode
impl RefUnwindSafe for PerpRejectionReasonCode
impl Send for PerpRejectionReasonCode
impl Sync for PerpRejectionReasonCode
impl Unpin for PerpRejectionReasonCode
impl UnsafeUnpin for PerpRejectionReasonCode
impl UnwindSafe for PerpRejectionReasonCode
Blanket Implementations§
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<'de, T> BorrowedRpcObject<'de> for 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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more