pub struct RevertibleLiquidityMarket<'a, 'info> { /* private fields */ }
Expand description
Convert a RevertibleMarket
to a LiquidityMarketMut
.
Trait Implementations§
Source§impl<'a, 'info> Bank<Pubkey> for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> Bank<Pubkey> for RevertibleLiquidityMarket<'a, 'info>
Source§fn record_transferred_in_by_token<Q>(
&mut self,
token: &Q,
amount: &<RevertibleLiquidityMarket<'a, 'info> as Bank<Pubkey>>::Num,
) -> Result<(), Error>
fn record_transferred_in_by_token<Q>( &mut self, token: &Q, amount: &<RevertibleLiquidityMarket<'a, 'info> as Bank<Pubkey>>::Num, ) -> Result<(), Error>
Record transferred in amount by token.
Source§fn record_transferred_out_by_token<Q>(
&mut self,
token: &Q,
amount: &<RevertibleLiquidityMarket<'a, 'info> as Bank<Pubkey>>::Num,
) -> Result<(), Error>
fn record_transferred_out_by_token<Q>( &mut self, token: &Q, amount: &<RevertibleLiquidityMarket<'a, 'info> as Bank<Pubkey>>::Num, ) -> Result<(), Error>
Record transferred out amount by token.
Source§impl<'a, 'info> BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}> for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}> for RevertibleLiquidityMarket<'a, 'info>
Source§type Num = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Num::{constant#0}>>::Num
type Num = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Num::{constant#0}>>::Num
Unsigned number type used in the market.
Source§type Signed = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Signed::{constant#0}>>::Signed
type Signed = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Signed::{constant#0}>>::Signed
Signed number type used in the market.
Source§type Pool = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Pool::{constant#0}>>::Pool
type Pool = <RevertibleMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::Pool::{constant#0}>>::Pool
Pool type.
Source§fn liquidity_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn liquidity_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get the liquidity pool.
Source§fn claimable_fee_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn claimable_fee_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get the claimable fee pool.
Source§fn swap_impact_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn swap_impact_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get the swap impact pool.
Source§fn open_interest_pool(
&self,
is_long: bool,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn open_interest_pool( &self, is_long: bool, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get the open interest pool.
Source§fn open_interest_in_tokens_pool(
&self,
is_long: bool,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn open_interest_in_tokens_pool( &self, is_long: bool, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get the open interest in (index) tokens pool.
Source§fn collateral_sum_pool(
&self,
is_long: bool,
) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
fn collateral_sum_pool( &self, is_long: bool, ) -> Result<&<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Pool, Error>
Get collateral sum pool.
Source§fn usd_to_amount_divisor(
&self,
) -> <RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num
fn usd_to_amount_divisor( &self, ) -> <RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num
USD value to market token amount divisor. Read more
Source§fn max_pool_amount(
&self,
is_long_token: bool,
) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
fn max_pool_amount( &self, is_long_token: bool, ) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
Get max pool amount.
Source§fn pnl_factor_config(
&self,
kind: PnlFactorKind,
is_long: bool,
) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
fn pnl_factor_config( &self, kind: PnlFactorKind, is_long: bool, ) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
Get pnl factor config.
Source§fn reserve_factor(
&self,
) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
fn reserve_factor( &self, ) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
Get reserve factor.
Source§fn open_interest_reserve_factor(
&self,
) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
fn open_interest_reserve_factor( &self, ) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
Get open interest reserve factor.
Source§fn max_open_interest(
&self,
is_long: bool,
) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
fn max_open_interest( &self, is_long: bool, ) -> Result<<RevertibleLiquidityMarket<'a, 'info> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#6}::{constant#0}>>::Num, Error>
Get max open interest.
Source§impl BaseMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl BaseMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn liquidity_pool_mut(
&mut self,
) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}>>::Pool, Error>
fn liquidity_pool_mut( &mut self, ) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}>>::Pool, Error>
Get the liquidity pool mutably. Read more
Source§fn claimable_fee_pool_mut(
&mut self,
) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}>>::Pool, Error>
fn claimable_fee_pool_mut( &mut self, ) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#7}::{constant#0}>>::Pool, Error>
Get the mutable reference of the claimable fee pool. Read more
Source§impl BorrowingFeeMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl BorrowingFeeMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn borrowing_factor_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Pool, Error>
fn borrowing_factor_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Pool, Error>
Get borrowing factor pool.
Source§fn total_borrowing_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Pool, Error>
fn total_borrowing_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Pool, Error>
Get total borrowing pool.
Source§fn borrowing_fee_params(
&self,
) -> Result<BorrowingFeeParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Num>, Error>
fn borrowing_fee_params( &self, ) -> Result<BorrowingFeeParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Num>, Error>
Get borrowing fee params.
Source§fn passed_in_seconds_for_borrowing(&self) -> Result<u64, Error>
fn passed_in_seconds_for_borrowing(&self) -> Result<u64, Error>
Get the passed time in seconds for the given kind of clock.
Source§fn borrowing_fee_kink_model_params(
&self,
) -> Result<BorrowingFeeKinkModelParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Num>, Error>
fn borrowing_fee_kink_model_params( &self, ) -> Result<BorrowingFeeKinkModelParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#12}::{constant#0}>>::Num>, Error>
Get borrowing fee kink model params.
Source§impl BorrowingFeeMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#13}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl BorrowingFeeMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#13}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn just_passed_in_seconds_for_borrowing(&mut self) -> Result<u64, Error>
fn just_passed_in_seconds_for_borrowing(&mut self) -> Result<u64, Error>
Get the just passed time in seconds for the given kind of clock.
Source§fn borrowing_factor_pool_mut(
&mut self,
) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#13}::{constant#0}>>::Pool, Error>
fn borrowing_factor_pool_mut( &mut self, ) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#13}::{constant#0}>>::Pool, Error>
Get borrowing factor pool mutably. Read more
Source§impl HasMarketMeta for RevertibleLiquidityMarket<'_, '_>
impl HasMarketMeta for RevertibleLiquidityMarket<'_, '_>
fn market_meta(&self) -> &MarketMeta
fn is_pure(&self) -> bool
Source§impl LiquidityMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl LiquidityMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn total_supply(
&self,
) -> <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}>>::Num
fn total_supply( &self, ) -> <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}>>::Num
Get total supply of the market token.
Source§fn max_pool_value_for_deposit(
&self,
is_long_token: bool,
) -> Result<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}>>::Num, Error>
fn max_pool_value_for_deposit( &self, is_long_token: bool, ) -> Result<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#14}::{constant#0}>>::Num, Error>
Get max pool value for deposit.
Source§impl LiquidityMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl LiquidityMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn mint(
&mut self,
amount: &<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}>>::Num,
) -> Result<(), Error>
fn mint( &mut self, amount: &<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}>>::Num, ) -> Result<(), Error>
Perform mint.
Source§fn burn(
&mut self,
amount: &<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}>>::Num,
) -> Result<(), Error>
fn burn( &mut self, amount: &<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#15}::{constant#0}>>::Num, ) -> Result<(), Error>
Perform burn.
Source§impl PositionImpactMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl PositionImpactMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn position_impact_pool(
&self,
) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Pool, Error>
fn position_impact_pool( &self, ) -> Result<&<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Pool, Error>
Get position impact pool.
Source§fn position_impact_params(
&self,
) -> Result<PriceImpactParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Num>, Error>
fn position_impact_params( &self, ) -> Result<PriceImpactParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Num>, Error>
Get the position impact params.
Source§fn position_impact_distribution_params(
&self,
) -> Result<PositionImpactDistributionParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Num>, Error>
fn position_impact_distribution_params( &self, ) -> Result<PositionImpactDistributionParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#10}::{constant#0}>>::Num>, Error>
Get position impact distribution params.
Source§impl PositionImpactMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#11}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl PositionImpactMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#11}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn position_impact_pool_mut(
&mut self,
) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#11}::{constant#0}>>::Pool, Error>
fn position_impact_pool_mut( &mut self, ) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#11}::{constant#0}>>::Pool, Error>
Get position impact pool mutably. Read more
Source§impl Revertible for RevertibleLiquidityMarket<'_, '_>
impl Revertible for RevertibleLiquidityMarket<'_, '_>
Source§impl Revision for RevertibleLiquidityMarket<'_, '_>
impl Revision for RevertibleLiquidityMarket<'_, '_>
Source§impl SwapMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl SwapMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn swap_impact_params(
&self,
) -> Result<PriceImpactParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}>>::Num>, Error>
fn swap_impact_params( &self, ) -> Result<PriceImpactParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}>>::Num>, Error>
Get swap impact params.
Source§fn swap_fee_params(
&self,
) -> Result<FeeParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}>>::Num>, Error>
fn swap_fee_params( &self, ) -> Result<FeeParams<<RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#8}::{constant#0}>>::Num>, Error>
Get the swap fee params.
Source§impl SwapMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#9}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
impl SwapMarketMut<gmsol_store::::states::market::revertible::liquidity_market::{impl#9}::{constant#0}> for RevertibleLiquidityMarket<'_, '_>
Source§fn swap_impact_pool_mut(
&mut self,
) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#9}::{constant#0}>>::Pool, Error>
fn swap_impact_pool_mut( &mut self, ) -> Result<&mut <RevertibleLiquidityMarket<'_, '_> as BaseMarket<gmsol_store::::states::market::revertible::liquidity_market::{impl#9}::{constant#0}>>::Pool, Error>
Get the swap impact pool mutably. Read more
Auto Trait Implementations§
impl<'a, 'info> Freeze for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> !RefUnwindSafe for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> !Send for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> !Sync for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> Unpin for RevertibleLiquidityMarket<'a, 'info>
impl<'a, 'info> !UnwindSafe for RevertibleLiquidityMarket<'a, 'info>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<M, const DECIMALS: u8> BaseMarketExt<DECIMALS> for Mwhere
M: BaseMarket<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> BaseMarketExt<DECIMALS> for Mwhere
M: BaseMarket<DECIMALS> + ?Sized,
Source§fn pool_value_without_pnl_for_one_side(
&self,
prices: &Prices<Self::Num>,
is_long: bool,
maximize: bool,
) -> Result<Self::Num, Error>
fn pool_value_without_pnl_for_one_side( &self, prices: &Prices<Self::Num>, is_long: bool, maximize: bool, ) -> Result<Self::Num, Error>
Get the usd value of primary pool without pnl for one side.
Source§fn open_interest(&self) -> Result<Merged<&Self::Pool, &Self::Pool>, Error>
fn open_interest(&self) -> Result<Merged<&Self::Pool, &Self::Pool>, Error>
Get total open interest as a
Balance
.Source§fn pnl(
&self,
index_token_price: &Price<Self::Num>,
is_long: bool,
maximize: bool,
) -> Result<Self::Signed, Error>
fn pnl( &self, index_token_price: &Price<Self::Num>, is_long: bool, maximize: bool, ) -> Result<Self::Signed, Error>
Get total pnl of the market for one side.
Source§fn pnl_factor_with_pool_value(
&self,
prices: &Prices<Self::Num>,
is_long: bool,
maximize: bool,
) -> Result<(Self::Signed, Self::Num), Error>
fn pnl_factor_with_pool_value( &self, prices: &Prices<Self::Num>, is_long: bool, maximize: bool, ) -> Result<(Self::Signed, Self::Num), Error>
Get pnl factor with pool value.
Source§fn pnl_factor(
&self,
prices: &Prices<Self::Num>,
is_long: bool,
maximize: bool,
) -> Result<Self::Signed, Error>
fn pnl_factor( &self, prices: &Prices<Self::Num>, is_long: bool, maximize: bool, ) -> Result<Self::Signed, Error>
Get pnl factor.
Source§fn validate_pool_amount(&self, is_long_token: bool) -> Result<(), Error>
fn validate_pool_amount(&self, is_long_token: bool) -> Result<(), Error>
Validate (primary) pool amount.
Source§fn pnl_factor_exceeded(
&self,
prices: &Prices<Self::Num>,
kind: PnlFactorKind,
is_long: bool,
) -> Result<Option<PnlFactorExceeded<Self::Num>>, Error>
fn pnl_factor_exceeded( &self, prices: &Prices<Self::Num>, kind: PnlFactorKind, is_long: bool, ) -> Result<Option<PnlFactorExceeded<Self::Num>>, Error>
Get the excess of pending pnl. Read more
Source§fn validate_pnl_factor(
&self,
prices: &Prices<Self::Num>,
kind: PnlFactorKind,
is_long: bool,
) -> Result<(), Error>
fn validate_pnl_factor( &self, prices: &Prices<Self::Num>, kind: PnlFactorKind, is_long: bool, ) -> Result<(), Error>
Validate pnl factor.
Source§fn validate_max_pnl(
&self,
prices: &Prices<Self::Num>,
long_kind: PnlFactorKind,
short_kind: PnlFactorKind,
) -> Result<(), Error>
fn validate_max_pnl( &self, prices: &Prices<Self::Num>, long_kind: PnlFactorKind, short_kind: PnlFactorKind, ) -> Result<(), Error>
Validate max pnl.
Source§fn reserved_value(
&self,
index_token_price: &Price<Self::Num>,
is_long: bool,
) -> Result<Self::Num, Error>
fn reserved_value( &self, index_token_price: &Price<Self::Num>, is_long: bool, ) -> Result<Self::Num, Error>
Get reserved value.
Source§fn validate_reserve(
&self,
prices: &Prices<Self::Num>,
is_long: bool,
) -> Result<(), Error>
fn validate_reserve( &self, prices: &Prices<Self::Num>, is_long: bool, ) -> Result<(), Error>
Validate reserve.
Source§impl<M, const DECIMALS: u8> BaseMarketMutExt<DECIMALS> for Mwhere
M: BaseMarketMut<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> BaseMarketMutExt<DECIMALS> for Mwhere
M: BaseMarketMut<DECIMALS> + ?Sized,
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<M, const DECIMALS: u8> BorrowingFeeMarketExt<DECIMALS> for Mwhere
M: BorrowingFeeMarket<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> BorrowingFeeMarketExt<DECIMALS> for Mwhere
M: BorrowingFeeMarket<DECIMALS> + ?Sized,
Source§fn cumulative_borrowing_factor(&self, is_long: bool) -> Result<Self::Num, Error>
fn cumulative_borrowing_factor(&self, is_long: bool) -> Result<Self::Num, Error>
Get current borrowing factor.
Source§fn borrowing_factor_per_second(
&self,
is_long: bool,
prices: &Prices<Self::Num>,
) -> Result<Self::Num, Error>
fn borrowing_factor_per_second( &self, is_long: bool, prices: &Prices<Self::Num>, ) -> Result<Self::Num, Error>
Get borrowing factor per second.
Source§impl<M, const DECIMALS: u8> BorrowingFeeMarketMutExt<DECIMALS> for Mwhere
M: BorrowingFeeMarketMut<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> BorrowingFeeMarketMutExt<DECIMALS> for Mwhere
M: BorrowingFeeMarketMut<DECIMALS> + ?Sized,
Source§fn update_borrowing(
&mut self,
prices: &Prices<Self::Num>,
) -> Result<UpdateBorrowingState<&mut Self, DECIMALS>, Error>where
Self: Sized,
fn update_borrowing(
&mut self,
prices: &Prices<Self::Num>,
) -> Result<UpdateBorrowingState<&mut Self, DECIMALS>, Error>where
Self: Sized,
Create a
UpdateBorrowingState
action.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<M, const DECIMALS: u8> LiquidityMarketExt<DECIMALS> for Mwhere
M: LiquidityMarket<DECIMALS>,
impl<M, const DECIMALS: u8> LiquidityMarketExt<DECIMALS> for Mwhere
M: LiquidityMarket<DECIMALS>,
Source§fn validate_pool_value_for_deposit(
&self,
prices: &Prices<Self::Num>,
is_long_token: bool,
) -> Result<(), Error>
fn validate_pool_value_for_deposit( &self, prices: &Prices<Self::Num>, is_long_token: bool, ) -> Result<(), Error>
Validate (primary) pool value for deposit.
Source§fn pool_value(
&self,
prices: &Prices<Self::Num>,
pnl_factor: PnlFactorKind,
maximize: bool,
) -> Result<Self::Signed, Error>
fn pool_value( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Signed, Error>
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, Error>
fn market_token_price( &self, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Self::Num, Error>
Get market token price.
Source§impl<M, const DECIMALS: u8> LiquidityMarketMutExt<DECIMALS> for Mwhere
M: LiquidityMarketMut<DECIMALS>,
impl<M, const DECIMALS: u8> LiquidityMarketMutExt<DECIMALS> for Mwhere
M: LiquidityMarketMut<DECIMALS>,
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<M, const DECIMALS: u8> PositionImpactMarketExt<DECIMALS> for Mwhere
M: PositionImpactMarket<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> PositionImpactMarketExt<DECIMALS> for Mwhere
M: PositionImpactMarket<DECIMALS> + ?Sized,
Source§impl<M, const DECIMALS: u8> PositionImpactMarketMutExt<DECIMALS> for Mwhere
M: PositionImpactMarketMut<DECIMALS> + ?Sized,
impl<M, const DECIMALS: u8> PositionImpactMarketMutExt<DECIMALS> for Mwhere
M: PositionImpactMarketMut<DECIMALS> + ?Sized,
Source§fn apply_delta_to_position_impact_pool(
&mut self,
delta: &Self::Signed,
) -> Result<(), Error>
fn apply_delta_to_position_impact_pool( &mut self, delta: &Self::Signed, ) -> Result<(), Error>
Apply delta to the position impact pool.
Source§fn distribute_position_impact(
&mut self,
) -> Result<DistributePositionImpact<&mut Self, DECIMALS>, Error>where
Self: Sized,
fn distribute_position_impact(
&mut self,
) -> Result<DistributePositionImpact<&mut Self, DECIMALS>, Error>where
Self: Sized,
Create a
DistributePositionImpact
action.