Trait BorrowingFeeMarketExt

Source
pub trait BorrowingFeeMarketExt<const DECIMALS: u8>: BorrowingFeeMarket<DECIMALS> {
    // Provided methods
    fn cumulative_borrowing_factor(&self, is_long: bool) -> Result<Self::Num> { ... }
    fn borrowing_factor_per_second(
        &self,
        is_long: bool,
        prices: &Prices<Self::Num>,
    ) -> Result<Self::Num> { ... }
    fn next_cumulative_borrowing_factor(
        &self,
        is_long: bool,
        prices: &Prices<Self::Num>,
        duration_in_second: u64,
    ) -> Result<(Self::Num, Self::Num)> { ... }
    fn total_pending_borrowing_fees(
        &self,
        prices: &Prices<Self::Num>,
        is_long: bool,
    ) -> Result<Self::Num> { ... }
}
Expand description

Extension trait for BorrowingFeeMarket.

Provided Methods§

Source

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

Get current borrowing factor.

Source

fn borrowing_factor_per_second( &self, is_long: bool, prices: &Prices<Self::Num>, ) -> Result<Self::Num>

Get borrowing factor per second.

Source

fn next_cumulative_borrowing_factor( &self, is_long: bool, prices: &Prices<Self::Num>, duration_in_second: u64, ) -> Result<(Self::Num, Self::Num)>

Get next cumulative borrowing factor of the given side.

Source

fn total_pending_borrowing_fees( &self, prices: &Prices<Self::Num>, is_long: bool, ) -> Result<Self::Num>

Get total pending borrowing fees.

Implementors§

Source§

impl<M: BorrowingFeeMarket<DECIMALS> + ?Sized, const DECIMALS: u8> BorrowingFeeMarketExt<DECIMALS> for M