Lending Pair
Events
Liquidation
Emitted on each liquidateAccount
function call.
Deposit
Emitted on any of the deposit
function calls.
Withdraw
Emitted on any of the withdraw
function calls.
Borrow
Emitted on each borrow
function call.
Repay
Emitted on each repay
function call.
Read-only functions
debtOf
Borrowed token amount with interest for a given account. May not include currently pending interest.
totalDebt
Total debt with interest for a given token. May not include currently pending interest.
borrowBalanceConverted
Borrowed borrowToken
amount with interest for a given account
, converted into returnToken
token based on the liquidation current liquidation price. Does not include slippage. May not include pending interest.
supplyBalanceConverted
Borrowed suppliedToken
amount with interest for a given account
, converted into returnToken
token based on the current liquidation price. Does not include slippage. May not include pending interest.
accountHealth
Calculated as combined supplyBalance
/ borrowBalance
of both tokens. When below controller.liqMinHealth()
, the account may be liquidated.
convertTokenValues
ConvertfromToken
amount into toToken
amount based on the oracle prices.
State-modifying functions
deposit
Deposit token
to earn interest or to provide collateral for borrowing another token.
withdraw
Withdraw deposited token. If there is a positive borrowBalance
, the account must stay above required accountHealth
after calling this function.
withdrawAll
Withdraw the full supply balance + pending interest.
borrow
Borrow token
. The account must stay above required accountHealth
after calling this function. The account cannot borrow the same token it's currently supplying.
repay
Repay borrowed token
.
Last updated