LendingPool
The LendingPool contract is the main contract of the protocol. It exposes all the user-oriented actions that can be invoked using either Solidity or web3 libraries.
LendingPool methods deposit, depositNFTs, borrow, withdraw, withdrawNFTs, repay and liquidate are only for ERC20 and ERC721, if you want to deposit, depositNFTs, borrow, withdraw, withdrawNFTs or liquidate using native ETH use WETHGateway instead, and if you want to borrow or repay using CryptoPunks as collaterals use PunkGateway.
Method
deposit
Deposits an amount
of underlying asset into the reserve, receiving in return overlying TTokens. E.g. User deposits 10 ETH and gets in return 10 ETH_TTOKEN.
call params
depositNFTs
Deposits a underlying NFT asset into the NFT reserve, receiving in return overlying TERC721. E.g. User deposit 1 Azuki and gets in return 1 Azuki_TNFT.
call params
withdraw
Withdraws an amount of underlying asset from the reserve, burning the equivalent TTokens owned. E.g. User withdraws 10 ETH and burns 10 ETH_TTOKEN.
call params
withdrawNFTs
Withdraws an underlying NFT asset from the NFT reserve, burning the overlying TERC721 owned. E.g. User withdraws 1 Azuki and burns 1 Azuki_TNFT.
call params
borrow
Allows users to borrow a specific amount of the reserve underlying asset. E.g. User borrows 10 ETH, receiving the 10 ETH in his wallet and lock collateral asset in contract.
call params
repay
Repays a borrowed amount on a specific reserve, burning the equivalent loan owned. E.g. User repays 10 ETH, burning loan.
liquidate
Function to liquidate a non-healthy NFT loan. The caller (liquidator) buys collateral asset of the user getting liquidated and receives the collateral asset.
call params
View Method
getReserveNormalizedLiquidityScale
Returns the normalized income of the reserve.
getReserveNormalizedDebtScale
Returns the normalized variable debt per unit of asset.
getReserveData
Returns the state and configuration of the reserve.
return value
getNftReserveData
Returns the state and configuration of the NFT reserve.
return value
getReservesList
Returns the underlying address list of the initialized reserves and the NFT reserves.
getReserveConfiguration
Returns the configuration of the reserve.
call params
getUserConfig
Returns the configuration of the user.
getPoolValues
Return the borrowable liquidity, NFT liquidity and borrowable debt.
getAssetValues
Return the liquidity in ETH and the debt in ETH.
getUserState
Return the state and Configurator of the user.
return value
getUserAssetValues
Return the current supply, the current borrowed debt and the total collateral in ETH of these NFTs.
Last updated