Trait cfg_traits::interest::RateCollection
source · pub trait RateCollection<Rate, Balance, NormalizedDebt> {
// Required method
fn current_debt(
&self,
interest_rate: &InterestRate<Rate>,
normalized_debt: NormalizedDebt
) -> Result<Balance, DispatchError>;
}
Expand description
A collection of pre-computed interest rates for performing interest accrual
Required Methods§
sourcefn current_debt(
&self,
interest_rate: &InterestRate<Rate>,
normalized_debt: NormalizedDebt
) -> Result<Balance, DispatchError>
fn current_debt( &self, interest_rate: &InterestRate<Rate>, normalized_debt: NormalizedDebt ) -> Result<Balance, DispatchError>
Calculate the current debt using normalized debt * cumulative rate