Lending Pair

Events

Liquidation

Emitted on each liquidateAccount function call.

event Liquidation(
  address indexed account,
  address indexed repayToken,
  address indexed supplyToken,
  uint repayAmount,
  uint supplyAmount
)

Deposit

Emitted on any of the deposit function calls.

event Deposit(address indexed account, address indexed token, uint amount)

Withdraw

Emitted on any of the withdraw function calls.

event Withdraw(address account, address indexed token, uint amount)

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 / borrowBalanceof 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

Was this helpful?