LendingPoolcontract is the main contract of the protocol. It exposes all the user-oriented actions that can be invoked using either Solidity or web3 libraries.
function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode)
assetinto the protocol, minting the same
amountof corresponding aTokens, and transferring them to the
function withdraw(address asset, uint256 amount, address to)
amountof the underlying
asset, i.e. redeems the underlying token and burns the aTokens.
function borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf)
interestRateMode, sending the
msg.sender, with the debt being incurred by
function repay(address asset, uint256 amount, uint256 rateMode, address onBehalfOf)
assetwhich has a
function swapBorrowRateMode(address asset, uint256 rateMode)
msg.sender's borrow rate modes between stable and variable.
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral)
msg.senderto be used as collateral or not.
function liquidationCall(address collateral, address debt, address user, uint256 debtToCover, bool receiveAToken)
debtToCoverparameter can be set to
uint(-1)and the protocol will proceed with the highest possible liquidation allowed by the close factor.
function flashLoan(address receiverAddress, address calldata assets, uint256 calldata amounts, uint256 modes, address onBehalfOf, bytes calldata params, uint16 referralCode)
receiverAddresscontract, passing the included
amounts+ fee is not returned by the end of the transaction, then the transaction will either:
onBehalfOfincurs a stable debt if
modeis 1, or
onBehalfOfincurs a variable debt if
function getReserveData(address asset)
function getUserAccountData(address user)
function getConfiguration(address asset)
function getUserConfiguration(address user)
function getReserveNormalizedIncome(address asset)
function getReserveNormalizedVariableDebt(address asset)
trueif the LendingPool is paused.