pub struct CashSwap {
pub lp_mint_decimals: u8,
pub saber: SaberSwap,
}Expand description
A Saber swap and number of decimals.
Fields§
§lp_mint_decimals: u8Decimals of the LP mint. This is used for $CASH conversion.
saber: SaberSwapSaber.
Implementations§
Source§impl CashSwap
impl CashSwap
Sourcepub fn calculate_cash_for_pool_tokens(
&self,
pool_token_amount: u64,
) -> Option<u64>
pub fn calculate_cash_for_pool_tokens( &self, pool_token_amount: u64, ) -> Option<u64>
Calculates the virtual price of the given amount of pool tokens.
Sourcepub fn calculate_pool_tokens_for_cash(&self, cash_amount: u64) -> Option<u64>
pub fn calculate_pool_tokens_for_cash(&self, cash_amount: u64) -> Option<u64>
Calculates the virtual price of the given amount of pool tokens.
Trait Implementations§
impl Copy for CashSwap
impl Eq for CashSwap
impl StructuralPartialEq for CashSwap
Auto Trait Implementations§
impl Freeze for CashSwap
impl RefUnwindSafe for CashSwap
impl Send for CashSwap
impl Sync for CashSwap
impl Unpin for CashSwap
impl UnwindSafe for CashSwap
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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