Trait PerpMarketMutExt

Source
pub trait PerpMarketMutExt<const DECIMALS: u8>: PerpMarketMut<DECIMALS> {
    // Provided methods
    fn update_funding(
        &mut self,
        prices: &Prices<Self::Num>,
    ) -> Result<UpdateFundingState<&mut Self, DECIMALS>>
       where Self: Sized { ... }
    fn apply_delta_to_funding_amount_per_size(
        &mut self,
        is_long: bool,
        is_long_collateral: bool,
        delta: &Self::Signed,
    ) -> Result<()> { ... }
    fn apply_delta_to_claimable_funding_amount_per_size(
        &mut self,
        is_long: bool,
        is_long_collateral: bool,
        delta: &Self::Signed,
    ) -> Result<()> { ... }
}
Expand description

Extension trait for PerpMarketMut.

Provided Methods§

Source

fn update_funding( &mut self, prices: &Prices<Self::Num>, ) -> Result<UpdateFundingState<&mut Self, DECIMALS>>
where Self: Sized,

Create a UpdateFundingState action.

Source

fn apply_delta_to_funding_amount_per_size( &mut self, is_long: bool, is_long_collateral: bool, delta: &Self::Signed, ) -> Result<()>

Apply delta to funding amount per size.

Source

fn apply_delta_to_claimable_funding_amount_per_size( &mut self, is_long: bool, is_long_collateral: bool, delta: &Self::Signed, ) -> Result<()>

Apply delta to claimable funding amount per size.

Implementors§

Source§

impl<M: PerpMarketMut<DECIMALS>, const DECIMALS: u8> PerpMarketMutExt<DECIMALS> for M