pub struct DecreasePositionReport<Unsigned, Signed> { /* private fields */ }
Expand description
Report of the execution of position decreasing.
Implementations§
Source§impl<T: Unsigned + Clone> DecreasePositionReport<T, T::Signed>
impl<T: Unsigned + Clone> DecreasePositionReport<T, T::Signed>
Sourcepub fn size_delta_in_tokens(&self) -> &T
pub fn size_delta_in_tokens(&self) -> &T
Get size delta in tokens.
Sourcepub fn initial_size_delta_usd(&self) -> &T
pub fn initial_size_delta_usd(&self) -> &T
Get initial size delta in usd.
Sourcepub fn size_delta_usd(&self) -> &T
pub fn size_delta_usd(&self) -> &T
Get size delta in usd.
Sourcepub fn execution_price(&self) -> &T
pub fn execution_price(&self) -> &T
Get execution price.
Sourcepub fn price_impact_value(&self) -> &T::Signed
pub fn price_impact_value(&self) -> &T::Signed
Get price impact value.
Sourcepub fn price_impact_diff(&self) -> &T
pub fn price_impact_diff(&self) -> &T
Get price impact diff.
Sourcepub fn fees(&self) -> &PositionFees<T>
pub fn fees(&self) -> &PositionFees<T>
Get execution fees.
Sourcepub fn is_output_token_long(&self) -> bool
pub fn is_output_token_long(&self) -> bool
Returns whether the output token (collateral token) is the long token.
Sourcepub fn is_secondary_output_token_long(&self) -> bool
pub fn is_secondary_output_token_long(&self) -> bool
Returns whether the secondary output token (pnl token) is the long token.
Sourcepub fn output_amount(&self) -> &T
pub fn output_amount(&self) -> &T
Get the output amount.
Sourcepub fn secondary_output_amount(&self) -> &T
pub fn secondary_output_amount(&self) -> &T
Get secondary output amount.
Sourcepub fn output_amounts(&self) -> &OutputAmounts<T>
pub fn output_amounts(&self) -> &OutputAmounts<T>
Get output amounts.
Sourcepub fn should_remove(&self) -> bool
pub fn should_remove(&self) -> bool
Returns whether the position should be removed.
Sourcepub fn withdrawable_collateral_amount(&self) -> &T
pub fn withdrawable_collateral_amount(&self) -> &T
Get withdrawable collateral amount.
Sourcepub fn claimable_funding_amounts(&self) -> (&T, &T)
pub fn claimable_funding_amounts(&self) -> (&T, &T)
Get claimable funding amounts.
Sourcepub fn claimable_collateral_for_holding(&self) -> &ClaimableCollateral<T>
pub fn claimable_collateral_for_holding(&self) -> &ClaimableCollateral<T>
Get claimable collateral for holding.
Sourcepub fn claimable_collateral_for_user(&self) -> &ClaimableCollateral<T>
pub fn claimable_collateral_for_user(&self) -> &ClaimableCollateral<T>
Get Get claimable collateral for user.
Sourcepub fn insolvent_close_step(&self) -> Option<InsolventCloseStep>
pub fn insolvent_close_step(&self) -> Option<InsolventCloseStep>
Get insolvent close step.
Trait Implementations§
Source§impl<Unsigned, Signed> BorshDeserialize for DecreasePositionReport<Unsigned, Signed>where
Signed: BorshDeserialize,
Unsigned: BorshDeserialize,
PositionFees<Unsigned>: BorshDeserialize,
Pnl<Signed>: BorshDeserialize,
Option<InsolventCloseStep>: BorshDeserialize,
bool: BorshDeserialize,
OutputAmounts<Unsigned>: BorshDeserialize,
ClaimableCollateral<Unsigned>: BorshDeserialize,
impl<Unsigned, Signed> BorshDeserialize for DecreasePositionReport<Unsigned, Signed>where
Signed: BorshDeserialize,
Unsigned: BorshDeserialize,
PositionFees<Unsigned>: BorshDeserialize,
Pnl<Signed>: BorshDeserialize,
Option<InsolventCloseStep>: BorshDeserialize,
bool: BorshDeserialize,
OutputAmounts<Unsigned>: BorshDeserialize,
ClaimableCollateral<Unsigned>: BorshDeserialize,
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<Unsigned, Signed> BorshSerialize for DecreasePositionReport<Unsigned, Signed>where
Signed: BorshSerialize,
Unsigned: BorshSerialize,
PositionFees<Unsigned>: BorshSerialize,
Pnl<Signed>: BorshSerialize,
Option<InsolventCloseStep>: BorshSerialize,
bool: BorshSerialize,
OutputAmounts<Unsigned>: BorshSerialize,
ClaimableCollateral<Unsigned>: BorshSerialize,
impl<Unsigned, Signed> BorshSerialize for DecreasePositionReport<Unsigned, Signed>where
Signed: BorshSerialize,
Unsigned: BorshSerialize,
PositionFees<Unsigned>: BorshSerialize,
Pnl<Signed>: BorshSerialize,
Option<InsolventCloseStep>: BorshSerialize,
bool: BorshSerialize,
OutputAmounts<Unsigned>: BorshSerialize,
ClaimableCollateral<Unsigned>: BorshSerialize,
Source§impl<Unsigned: Clone, Signed: Clone> Clone for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned: Clone, Signed: Clone> Clone for DecreasePositionReport<Unsigned, Signed>
Source§fn clone(&self) -> DecreasePositionReport<Unsigned, Signed>
fn clone(&self) -> DecreasePositionReport<Unsigned, Signed>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<Unsigned, Signed> InitSpace for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned, Signed> InitSpace for DecreasePositionReport<Unsigned, Signed>
Source§const INIT_SPACE: usize
const INIT_SPACE: usize
Init Space.
Auto Trait Implementations§
impl<Unsigned, Signed> Freeze for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned, Signed> RefUnwindSafe for DecreasePositionReport<Unsigned, Signed>where
Signed: RefUnwindSafe,
Unsigned: RefUnwindSafe,
impl<Unsigned, Signed> Send for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned, Signed> Sync for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned, Signed> Unpin for DecreasePositionReport<Unsigned, Signed>
impl<Unsigned, Signed> UnwindSafe for DecreasePositionReport<Unsigned, Signed>where
Signed: UnwindSafe,
Unsigned: UnwindSafe,
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