pub enum PositionEventType {
Closed {
type: PositionType,
entry_price: UD64,
exit_price: UD64,
size: UD64,
delta_pnl: D256,
premium_pnl: D256,
},
CollateralDecreased {
prev_entry_price: UD64,
new_entry_price: UD64,
deposit: UD128,
},
Decreased {
prev_size: UD64,
new_size: UD64,
deposit: UD128,
delta_pnl: D256,
premium_pnl: D256,
},
Deleveraged {
force_close: bool,
type: PositionType,
entry_price: UD64,
exit_price: UD64,
prev_size: UD64,
new_size: UD64,
deposit: UD128,
delta_pnl: D256,
premium_pnl: D256,
},
DepositUpdated(UD128),
Increased {
entry_price: UD64,
prev_size: UD64,
new_size: UD64,
deposit: UD128,
},
Inverted {
type: PositionType,
entry_price: UD64,
prev_size: UD64,
new_size: UD64,
deposit: UD128,
delta_pnl: D256,
premium_pnl: D256,
},
Liquidated {
type: PositionType,
entry_price: UD64,
exit_price: UD64,
prev_size: UD64,
liquidated_size: UD64,
new_size: UD64,
deposit: UD128,
delta_pnl: D256,
premium_pnl: D256,
},
MaintenanceMarginUpdated(UD128),
Opened {
type: PositionType,
entry_price: UD64,
size: UD64,
deposit: UD128,
},
UnrealizedPnLUpdated {
pnl: D256,
delta_pnl: D256,
premium_pnl: D256,
},
Unwound {
type: PositionType,
entry_price: UD64,
exit_price: UD64,
size: UD64,
fair_market_value: D256,
payment: UD128,
},
}Expand description
Type of position event with corresponding details.
Variants§
Closed
Position closed.
CollateralDecreased
Position collateral decreased.
Decreased
Position decreased.
Deleveraged
Position deleveraged.
DepositUpdated(UD128)
Position deposit(collateral) updated.
Increased
Position increased.
Inverted
Position inverted.
Liquidated
Position liquidated.
MaintenanceMarginUpdated(UD128)
Position maintenance margin requirement updated due to updated maintenane margin fraction.
Opened
Position opened.
UnrealizedPnLUpdated
Position unrealized PnL updated.
Unwound
Position unwound.
Trait Implementations§
Source§impl Clone for PositionEventType
impl Clone for PositionEventType
Source§fn clone(&self) -> PositionEventType
fn clone(&self) -> PositionEventType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PositionEventType
Auto Trait Implementations§
impl Freeze for PositionEventType
impl RefUnwindSafe for PositionEventType
impl Send for PositionEventType
impl Sync for PositionEventType
impl Unpin for PositionEventType
impl UnsafeUnpin for PositionEventType
impl UnwindSafe for PositionEventType
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> 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> ⓘ
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