Skip to main content

IPool

IPool​

Defines the basic interface for an Aave Pool.

MintUnbacked​

event MintUnbacked(address reserve, address user, address onBehalfOf, uint256 amount, uint16 referralCode)

Emitted on mintUnbacked()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address initiating the supply
onBehalfOfaddressThe beneficiary of the supplied assets, receiving the aTokens
amountuint256The amount of supplied assets
referralCodeuint16The referral code used

BackUnbacked​

event BackUnbacked(address reserve, address backer, uint256 amount, uint256 fee)

Emitted on backUnbacked()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
backeraddressThe address paying for the backing
amountuint256The amount added as backing
feeuint256The amount paid in fees

Supply​

event Supply(address reserve, address user, address onBehalfOf, uint256 amount, uint16 referralCode)

Emitted on supply()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address initiating the supply
onBehalfOfaddressThe beneficiary of the supply, receiving the aTokens
amountuint256The amount supplied
referralCodeuint16The referral code used

Withdraw​

event Withdraw(address reserve, address user, address to, uint256 amount)

Emitted on withdraw()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset being withdrawn
useraddressThe address initiating the withdrawal, owner of aTokens
toaddressThe address that will receive the underlying
amountuint256The amount to be withdrawn

Borrow​

event Borrow(address reserve, address user, address onBehalfOf, uint256 amount, enum DataTypes.InterestRateMode interestRateMode, uint256 borrowRate, uint16 referralCode)

Emitted on borrow() and flashLoan() when debt needs to be opened

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset being borrowed
useraddressThe address of the user initiating the borrow(), receiving the funds on borrow() or just initiator of the transaction on flashLoan()
onBehalfOfaddressThe address that will be getting the debt
amountuint256The amount borrowed out
interestRateModeenum DataTypes.InterestRateModeThe rate mode: 1 for Stable, 2 for Variable
borrowRateuint256The numeric rate at which the user has borrowed, expressed in ray
referralCodeuint16The referral code used

Repay​

event Repay(address reserve, address user, address repayer, uint256 amount, bool useATokens)

Emitted on repay()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe beneficiary of the repayment, getting his debt reduced
repayeraddressThe address of the user initiating the repay(), providing the funds
amountuint256The amount repaid
useATokensboolTrue if the repayment is done using aTokens, false if done with underlying asset directly

SwapBorrowRateMode​

event SwapBorrowRateMode(address reserve, address user, enum DataTypes.InterestRateMode interestRateMode)

Emitted on swapBorrowRateMode()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address of the user swapping his rate mode
interestRateModeenum DataTypes.InterestRateModeThe current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable

IsolationModeTotalDebtUpdated​

event IsolationModeTotalDebtUpdated(address asset, uint256 totalDebt)

Emitted on borrow(), repay() and liquidationCall() when using isolated assets

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
totalDebtuint256The total isolation mode debt for the reserve

UserEModeSet​

event UserEModeSet(address user, uint8 categoryId)

Emitted when the user selects a certain asset category for eMode

Parameters​

NameTypeDescription
useraddressThe address of the user
categoryIduint8The category id

ReserveUsedAsCollateralEnabled​

event ReserveUsedAsCollateralEnabled(address reserve, address user)

Emitted on setUserUseReserveAsCollateral()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address of the user enabling the usage as collateral

ReserveUsedAsCollateralDisabled​

event ReserveUsedAsCollateralDisabled(address reserve, address user)

Emitted on setUserUseReserveAsCollateral()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address of the user enabling the usage as collateral

RebalanceStableBorrowRate​

event RebalanceStableBorrowRate(address reserve, address user)

Emitted on rebalanceStableBorrowRate()

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
useraddressThe address of the user for which the rebalance has been executed

FlashLoan​

event FlashLoan(address target, address initiator, address asset, uint256 amount, enum DataTypes.InterestRateMode interestRateMode, uint256 premium, uint16 referralCode)

Emitted on flashLoan()

Parameters​

NameTypeDescription
targetaddressThe address of the flash loan receiver contract
initiatoraddressThe address initiating the flash loan
assetaddressThe address of the asset being flash borrowed
amountuint256The amount flash borrowed
interestRateModeenum DataTypes.InterestRateModeThe flashloan mode: 0 for regular flashloan, 1 for Stable debt, 2 for Variable debt
premiumuint256The fee flash borrowed
referralCodeuint16The referral code used

LiquidationCall​

event LiquidationCall(address collateralAsset, address debtAsset, address user, uint256 debtToCover, uint256 liquidatedCollateralAmount, address liquidator, bool receiveAToken)

Emitted when a borrower is liquidated.

Parameters​

NameTypeDescription
collateralAssetaddressThe address of the underlying asset used as collateral, to receive as result of the liquidation
debtAssetaddressThe address of the underlying borrowed asset to be repaid with the liquidation
useraddressThe address of the borrower getting liquidated
debtToCoveruint256The debt amount of borrowed asset the liquidator wants to cover
liquidatedCollateralAmountuint256The amount of collateral received by the liquidator
liquidatoraddressThe address of the liquidator
receiveATokenboolTrue if the liquidators wants to receive the collateral aTokens, false if he wants to receive the underlying collateral asset directly

ReserveDataUpdated​

event ReserveDataUpdated(address reserve, uint256 liquidityRate, uint256 stableBorrowRate, uint256 variableBorrowRate, uint256 liquidityIndex, uint256 variableBorrowIndex)

Emitted when the state of a reserve is updated.

Parameters​

NameTypeDescription
reserveaddressThe address of the underlying asset of the reserve
liquidityRateuint256The next liquidity rate
stableBorrowRateuint256The next stable borrow rate
variableBorrowRateuint256The next variable borrow rate
liquidityIndexuint256The next liquidity index
variableBorrowIndexuint256The next variable borrow index

MintedToTreasury​

event MintedToTreasury(address reserve, uint256 amountMinted)

Emitted when the protocol treasury receives minted aTokens from the accrued interest.

Parameters​

NameTypeDescription
reserveaddressThe address of the reserve
amountMinteduint256The amount minted to the treasury

mintUnbacked​

function mintUnbacked(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external

Mints an amount of aTokens to the onBehalfOf

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to mint
amountuint256The amount to mint
onBehalfOfaddressThe address that will receive the aTokens
referralCodeuint16Code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man

backUnbacked​

function backUnbacked(address asset, uint256 amount, uint256 fee) external returns (uint256)

Back the current unbacked underlying with amount and pay fee.

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to back
amountuint256The amount to back
feeuint256The amount paid in fees

Return Values​

NameTypeDescription
[0]uint256The backed amount

supply​

function supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external

Supplies an amount of underlying asset into the reserve, receiving in return overlying aTokens.

  • E.g. User supplies 100 USDC and gets in return 100 aUSDC

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to supply
amountuint256The amount to be supplied
onBehalfOfaddressThe address that will receive the aTokens, same as msg.sender if the user wants to receive them on his own wallet, or a different address if the beneficiary of aTokens is a different wallet
referralCodeuint16Code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man

supplyWithPermit​

function supplyWithPermit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode, uint256 deadline, uint8 permitV, bytes32 permitR, bytes32 permitS) external

Supply with transfer approval of asset to be supplied done via permit function see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to supply
amountuint256The amount to be supplied
onBehalfOfaddressThe address that will receive the aTokens, same as msg.sender if the user wants to receive them on his own wallet, or a different address if the beneficiary of aTokens is a different wallet
referralCodeuint16Code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man
deadlineuint256The deadline timestamp that the permit is valid
permitVuint8The V parameter of ERC712 permit sig
permitRbytes32The R parameter of ERC712 permit sig
permitSbytes32The S parameter of ERC712 permit sig

withdraw​

function withdraw(address asset, uint256 amount, address to) external returns (uint256)

Withdraws an amount of underlying asset from the reserve, burning the equivalent aTokens owned E.g. User has 100 aUSDC, calls withdraw() and receives 100 USDC, burning the 100 aUSDC

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to withdraw
amountuint256The underlying amount to be withdrawn - Send the value type(uint256).max in order to withdraw the whole aToken balance
toaddressThe address that will receive the underlying, same as msg.sender if the user wants to receive it on his own wallet, or a different address if the beneficiary is a different wallet

Return Values​

NameTypeDescription
[0]uint256The final amount withdrawn

borrow​

function borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf) external

Allows users to borrow a specific amount of the reserve underlying asset, provided that the borrower already supplied enough collateral, or he was given enough allowance by a credit delegator on the corresponding debt token (StableDebtToken or VariableDebtToken)

  • E.g. User borrows 100 USDC passing as onBehalfOf his own address, receiving the 100 USDC in his wallet and 100 stable/variable debt tokens, depending on the interestRateMode

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to borrow
amountuint256The amount to be borrowed
interestRateModeuint256The interest rate mode at which the user wants to borrow: 1 for Stable, 2 for Variable
referralCodeuint16The code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man
onBehalfOfaddressThe address of the user who will receive the debt. Should be the address of the borrower itself calling the function if he wants to borrow against his own collateral, or the address of the credit delegator if he has been given credit delegation allowance

repay​

function repay(address asset, uint256 amount, uint256 interestRateMode, address onBehalfOf) external returns (uint256)

Repays a borrowed amount on a specific reserve, burning the equivalent debt tokens owned

  • E.g. User repays 100 USDC, burning 100 variable/stable debt tokens of the onBehalfOf address

Parameters​

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed
amountuint256The amount to repay - Send the value type(uint256).max in order to repay the whole debt for asset on the specific debtMode
interestRateModeuint256The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
onBehalfOfaddressThe address of the user who will get his debt reduced/removed. Should be the address of the user calling the function if he wants to reduce/remove his own debt, or the address of any other other borrower whose debt should be removed

Return Values​

NameTypeDescription
[0]uint256The final amount repaid

repayWithPermit​

function repayWithPermit(address asset, uint256 amount, uint256 interestRateMode, address onBehalfOf, uint256 deadline, uint8 permitV, bytes32 permitR, bytes32 permitS) external returns (uint256)

Repay with transfer approval of asset to be repaid done via permit function see: https://eips.ethereum.org/EIPS/eip-2612 and https://eips.ethereum.org/EIPS/eip-713

Parameters​

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed
amountuint256The amount to repay - Send the value type(uint256).max in order to repay the whole debt for asset on the specific debtMode
interestRateModeuint256The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable
onBehalfOfaddressAddress of the user who will get his debt reduced/removed. Should be the address of the user calling the function if he wants to reduce/remove his own debt, or the address of any other other borrower whose debt should be removed
deadlineuint256The deadline timestamp that the permit is valid
permitVuint8The V parameter of ERC712 permit sig
permitRbytes32The R parameter of ERC712 permit sig
permitSbytes32The S parameter of ERC712 permit sig

Return Values​

NameTypeDescription
[0]uint256The final amount repaid

repayWithATokens​

function repayWithATokens(address asset, uint256 amount, uint256 interestRateMode) external returns (uint256)

Repays a borrowed amount on a specific reserve using the reserve aTokens, burning the equivalent debt tokens

  • E.g. User repays 100 USDC using 100 aUSDC, burning 100 variable/stable debt tokens

Passing uint256.max as amount will clean up any residual aToken dust balance, if the user aToken balance is not enough to cover the whole debt

Parameters​

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed
amountuint256The amount to repay - Send the value type(uint256).max in order to repay the whole debt for asset on the specific debtMode
interestRateModeuint256The interest rate mode at of the debt the user wants to repay: 1 for Stable, 2 for Variable

Return Values​

NameTypeDescription
[0]uint256The final amount repaid

swapBorrowRateMode​

function swapBorrowRateMode(address asset, uint256 interestRateMode) external

Allows a borrower to swap his debt between stable and variable mode, or vice versa

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset borrowed
interestRateModeuint256The current interest rate mode of the position being swapped: 1 for Stable, 2 for Variable

rebalanceStableBorrowRate​

function rebalanceStableBorrowRate(address asset, address user) external

Rebalances the stable interest rate of a user to the current stable rate defined on the reserve.

  • Users can be rebalanced if the following conditions are satisfied:
    1. Usage ratio is above 95%
    2. the current supply APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been borrowed at a stable rate and suppliers are not earning enough

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset borrowed
useraddressThe address of the user to be rebalanced

setUserUseReserveAsCollateral​

function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external

Allows suppliers to enable/disable a specific supplied asset as collateral

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset supplied
useAsCollateralboolTrue if the user wants to use the supply as collateral, false otherwise

liquidationCall​

function liquidationCall(address collateralAsset, address debtAsset, address user, uint256 debtToCover, bool receiveAToken) external

Function to liquidate a non-healthy position collateral-wise, with Health Factor below 1

  • The caller (liquidator) covers debtToCover amount of debt of the user getting liquidated, and receives a proportionally amount of the collateralAsset plus a bonus to cover market risk

Parameters​

NameTypeDescription
collateralAssetaddressThe address of the underlying asset used as collateral, to receive as result of the liquidation
debtAssetaddressThe address of the underlying borrowed asset to be repaid with the liquidation
useraddressThe address of the borrower getting liquidated
debtToCoveruint256The debt amount of borrowed asset the liquidator wants to cover
receiveATokenboolTrue if the liquidators wants to receive the collateral aTokens, false if he wants to receive the underlying collateral asset directly

flashLoan​

function flashLoan(address receiverAddress, address[] assets, uint256[] amounts, uint256[] interestRateModes, address onBehalfOf, bytes params, uint16 referralCode) external

Allows smartcontracts to access the liquidity of the pool within one transaction, as long as the amount taken plus a fee is returned.

IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/

Parameters​

NameTypeDescription
receiverAddressaddressThe address of the contract receiving the funds, implementing IFlashLoanReceiver interface
assetsaddress[]The addresses of the assets being flash-borrowed
amountsuint256[]The amounts of the assets being flash-borrowed
interestRateModesuint256[]Types of the debt to open if the flash loan is not returned: 0 -> Don't open any debt, just revert if funds can't be transferred from the receiver 1 -> Open debt at stable rate for the value of the amount flash-borrowed to the onBehalfOf address 2 -> Open debt at variable rate for the value of the amount flash-borrowed to the onBehalfOf address
onBehalfOfaddressThe address that will receive the debt in the case of using on modes 1 or 2
paramsbytesVariadic packed params to pass to the receiver as extra information
referralCodeuint16The code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man

flashLoanSimple​

function flashLoanSimple(address receiverAddress, address asset, uint256 amount, bytes params, uint16 referralCode) external

Allows smartcontracts to access the liquidity of the pool within one transaction, as long as the amount taken plus a fee is returned.

IMPORTANT There are security concerns for developers of flashloan receiver contracts that must be kept into consideration. For further details please visit https://docs.aave.com/developers/

Parameters​

NameTypeDescription
receiverAddressaddressThe address of the contract receiving the funds, implementing IFlashLoanSimpleReceiver interface
assetaddressThe address of the asset being flash-borrowed
amountuint256The amount of the asset being flash-borrowed
paramsbytesVariadic packed params to pass to the receiver as extra information
referralCodeuint16The code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man

getUserAccountData​

function getUserAccountData(address user) external view returns (uint256 totalCollateralBase, uint256 totalDebtBase, uint256 availableBorrowsBase, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)

Returns the user account data across all the reserves

Parameters​

NameTypeDescription
useraddressThe address of the user

Return Values​

NameTypeDescription
totalCollateralBaseuint256The total collateral of the user in the base currency used by the price feed
totalDebtBaseuint256The total debt of the user in the base currency used by the price feed
availableBorrowsBaseuint256The borrowing power left of the user in the base currency used by the price feed
currentLiquidationThresholduint256The liquidation threshold of the user
ltvuint256The loan to value of The user
healthFactoruint256The current health factor of the user

initReserve​

function initReserve(address asset, address aTokenAddress, address stableDebtAddress, address variableDebtAddress, address interestRateStrategyAddress) external

Initializes a reserve, activating it, assigning an aToken and debt tokens and an interest rate strategy

Only callable by the PoolConfigurator contract

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
aTokenAddressaddressThe address of the aToken that will be assigned to the reserve
stableDebtAddressaddressThe address of the StableDebtToken that will be assigned to the reserve
variableDebtAddressaddressThe address of the VariableDebtToken that will be assigned to the reserve
interestRateStrategyAddressaddressThe address of the interest rate strategy contract

dropReserve​

function dropReserve(address asset) external

Drop a reserve

Only callable by the PoolConfigurator contract

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

setReserveInterestRateStrategyAddress​

function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress) external

Updates the address of the interest rate strategy contract

Only callable by the PoolConfigurator contract

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
rateStrategyAddressaddressThe address of the interest rate strategy contract

setConfiguration​

function setConfiguration(address asset, struct DataTypes.ReserveConfigurationMap configuration) external

Sets the configuration bitmap of the reserve as a whole

Only callable by the PoolConfigurator contract

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
configurationstruct DataTypes.ReserveConfigurationMapThe new configuration bitmap

getConfiguration​

function getConfiguration(address asset) external view returns (struct DataTypes.ReserveConfigurationMap)

Returns the configuration of the reserve

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values​

NameTypeDescription
[0]struct DataTypes.ReserveConfigurationMapThe configuration of the reserve

getUserConfiguration​

function getUserConfiguration(address user) external view returns (struct DataTypes.UserConfigurationMap)

Returns the configuration of the user across all the reserves

Parameters​

NameTypeDescription
useraddressThe user address

Return Values​

NameTypeDescription
[0]struct DataTypes.UserConfigurationMapThe configuration of the user

getReserveNormalizedIncome​

function getReserveNormalizedIncome(address asset) external view returns (uint256)

Returns the normalized income of the reserve

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values​

NameTypeDescription
[0]uint256The reserve's normalized income

getReserveNormalizedVariableDebt​

function getReserveNormalizedVariableDebt(address asset) external view returns (uint256)

Returns the normalized variable debt per unit of asset

WARNING: This function is intended to be used primarily by the protocol itself to get a "dynamic" variable index based on time, current stored index and virtual rate at the current moment (approx. a borrower would get if opening a position). This means that is always used in combination with variable debt supply/balances. If using this function externally, consider that is possible to have an increasing normalized variable debt that is not equivalent to how the variable debt index would be updated in storage (e.g. only updates with non-zero variable debt supply)

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values​

NameTypeDescription
[0]uint256The reserve normalized variable debt

getReserveData​

function getReserveData(address asset) external view returns (struct DataTypes.ReserveData)

Returns the state and configuration of the reserve

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values​

NameTypeDescription
[0]struct DataTypes.ReserveDataThe state and configuration data of the reserve

finalizeTransfer​

function finalizeTransfer(address asset, address from, address to, uint256 amount, uint256 balanceFromBefore, uint256 balanceToBefore) external

Validates and finalizes an aToken transfer

Only callable by the overlying aToken of the asset

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset of the aToken
fromaddressThe user from which the aTokens are transferred
toaddressThe user receiving the aTokens
amountuint256The amount being transferred/withdrawn
balanceFromBeforeuint256The aToken balance of the from user before the transfer
balanceToBeforeuint256The aToken balance of the to user before the transfer

getReservesList​

function getReservesList() external view returns (address[])

Returns the list of the underlying assets of all the initialized reserves

It does not include dropped reserves

Return Values​

NameTypeDescription
[0]address[]The addresses of the underlying assets of the initialized reserves

getReserveAddressById​

function getReserveAddressById(uint16 id) external view returns (address)

Returns the address of the underlying asset of a reserve by the reserve id as stored in the DataTypes.ReserveData struct

Parameters​

NameTypeDescription
iduint16The id of the reserve as stored in the DataTypes.ReserveData struct

Return Values​

NameTypeDescription
[0]addressThe address of the reserve associated with id

ADDRESSES_PROVIDER​

function ADDRESSES_PROVIDER() external view returns (contract IPoolAddressesProvider)

Returns the PoolAddressesProvider connected to this contract

Return Values​

NameTypeDescription
[0]contract IPoolAddressesProviderThe address of the PoolAddressesProvider

updateBridgeProtocolFee​

function updateBridgeProtocolFee(uint256 bridgeProtocolFee) external

Updates the protocol fee on the bridging

Parameters​

NameTypeDescription
bridgeProtocolFeeuint256The part of the premium sent to the protocol treasury

updateFlashloanPremiums​

function updateFlashloanPremiums(uint128 flashLoanPremiumTotal, uint128 flashLoanPremiumToProtocol) external

Updates flash loan premiums. Flash loan premium consists of two parts:

  • A part is sent to aToken holders as extra, one time accumulated interest
  • A part is collected by the protocol treasury

The total premium is calculated on the total borrowed amount The premium to protocol is calculated on the total premium, being a percentage of flashLoanPremiumTotal Only callable by the PoolConfigurator contract

Parameters​

NameTypeDescription
flashLoanPremiumTotaluint128The total premium, expressed in bps
flashLoanPremiumToProtocoluint128The part of the premium sent to the protocol treasury, expressed in bps

configureEModeCategory​

function configureEModeCategory(uint8 id, struct DataTypes.EModeCategory config) external

Configures a new category for the eMode.

In eMode, the protocol allows very high borrowing power to borrow assets of the same category. The category 0 is reserved as it's the default for volatile assets

Parameters​

NameTypeDescription
iduint8The id of the category
configstruct DataTypes.EModeCategoryThe configuration of the category

getEModeCategoryData​

function getEModeCategoryData(uint8 id) external view returns (struct DataTypes.EModeCategory)

Returns the data of an eMode category

Parameters​

NameTypeDescription
iduint8The id of the category

Return Values​

NameTypeDescription
[0]struct DataTypes.EModeCategoryThe configuration data of the category

setUserEMode​

function setUserEMode(uint8 categoryId) external

Allows a user to use the protocol in eMode

Parameters​

NameTypeDescription
categoryIduint8The id of the category

getUserEMode​

function getUserEMode(address user) external view returns (uint256)

Returns the eMode the user is using

Parameters​

NameTypeDescription
useraddressThe address of the user

Return Values​

NameTypeDescription
[0]uint256The eMode id

resetIsolationModeTotalDebt​

function resetIsolationModeTotalDebt(address asset) external

Resets the isolation mode total debt of the given asset to zero

It requires the given asset has zero debt ceiling

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to reset the isolationModeTotalDebt

MAX_STABLE_RATE_BORROW_SIZE_PERCENT​

function MAX_STABLE_RATE_BORROW_SIZE_PERCENT() external view returns (uint256)

Returns the percentage of available liquidity that can be borrowed at once at stable rate

Return Values​

NameTypeDescription
[0]uint256The percentage of available liquidity to borrow, expressed in bps

FLASHLOAN_PREMIUM_TOTAL​

function FLASHLOAN_PREMIUM_TOTAL() external view returns (uint128)

Returns the total fee on flash loans

Return Values​

NameTypeDescription
[0]uint128The total fee on flashloans

BRIDGE_PROTOCOL_FEE​

function BRIDGE_PROTOCOL_FEE() external view returns (uint256)

Returns the part of the bridge fees sent to protocol

Return Values​

NameTypeDescription
[0]uint256The bridge fee sent to the protocol treasury

FLASHLOAN_PREMIUM_TO_PROTOCOL​

function FLASHLOAN_PREMIUM_TO_PROTOCOL() external view returns (uint128)

Returns the part of the flashloan fees sent to protocol

Return Values​

NameTypeDescription
[0]uint128The flashloan fee sent to the protocol treasury

MAX_NUMBER_RESERVES​

function MAX_NUMBER_RESERVES() external view returns (uint16)

Returns the maximum number of reserves supported to be listed in this Pool

Return Values​

NameTypeDescription
[0]uint16The maximum number of reserves supported

mintToTreasury​

function mintToTreasury(address[] assets) external

Mints the assets accrued through the reserve factor to the treasury in the form of aTokens

Parameters​

NameTypeDescription
assetsaddress[]The list of reserves for which the minting needs to be executed

rescueTokens​

function rescueTokens(address token, address to, uint256 amount) external

Rescue and transfer tokens locked in this contract

Parameters​

NameTypeDescription
tokenaddressThe address of the token
toaddressThe address of the recipient
amountuint256The amount of token to transfer

deposit​

function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) external

Supplies an amount of underlying asset into the reserve, receiving in return overlying aTokens.

  • E.g. User supplies 100 USDC and gets in return 100 aUSDC

Deprecated: Use the supply function instead

Parameters​

NameTypeDescription
assetaddressThe address of the underlying asset to supply
amountuint256The amount to be supplied
onBehalfOfaddressThe address that will receive the aTokens, same as msg.sender if the user wants to receive them on his own wallet, or a different address if the beneficiary of aTokens is a different wallet
referralCodeuint16Code used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-man