Struct DecreasePositionReport

Source
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>

Source

pub fn size_delta_in_tokens(&self) -> &T

Get size delta in tokens.

Source

pub fn initial_size_delta_usd(&self) -> &T

Get initial size delta in usd.

Source

pub fn size_delta_usd(&self) -> &T

Get size delta in usd.

Source

pub fn execution_price(&self) -> &T

Get execution price.

Source

pub fn price_impact_value(&self) -> &T::Signed

Get price impact value.

Source

pub fn price_impact_diff(&self) -> &T

Get price impact diff.

Source

pub fn fees(&self) -> &PositionFees<T>

Get execution fees.

Source

pub fn is_output_token_long(&self) -> bool

Returns whether the output token (collateral token) is the long token.

Source

pub fn is_secondary_output_token_long(&self) -> bool

Returns whether the secondary output token (pnl token) is the long token.

Source

pub fn output_amount(&self) -> &T

Get the output amount.

Source

pub fn secondary_output_amount(&self) -> &T

Get secondary output amount.

Source

pub fn output_amounts(&self) -> &OutputAmounts<T>

Get output amounts.

Source

pub fn should_remove(&self) -> bool

Returns whether the position should be removed.

Source

pub fn withdrawable_collateral_amount(&self) -> &T

Get withdrawable collateral amount.

Source

pub fn claimable_funding_amounts(&self) -> (&T, &T)

Get claimable funding amounts.

Source

pub fn claimable_collateral_for_holding(&self) -> &ClaimableCollateral<T>

Get claimable collateral for holding.

Source

pub fn claimable_collateral_for_user(&self) -> &ClaimableCollateral<T>

Get Get claimable collateral for user.

Source

pub fn pnl(&self) -> &Pnl<T::Signed>

Get processed pnl.

Source

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,

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> 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>

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,

Source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
Source§

impl<Unsigned: Clone, Signed: Clone> Clone for DecreasePositionReport<Unsigned, Signed>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<T: Unsigned + Debug> Debug for DecreasePositionReport<T, T::Signed>
where T::Signed: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Unsigned, Signed> InitSpace for DecreasePositionReport<Unsigned, Signed>
where Unsigned: InitSpace, Signed: InitSpace,

Source§

const INIT_SPACE: usize

Init Space.

Auto Trait Implementations§

§

impl<Unsigned, Signed> Freeze for DecreasePositionReport<Unsigned, Signed>
where Signed: Freeze, Unsigned: Freeze,

§

impl<Unsigned, Signed> RefUnwindSafe for DecreasePositionReport<Unsigned, Signed>
where Signed: RefUnwindSafe, Unsigned: RefUnwindSafe,

§

impl<Unsigned, Signed> Send for DecreasePositionReport<Unsigned, Signed>
where Signed: Send, Unsigned: Send,

§

impl<Unsigned, Signed> Sync for DecreasePositionReport<Unsigned, Signed>
where Signed: Sync, Unsigned: Sync,

§

impl<Unsigned, Signed> Unpin for DecreasePositionReport<Unsigned, Signed>
where Signed: Unpin, Unsigned: Unpin,

§

impl<Unsigned, Signed> UnwindSafe for DecreasePositionReport<Unsigned, Signed>
where Signed: UnwindSafe, Unsigned: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V