Trait PerpMarketMut

Source
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§

Source

fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>

Get the just passed time in seconds for the given kind of clock.

Source

fn funding_factor_per_second_mut(&mut self) -> &mut Self::Signed

Get funding factor per second mutably.

Source

fn open_interest_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>

Get mutable reference of open interest pool.

§Requirements
Source

fn open_interest_in_tokens_pool_mut( &mut self, is_long: bool, ) -> Result<&mut Self::Pool>

Get mutable reference of open interest pool.

§Requirements
Source

fn funding_amount_per_size_pool_mut( &mut self, is_long: bool, ) -> Result<&mut Self::Pool>

Get funding amount per size pool mutably.

§Requirements
Source

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
Source

fn collateral_sum_pool_mut(&mut self, is_long: bool) -> Result<&mut Self::Pool>

Get collateral sum pool mutably.

§Requirements
Source

fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>

Get total borrowing pool mutably.

§Requirements

Provided Methods§

Source

fn on_insufficient_funding_fee_payment( &mut self, _paid_in_collateral_amount: &Self::Num, _cost_amount: &Self::Num, ) -> Result<()>

Insufficient funding fee payment callback.

Implementations on Foreign Types§

Source§

impl<M: PerpMarketMut<DECIMALS>, const DECIMALS: u8> PerpMarketMut<DECIMALS> for &mut M

Source§

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>

Source§

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>

Source§

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>

Source§

fn total_borrowing_pool_mut(&mut self) -> Result<&mut Self::Pool>

Source§

fn just_passed_in_seconds_for_funding(&mut self) -> Result<u64>

Source§

fn on_insufficient_funding_fee_payment( &mut self, paid_in_collateral_amount: &Self::Num, cost_amount: &Self::Num, ) -> Result<()>

Implementors§