Trait LiquidityMarketExt

Source
pub trait LiquidityMarketExt<const DECIMALS: u8>: LiquidityMarket<DECIMALS> {
    // Provided methods
    fn validate_pool_value_for_deposit(
        &self,
        prices: &Prices<Self::Num>,
        is_long_token: bool,
    ) -> Result<()> { ... }
    fn pool_value(
        &self,
        prices: &Prices<Self::Num>,
        pnl_factor: PnlFactorKind,
        maximize: bool,
    ) -> Result<Self::Signed> { ... }
    fn market_token_price(
        &self,
        prices: &Prices<Self::Num>,
        pnl_factor: PnlFactorKind,
        maximize: bool,
    ) -> Result<Self::Num> { ... }
}
Expand description

Extension trait of LiquidityMarket.

Provided Methods§

Source

fn validate_pool_value_for_deposit( &self, prices: &Prices<Self::Num>, is_long_token: bool, ) -> Result<()>

Validate (primary) pool value for deposit.

Source

fn pool_value( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Signed>

Get the usd value of primary pool.

Source

fn market_token_price( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Num>

Get market token price.

Implementors§

Source§

impl<M: LiquidityMarket<DECIMALS>, const DECIMALS: u8> LiquidityMarketExt<DECIMALS> for M