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§
Sourcefn validate_pool_value_for_deposit(
&self,
prices: &Prices<Self::Num>,
is_long_token: bool,
) -> Result<()>
fn validate_pool_value_for_deposit( &self, prices: &Prices<Self::Num>, is_long_token: bool, ) -> Result<()>
Validate (primary) pool value for deposit.
Sourcefn pool_value(
&self,
prices: &Prices<Self::Num>,
pnl_factor: PnlFactorKind,
maximize: bool,
) -> Result<Self::Signed>
fn pool_value( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Signed>
Get the usd value of primary pool.
Sourcefn market_token_price(
&self,
prices: &Prices<Self::Num>,
pnl_factor: PnlFactorKind,
maximize: bool,
) -> Result<Self::Num>
fn market_token_price( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Num>
Get market token price.