pub trait PerpMarketMut<const DECIMALS: u8>:
SwapMarketMut<DECIMALS>
+ PositionImpactMarketMut<DECIMALS>
+ PerpMarket<DECIMALS> {
// Required methods
fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>;
fn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed;
fn open_interest_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>;
fn 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>;
fn collateral_sum_pool_mut(
&mut self,
is_long: bool,
) -> Result<&mut Self::Pool>;
fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>;
// Provided method
fn on_insufficient_funding_fee_payment(
&mut self,
_paid_in_collateral_amount: &Self::Num,
_cost_amount: &Self::Num,
) -> Result<()> { ... }
}
Expand description
A mutable perpetual market.
Required Methods§
Sourcefn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>
fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>
Get the just passed time in seconds for the given kind of clock.
Sourcefn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed
fn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed
Get funding factor per second mutably.
Sourcefn 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>
Get mutable reference of open interest pool.
§Requirements
- This method must return
Ok
ifBaseMarket::open_interest_pool
does.
Sourcefn 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>
Get mutable reference of open interest pool.
§Requirements
- This method must return
Ok
ifBaseMarket::open_interest_in_tokens_pool
does.
Sourcefn 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>
Get funding amount per size pool mutably.
§Requirements
- This method must return
Ok
ifPerpMarket::funding_amount_per_size_pool
does.
Sourcefn 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>
Get claimable funding amount per size pool mutably.
§Requirements
- This method must return
Ok
ifPerpMarket::claimable_funding_amount_per_size_pool
does.
Sourcefn 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>
Get collateral sum pool mutably.
§Requirements
- This method must return
Ok
ifBaseMarket::collateral_sum_pool
does.
Sourcefn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>
fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>
Get total borrowing pool mutably.
§Requirements
- This method must return
Ok
ifBorrowingFeeMarket::total_borrowing_pool
does.