Trait PerpMarket

Source
pub trait PerpMarket<const DECIMALS: u8>:
    SwapMarket<DECIMALS>
    + PositionImpactMarket<DECIMALS>
    + BorrowingFeeMarket<DECIMALS> {
    // Required methods
    fn funding_factor_per_second(&self) -> &Self::Signed;
    fn 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>;
    fn funding_amount_per_size_adjustment(&self) -> Self::Num;
    fn funding_fee_params(&self) -> Result<FundingFeeParams<Self::Num>>;
    fn position_params(&self) -> Result<PositionParams<Self::Num>>;
    fn order_fee_params(&self) -> Result<FeeParams<Self::Num>>;
    fn min_collateral_factor_for_open_interest_multiplier(
        &self,
        is_long: bool,
    ) -> Result<Self::Num>;
    fn liquidation_fee_params(&self) -> Result<LiquidationFeeParams<Self::Num>>;
}
Expand description

A perpetual market.

Required Methods§

Source

fn funding_factor_per_second(&self) -> &Self::Signed

Get funding factor per second.

Source

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

Get funding amount per size pool.

Source

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

Get claimable funding amount per size pool.

Source

fn funding_amount_per_size_adjustment(&self) -> Self::Num

Adjustment factor for packing funding amount per size.

Source

fn funding_fee_params(&self) -> Result<FundingFeeParams<Self::Num>>

Get funding fee params.

Source

fn position_params(&self) -> Result<PositionParams<Self::Num>>

Get basic position params.

Source

fn order_fee_params(&self) -> Result<FeeParams<Self::Num>>

Get the order fee params.

Source

fn min_collateral_factor_for_open_interest_multiplier( &self, is_long: bool, ) -> Result<Self::Num>

Get min collateral factor for open interest multiplier.

Source

fn liquidation_fee_params(&self) -> Result<LiquidationFeeParams<Self::Num>>

Get liquidation fee params.

Implementations on Foreign Types§

Source§

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

Implementors§