LiquidationHelper

Git Source

Title: Liquidation helper

Author: Malda Protocol

View helper that computes whether a borrower can be liquidated and the repay amount.

Functions

getBorrowerPosition

Computes liquidation eligibility for a borrower on a market

function getBorrowerPosition(address borrower, address market)
    external
    view
    returns (bool shouldLiquidate, uint256 repayAmount);

Parameters

NameTypeDescription
borroweraddressAddress of the borrower
marketaddressMarket address implementing ImToken

Returns

NameTypeDescription
shouldLiquidateboolTrue if borrower is below collateral requirements
repayAmountuint256Max repay amount according to close factor