[][src]Trait eq_bailsman::rate::InterestRateDataSource

pub trait InterestRateDataSource {
    type AccountId: Debug;
    fn get_settings() -> InterestRateSettings;
fn get_price(currency: &Currency) -> Result<FixedI64, DispatchError>;
fn get_covariance(c1: &Currency, c2: &Currency) -> FixedI64;
fn get_bailsman_total_balance(currency: &Currency) -> TotalBalance;
fn get_balance(
        account_id: &Self::AccountId,
        currency: &Currency
    ) -> TotalBalance;
fn get_total_balance(currency: &Currency) -> TotalBalance; }

Interface for receiving data required for Bailsman pallet fee calculations

Associated Types

type AccountId: Debug

Loading content...

Required methods

fn get_settings() -> InterestRateSettings

Gets bailsman fee settings

fn get_price(currency: &Currency) -> Result<FixedI64, DispatchError>

Gets currency price from oracle

fn get_covariance(c1: &Currency, c2: &Currency) -> FixedI64

Gets covariance value for currencies c1 and c2 from Volatility Pallet

fn get_bailsman_total_balance(currency: &Currency) -> TotalBalance

Gets aggregated USD value of collateral and debt for all bailsmen

fn get_balance(
    account_id: &Self::AccountId,
    currency: &Currency
) -> TotalBalance

Gets SignedBalance for account_id in given currency and converts it into TotalBalance used for calculations in Bailsman Pallet

fn get_total_balance(currency: &Currency) -> TotalBalance

Gets TotalAggregates for all user accounts and converts it into TotalBalance used for calculations in Bailsman Pallet

Loading content...

Implementors

impl<T: Trait> InterestRateDataSource for Module<T>[src]

type AccountId = T::AccountId

Loading content...