[][src]Trait eq_bailsman::LtvChecker

pub trait LtvChecker<AccountId, Balance> where
    Balance: Member + Debug
{ fn calculate_ltv(
        owner: &AccountId,
        change: &SignedBalance<Balance>,
        currency: &Currency
    ) -> Result<FixedI128, DispatchError>;
fn check_ltv(
        owner: &AccountId,
        change: &SignedBalance<Balance>,
        currency: &Currency
    ) -> Result<bool, DispatchError>; }

LTV calculations and checks. LTV is a ratio of USD collateral value to USD debt value

Required methods

fn calculate_ltv(
    owner: &AccountId,
    change: &SignedBalance<Balance>,
    currency: &Currency
) -> Result<FixedI128, DispatchError>

Calculates owner LTV after his balance would change for change amount of currency

fn check_ltv(
    owner: &AccountId,
    change: &SignedBalance<Balance>,
    currency: &Currency
) -> Result<bool, DispatchError>

Checks if owner LTV would be acceptable after changing its balance for change amount of currency

Loading content...

Implementors

impl<T: Trait> LtvChecker<<T as Trait>::AccountId, <T as Trait>::Balance> for Module<T>[src]

Loading content...