Contract Interactions

Public Functions

Mint

This function is responsible for taking in ERC20 tokens or native assets and dispatching lTokens which represent the supplied position

Redeem

This function is responsible for taking in lTokens and sending out the underlying asset back to the caller

RedeemUnderlying

Works exactly like Redeem, but instead allows you specify the amount of underlying tokens you'd like back (saving you from having to calculate/use the lToken exchangeRate)

Borrow

Borrows a specific amount of assets from the protocol - only allowed if you have supplied (minted) collateral and called enterMarket with it, and you have sufficient liquidity to borrow the requested asset

RepayBorrow

Repays a borrow position the caller owns within the market

RepayBorrowBehalf

Repays a borrow position on behalf of someone else

LiquidateBorrow

Liquidates a borrower's position who is underwater/has a heath factor below 1.

SweepToken

Sweeps accidentally sent ERC-20 tokens to the protocol admin

AddReserves

Add a specified amount of liquidity to the protocol's reserves

BalanceOfUnderlying

Get the balance of an lToken holder denominated in the underlying asset instead of the lToken balance (accruing interest and calculating the balance from the exchange rate)

GetAccountSnapshot

Gets a user's mTokenBalance, borrowBalance, and exchangeRateMantissa - useful for determining a user's current positions

BorrowRatePerTimestamp

Gets the borrower side interest rate per second on a specific market

SupplyRatePerTimestamp

Gets the supplier side interest rate per second on a specific market

TotalBorrowsCurrent

Gets the total amount of outstanding borrows for a market

Standard ERC-20 Functions

lTokens are ERC-20 complaint, so they expose the same interface around transfer, balanceOf, etc as any other ERC-20 token

Last updated