Trait SwapMarketExt

Source
pub trait SwapMarketExt<const DECIMALS: u8>: SwapMarket<DECIMALS> {
    // Provided method
    fn swap_impact_amount_with_cap(
        &self,
        is_long_token: bool,
        price: &Price<Self::Num>,
        usd_impact: &Self::Signed,
    ) -> Result<(Self::Signed, Self::Num)> { ... }
}
Expand description

Extension trait for SwapMarket.

Provided Methods§

Source

fn swap_impact_amount_with_cap( &self, is_long_token: bool, price: &Price<Self::Num>, usd_impact: &Self::Signed, ) -> Result<(Self::Signed, Self::Num)>

Get the swap impact amount with cap.

Implementors§

Source§

impl<M: SwapMarket<DECIMALS> + ?Sized, const DECIMALS: u8> SwapMarketExt<DECIMALS> for M