#[non_exhaustive]#[repr(u8)]pub enum OrderKind {
Liquidation = 0,
AutoDeleveraging = 1,
MarketSwap = 2,
MarketIncrease = 3,
MarketDecrease = 4,
LimitSwap = 5,
LimitIncrease = 6,
LimitDecrease = 7,
StopLossDecrease = 8,
}
Expand description
Order Kind.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Liquidation = 0
Liquidation: allows liquidation of positions if the criteria for liquidation are met.
AutoDeleveraging = 1
Auto-deleveraging Order.
MarketSwap = 2
Swap token A to token B at the current market price.
The order will be cancelled if the min_output_amount
cannot be fulfilled.
MarketIncrease = 3
Increase position at the current market price.
The order will be cancelled if the position cannot be increased at the acceptable price.
MarketDecrease = 4
Decrease position at the current market price.
The order will be cancelled if the position cannot be decreased at the acceptable price.
LimitSwap = 5
Limit Swap.
LimitIncrease = 6
Limit Increase.
LimitDecrease = 7
Limit Decrease.
StopLossDecrease = 8
Stop-Loss Decrease.
Implementations§
Source§impl OrderKind
impl OrderKind
Sourcepub fn is_increase_position(&self) -> bool
pub fn is_increase_position(&self) -> bool
Is increase position order.
Sourcepub fn is_decrease_position(&self) -> bool
pub fn is_decrease_position(&self) -> bool
Is decrease position order.
Sourcepub fn is_market_decrease(&self) -> bool
pub fn is_market_decrease(&self) -> bool
Is market decrease.
Trait Implementations§
Source§impl BorshDeserialize for OrderKind
impl BorshDeserialize for OrderKind
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl TryFrom<OrderKind> for DomainDisabledFlag
impl TryFrom<OrderKind> for DomainDisabledFlag
impl Copy for OrderKind
Auto Trait Implementations§
impl Freeze for OrderKind
impl RefUnwindSafe for OrderKind
impl Send for OrderKind
impl Sync for OrderKind
impl Unpin for OrderKind
impl UnwindSafe for OrderKind
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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