pub struct PoolDelta<T: Unsigned> { /* private fields */ }
Expand description
Delta of pool usd values.
Implementations§
Source§impl<T: Unsigned> PoolDelta<T>
impl<T: Unsigned> PoolDelta<T>
Sourcepub fn try_new<P>(
pool: &P,
delta_long_token_usd_value: T::Signed,
delta_short_token_usd_value: T::Signed,
long_token_price: &T,
short_token_price: &T,
) -> Result<Self>
pub fn try_new<P>( pool: &P, delta_long_token_usd_value: T::Signed, delta_short_token_usd_value: T::Signed, long_token_price: &T, short_token_price: &T, ) -> Result<Self>
Create a new PoolDelta
.
Source§impl<T: Unsigned + Clone + Ord> PoolDelta<T>
impl<T: Unsigned + Clone + Ord> PoolDelta<T>
Sourcepub fn initial_diff_value(&self) -> T
pub fn initial_diff_value(&self) -> T
Initial diff usd value.
Sourcepub fn next_diff_value(&self) -> T
pub fn next_diff_value(&self) -> T
Next diff usd value.
Sourcepub fn is_same_side_rebalance(&self) -> bool
pub fn is_same_side_rebalance(&self) -> bool
Returns whether it is a same side rebalance.
Sourcepub fn price_impact<const DECIMALS: u8>(
&self,
params: &PriceImpactParams<T>,
) -> Result<T::Signed>where
T: FixedPointOps<DECIMALS>,
pub fn price_impact<const DECIMALS: u8>(
&self,
params: &PriceImpactParams<T>,
) -> Result<T::Signed>where
T: FixedPointOps<DECIMALS>,
Calculate price impact.
Auto Trait Implementations§
impl<T> Freeze for PoolDelta<T>
impl<T> RefUnwindSafe for PoolDelta<T>
impl<T> Send for PoolDelta<T>
impl<T> Sync for PoolDelta<T>
impl<T> Unpin for PoolDelta<T>
impl<T> UnwindSafe for PoolDelta<T>
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> 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