pub struct MarketModel { /* private fields */ }model only.Expand description
Market Model.
Implementations§
Source§impl MarketModel
impl MarketModel
Sourcepub fn from_parts(market: Arc<Market>, supply: u64) -> Self
pub fn from_parts(market: Arc<Market>, supply: u64) -> Self
Create from parts.
Sourcepub fn swap_pricing(&self) -> &SwapPricingKind
pub fn swap_pricing(&self) -> &SwapPricingKind
Get swap pricing kind.
Sourcepub fn with_swap_pricing<T>(
&mut self,
swap_pricing: SwapPricingKind,
f: impl FnOnce(&mut Self) -> T,
) -> T
pub fn with_swap_pricing<T>( &mut self, swap_pricing: SwapPricingKind, f: impl FnOnce(&mut Self) -> T, ) -> T
Execute a function with the specified swap pricing kind.
§Panic Safety
This method uses RAII to ensure state is restored even if the closure panics.
Sourcepub fn with_vi_models<T>(
&mut self,
vi_map: &mut BTreeMap<Pubkey, VirtualInventoryModel>,
f: impl FnOnce(&mut Self) -> T,
) -> T
pub fn with_vi_models<T>( &mut self, vi_map: &mut BTreeMap<Pubkey, VirtualInventoryModel>, f: impl FnOnce(&mut Self) -> T, ) -> T
Execute a function with virtual inventory models from a map.
This method temporarily replaces the virtual inventory models
(for swaps and positions) of the MarketModel with models from the provided map,
executes the provided function, and then restores the original values.
The virtual inventory models are looked up from the map using the market’s
virtual_inventory_for_swaps and virtual_inventory_for_positions addresses.
§Arguments
vi_map- A mutable reference to a map of Pubkey to VirtualInventoryModelf- Function to execute with the temporary VI models
§Returns
The return value of the function f
§Note
The virtual inventory models are passed via a mutable reference to a map, allowing the caller to maintain access to the models and observe any state changes made during the function execution.
§Panic Safety
This method uses RAII to ensure state is restored even if the closure panics.
§Notes
- If the
MarketModelalready has virtual inventory models attached (i.e.vi_for_swaps/vi_for_positionsareSome), this function will not load VI models fromvi_mapand will not write any changes back tovi_map. In that case, only the existing in-model VI instances are used and mutated.
Sourcepub fn with_vis_if<T>(
&mut self,
vi_map: Option<&mut BTreeMap<Pubkey, VirtualInventoryModel>>,
f: impl FnOnce(&mut Self) -> T,
) -> T
pub fn with_vis_if<T>( &mut self, vi_map: Option<&mut BTreeMap<Pubkey, VirtualInventoryModel>>, f: impl FnOnce(&mut Self) -> T, ) -> T
Execute a function with or without virtual inventories depending on the given map.
- If
vi_mapisSome, this will attach VI models from the map viaSelf::with_vi_models. - If
vi_mapisNone, this will temporarily disable VIs viaSelf::with_vis_disabled.
This is a small utility to unify the entry point of VI enable/disable logic so that
callers do not need to duplicate branching between with_vi_models and
with_vis_disabled.
Sourcepub fn with_vis_disabled<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T
pub fn with_vis_disabled<T>(&mut self, f: impl FnOnce(&mut Self) -> T) -> T
Execute a function with virtual inventories disabled.
§Panic Safety
This method uses RAII to ensure state is restored even if the closure panics.
Sourcepub fn passed_in_seconds_for_funding(&self) -> Result<u64>
pub fn passed_in_seconds_for_funding(&self) -> Result<u64>
Returns the time in seconds since last funding fee state update.
Sourcepub fn into_empty_position(
self,
is_long: bool,
collateral_token: Pubkey,
) -> Result<PositionModel>
pub fn into_empty_position( self, is_long: bool, collateral_token: Pubkey, ) -> Result<PositionModel>
Convert into an empty position model.
§Notes
- All position parameters unrelated to the model,
such as
ownerandbump, use zeroed values.
Sourcepub fn into_empty_position_opts(
self,
is_long: bool,
collateral_token: Pubkey,
options: PositionOptions,
) -> Result<PositionModel>
pub fn into_empty_position_opts( self, is_long: bool, collateral_token: Pubkey, options: PositionOptions, ) -> Result<PositionModel>
Convert into an empty position model with options.
Sourcepub fn set_order_fee_discount_factor(&mut self, factor: u128)
pub fn set_order_fee_discount_factor(&mut self, factor: u128)
Set order fee discount factor.
Trait Implementations§
Source§impl Bank<Pubkey> for MarketModel
impl Bank<Pubkey> for MarketModel
Source§fn record_transferred_in_by_token<Q: ?Sized + Borrow<Pubkey>>(
&mut self,
token: &Q,
amount: &Self::Num,
) -> Result<()>
fn record_transferred_in_by_token<Q: ?Sized + Borrow<Pubkey>>( &mut self, token: &Q, amount: &Self::Num, ) -> Result<()>
Source§fn record_transferred_out_by_token<Q: ?Sized + Borrow<Pubkey>>(
&mut self,
token: &Q,
amount: &Self::Num,
) -> Result<()>
fn record_transferred_out_by_token<Q: ?Sized + Borrow<Pubkey>>( &mut self, token: &Q, amount: &Self::Num, ) -> Result<()>
Source§impl BaseMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl BaseMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn liquidity_pool(&self) -> Result<&Self::Pool>
fn liquidity_pool(&self) -> Result<&Self::Pool>
Source§fn claimable_fee_pool(&self) -> Result<&Self::Pool>
fn claimable_fee_pool(&self) -> Result<&Self::Pool>
Source§fn swap_impact_pool(&self) -> Result<&Self::Pool>
fn swap_impact_pool(&self) -> Result<&Self::Pool>
Source§fn open_interest_pool(&self, is_long: bool) -> Result<&Self::Pool>
fn open_interest_pool(&self, is_long: bool) -> Result<&Self::Pool>
Source§fn open_interest_in_tokens_pool(&self, is_long: bool) -> Result<&Self::Pool>
fn open_interest_in_tokens_pool(&self, is_long: bool) -> Result<&Self::Pool>
Source§fn virtual_inventory_for_swaps_pool(
&self,
) -> Result<Option<impl Deref<Target = Self::Pool>>>
fn virtual_inventory_for_swaps_pool( &self, ) -> Result<Option<impl Deref<Target = Self::Pool>>>
Source§fn virtual_inventory_for_positions_pool(
&self,
) -> Result<Option<impl Deref<Target = Self::Pool>>>
fn virtual_inventory_for_positions_pool( &self, ) -> Result<Option<impl Deref<Target = Self::Pool>>>
Source§fn usd_to_amount_divisor(&self) -> Self::Num
fn usd_to_amount_divisor(&self) -> Self::Num
Source§fn pnl_factor_config(
&self,
kind: PnlFactorKind,
is_long: bool,
) -> Result<Self::Num>
fn pnl_factor_config( &self, kind: PnlFactorKind, is_long: bool, ) -> Result<Self::Num>
Source§fn reserve_factor(&self) -> Result<Self::Num>
fn reserve_factor(&self) -> Result<Self::Num>
Source§fn open_interest_reserve_factor(&self) -> Result<Self::Num>
fn open_interest_reserve_factor(&self) -> Result<Self::Num>
Source§fn ignore_open_interest_for_usage_factor(&self) -> Result<bool>
fn ignore_open_interest_for_usage_factor(&self) -> Result<bool>
Source§impl BaseMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
impl BaseMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
Source§impl BorrowingFeeMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl BorrowingFeeMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn borrowing_factor_pool(&self) -> Result<&Self::Pool>
fn borrowing_factor_pool(&self) -> Result<&Self::Pool>
Source§fn total_borrowing_pool(&self) -> Result<&Self::Pool>
fn total_borrowing_pool(&self) -> Result<&Self::Pool>
Source§fn borrowing_fee_params(&self) -> Result<BorrowingFeeParams<Self::Num>>
fn borrowing_fee_params(&self) -> Result<BorrowingFeeParams<Self::Num>>
Source§fn passed_in_seconds_for_borrowing(&self) -> Result<u64>
fn passed_in_seconds_for_borrowing(&self) -> Result<u64>
Source§fn borrowing_fee_kink_model_params(
&self,
) -> Result<BorrowingFeeKinkModelParams<Self::Num>>
fn borrowing_fee_kink_model_params( &self, ) -> Result<BorrowingFeeKinkModelParams<Self::Num>>
Source§impl Clone for MarketModel
impl Clone for MarketModel
Source§fn clone(&self) -> MarketModel
fn clone(&self) -> MarketModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MarketModel
impl Debug for MarketModel
Source§impl Deref for MarketModel
impl Deref for MarketModel
Source§impl LiquidityMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl LiquidityMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn total_supply(&self) -> Self::Num
fn total_supply(&self) -> Self::Num
Source§impl LiquidityMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
impl LiquidityMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
Source§impl PerpMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl PerpMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn funding_factor_per_second(&self) -> &Self::Signed
fn funding_factor_per_second(&self) -> &Self::Signed
Source§fn funding_amount_per_size_pool(&self, is_long: bool) -> Result<&Self::Pool>
fn funding_amount_per_size_pool(&self, is_long: bool) -> Result<&Self::Pool>
Source§fn claimable_funding_amount_per_size_pool(
&self,
is_long: bool,
) -> Result<&Self::Pool>
fn claimable_funding_amount_per_size_pool( &self, is_long: bool, ) -> Result<&Self::Pool>
Source§fn funding_amount_per_size_adjustment(&self) -> Self::Num
fn funding_amount_per_size_adjustment(&self) -> Self::Num
Source§fn funding_fee_params(&self) -> Result<FundingFeeParams<Self::Num>>
fn funding_fee_params(&self) -> Result<FundingFeeParams<Self::Num>>
Source§fn position_params(&self) -> Result<PositionParams<Self::Num>>
fn position_params(&self) -> Result<PositionParams<Self::Num>>
Source§fn min_collateral_factor_for_open_interest_multiplier(
&self,
is_long: bool,
) -> Result<Self::Num>
fn min_collateral_factor_for_open_interest_multiplier( &self, is_long: bool, ) -> Result<Self::Num>
Source§fn liquidation_fee_params(&self) -> Result<LiquidationFeeParams<Self::Num>>
fn liquidation_fee_params(&self) -> Result<LiquidationFeeParams<Self::Num>>
Source§impl PerpMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
impl PerpMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>
fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>
Source§fn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed
fn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed
Source§fn open_interest_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>
fn open_interest_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>
Source§fn open_interest_in_tokens_pool_mut(
&mut self,
is_long: bool,
) -> Result<&mut Self::Pool>
fn open_interest_in_tokens_pool_mut( &mut self, is_long: bool, ) -> Result<&mut Self::Pool>
Source§fn funding_amount_per_size_pool_mut(
&mut self,
is_long: bool,
) -> Result<&mut Self::Pool>
fn funding_amount_per_size_pool_mut( &mut self, is_long: bool, ) -> Result<&mut Self::Pool>
Source§fn claimable_funding_amount_per_size_pool_mut(
&mut self,
is_long: bool,
) -> Result<&mut Self::Pool>
fn claimable_funding_amount_per_size_pool_mut( &mut self, is_long: bool, ) -> Result<&mut Self::Pool>
Source§fn collateral_sum_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>
fn collateral_sum_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>
Source§fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>
fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>
Source§impl PositionImpactMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl PositionImpactMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn position_impact_pool(&self) -> Result<&Self::Pool>
fn position_impact_pool(&self) -> Result<&Self::Pool>
Source§fn position_impact_params(&self) -> Result<PriceImpactParams<Self::Num>>
fn position_impact_params(&self) -> Result<PriceImpactParams<Self::Num>>
Source§fn position_impact_distribution_params(
&self,
) -> Result<PositionImpactDistributionParams<Self::Num>>
fn position_impact_distribution_params( &self, ) -> Result<PositionImpactDistributionParams<Self::Num>>
Source§fn passed_in_seconds_for_position_impact_distribution(&self) -> Result<u64>
fn passed_in_seconds_for_position_impact_distribution(&self) -> Result<u64>
Source§impl PositionImpactMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
impl PositionImpactMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
Source§impl SwapMarket<{ constants::MARKET_DECIMALS }> for MarketModel
impl SwapMarket<{ constants::MARKET_DECIMALS }> for MarketModel
Source§fn swap_impact_params(&self) -> Result<PriceImpactParams<Self::Num>>
fn swap_impact_params(&self) -> Result<PriceImpactParams<Self::Num>>
Source§impl SwapMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
impl SwapMarketMut<{ constants::MARKET_DECIMALS }> for MarketModel
Auto Trait Implementations§
impl Freeze for MarketModel
impl RefUnwindSafe for MarketModel
impl Send for MarketModel
impl Sync for MarketModel
impl Unpin for MarketModel
impl UnwindSafe for MarketModel
Blanket Implementations§
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>
Source§fn open_interest(&self) -> Result<Merged<&Self::Pool, &Self::Pool>, Error>
fn open_interest(&self) -> Result<Merged<&Self::Pool, &Self::Pool>, Error>
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>
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>
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>
Source§fn validate_pool_amount(&self, is_long_token: bool) -> Result<(), Error>
fn validate_pool_amount(&self, is_long_token: bool) -> Result<(), Error>
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>
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>
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>
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>
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>
Source§fn expected_min_token_balance_excluding_collateral_amount_for_one_token_side(
&self,
is_long_side: bool,
) -> Result<Self::Num, Error>
fn expected_min_token_balance_excluding_collateral_amount_for_one_token_side( &self, is_long_side: bool, ) -> Result<Self::Num, Error>
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
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>
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>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§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>
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>
Source§fn market_token_value(
&self,
amount: &Self::Num,
prices: &Prices<Self::Num>,
pnl_factor: PnlFactorKind,
maximize: bool,
) -> Result<Option<MarketTokenValue<Self::Num>>, Error>
fn market_token_value( &self, amount: &Self::Num, prices: &Prices<Self::Num>, pnl_factor: PnlFactorKind, maximize: bool, ) -> Result<Option<MarketTokenValue<Self::Num>>, Error>
None.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>
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>,
Source§impl<M, const DECIMALS: u8> PerpMarketExt<DECIMALS> for Mwhere
M: PerpMarket<DECIMALS>,
impl<M, const DECIMALS: u8> PerpMarketExt<DECIMALS> for Mwhere
M: PerpMarket<DECIMALS>,
Source§fn funding_fee_amount_per_size(
&self,
is_long: bool,
is_long_collateral: bool,
) -> Result<Self::Num, Error>
fn funding_fee_amount_per_size( &self, is_long: bool, is_long_collateral: bool, ) -> Result<Self::Num, Error>
Source§fn claimable_funding_fee_amount_per_size(
&self,
is_long: bool,
is_long_collateral: bool,
) -> Result<Self::Num, Error>
fn claimable_funding_fee_amount_per_size( &self, is_long: bool, is_long_collateral: bool, ) -> Result<Self::Num, Error>
Source§fn validate_open_interest_reserve(
&self,
prices: &Prices<Self::Num>,
is_long: bool,
) -> Result<(), Error>
fn validate_open_interest_reserve( &self, prices: &Prices<Self::Num>, is_long: bool, ) -> Result<(), Error>
Source§fn min_collateral_factor_for_open_interest(
&self,
delta: &Self::Signed,
is_long: bool,
) -> Result<Self::Num, Error>
fn min_collateral_factor_for_open_interest( &self, delta: &Self::Signed, is_long: bool, ) -> Result<Self::Num, Error>
Source§impl<M, const DECIMALS: u8> PerpMarketMutExt<DECIMALS> for Mwhere
M: PerpMarketMut<DECIMALS>,
impl<M, const DECIMALS: u8> PerpMarketMutExt<DECIMALS> for Mwhere
M: PerpMarketMut<DECIMALS>,
Source§fn update_funding(
&mut self,
prices: &Prices<Self::Num>,
) -> Result<UpdateFundingState<&mut Self, DECIMALS>, Error>where
Self: Sized,
fn update_funding(
&mut self,
prices: &Prices<Self::Num>,
) -> Result<UpdateFundingState<&mut Self, DECIMALS>, Error>where
Self: Sized,
UpdateFundingState action.Source§fn apply_delta_to_funding_amount_per_size(
&mut self,
is_long: bool,
is_long_collateral: bool,
delta: &Self::Signed,
) -> Result<(), Error>
fn apply_delta_to_funding_amount_per_size( &mut self, is_long: bool, is_long_collateral: bool, delta: &Self::Signed, ) -> Result<(), Error>
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>
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,
DistributePositionImpact action.