pub enum CancelReason {
Show 15 variants
UserRequested,
Amended,
Replaced,
AdminRequested,
MarketPruned,
MarketHalted,
MarginCall,
Liquidation,
BackstopLiquidation,
ReduceOnlyZeroSize,
OpeningTriggerOrphaned,
TpslSiblingCancelled,
TriggerExecutionFailed,
TwapCompleted,
OrderbookOverflow,
}Variants§
UserRequested
User invoked a cancel action directly (CancelOrders / CancelMarketOrders / CancelAllOrders / CancelTriggerOrders / CancelTwapOrder)
Amended
User amended an order (cancel + replace)
Replaced
User placed orders with replace=true; existing market orders wiped
AdminRequested
AdminAction::CancelOrders / AdminCancelTriggerOrders
MarketPruned
Admin pruned the market
MarketHalted
Market was halted; resting orders cleared
MarginCall
Account undercollateralized — covers cross-margin (PublicAction::ForceCancelOrders) and iso-margin (PublicAction::ForceCancelIsoOrders). The cancelled order’s margin mode disambiguates which one fired.
Liquidation
User’s resting orders cancelled as part of regular liquidation (public/liquidate_perp_positions, public/liquidate_iso_perp_position)
BackstopLiquidation
User’s resting orders cancelled as part of backstop / insurance-fund liquidation. Applies to liquidatee and any liquidator whose trigger orders on that market are cleared during takeover.
ReduceOnlyZeroSize
Reduce-only order auto-canceled because the position it would have reduced shrank to zero
OpeningTriggerOrphaned
A trigger that would have opened/added position was auto-canceled because a fill made it stale
TpslSiblingCancelled
Linked TPSL sibling canceled because its pair leg fired, was rejected, or failed during execution
TriggerExecutionFailed
Trigger fired but couldn’t execute — no position to close, post-execution margin failure, no liquidity, or runtime error. The accompanying RejectTriggerOrder / FailureExecuteTriggerOrder event in the same tx carries the specific cause.
TwapCompleted
TWAP slice schedule exhausted (next-slice size rounded to zero)
OrderbookOverflow
Order evicted to make room when orderbook hit its capacity limit
Trait Implementations§
Source§impl AsRef<str> for CancelReason
impl AsRef<str> for CancelReason
Source§impl BorshDeserialize for CancelReason
impl BorshDeserialize for CancelReason
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for CancelReason
impl BorshSerialize for CancelReason
Source§impl Clone for CancelReason
impl Clone for CancelReason
Source§fn clone(&self) -> CancelReason
fn clone(&self) -> CancelReason
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 CancelReason
impl Debug for CancelReason
Source§impl<'de> Deserialize<'de> for CancelReason
impl<'de> Deserialize<'de> for CancelReason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CancelReason
impl Display for CancelReason
Source§impl EnumExt for CancelReason
impl EnumExt for CancelReason
Source§impl JsonSchema for CancelReason
impl JsonSchema for CancelReason
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for CancelReason
impl PartialEq for CancelReason
Source§fn eq(&self, other: &CancelReason) -> bool
fn eq(&self, other: &CancelReason) -> bool
self and other values to be equal, and is used by ==.