Skip to Content
docs

Aave V3 Pool Contract

This contract is the main user-facing contract. Most user interactions with the Aave Protocol occur via the Pool contract. It exposes the liquidity management methods that can be invoked using either Solidity or Web3 libraries.

Pool.sol allows users to:

  • Supply
  • Withdraw
  • Borrow
  • Repay
  • Enable/disable supplied assets as collateral
  • Liquidate positions
  • Execute Flash Loans

Pool is covered by a proxy contract and is owned by the PoolAddressesProvider of the specific market. All admin functions are callable by the PoolConfigurator contract defined in the PoolAddressesProvider.

The source code is available on GitHub.

Write Methods

initialize

Solidity
function initialize(IPoolAddressesProvider provider) external virtual

Initializes the Pool.

Function is invoked by the proxy contract when the Pool contract is added to the PoolAddressesProvider of the market.

Caches the address of the PoolAddressesProvider in order to reduce gas consumption on subsequent operations.

Input Parameters:

NameTypeDescription
provideraddressThe address of the PoolAddressesProvider

supply

Solidity
function supply(
    address asset,
    uint256 amount,
    address onBehalfOf,
    uint16 referralCode
) public virtual override

Supplies a certain amount of an asset into the protocol, minting the same amount of corresponding aTokens and transferring them to the onBehalfOf address. For example, if a user supplies 100 USDC and onBehalfOf address is the same as msg.sender, they will get 100 aUSDC in return.

The referralCode is emitted in Supply event and can be for third-party referral integrations. To activate the referral feature and obtain a unique referral code, integrators need to submit a proposal to Aave Governance.

The Pool needs an allowance() from msg.sender of at least the supply amount. Set it with ERC-20 approve() on the underlying token.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset being supplied to the pool
amountuint256The amount of asset to be supplied
onBehalfOfaddressThe address that will receive the corresponding aTokens. This is the only address that will be able to withdraw the asset from the pool. This will be the same as msg.sender if the user wants to receive aTokens into their own wallet, or use a different address if the beneficiary of aTokens is a different wallet
referralCodeuint16Referral supply is currently inactive, you can pass 0. This code is used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-men

supplyWithPermit

Solidity
function supplyWithPermit(
    address asset,
    uint256 amount,
    address onBehalfOf,
    uint16 referralCode,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
) public virtual override

Supply with transfer approval of the asset to be supplied via permit function. This method removes the need for separate approval tx before supplying asset to the pool. See EIP-2612.

Permit signature must be signed by msg.sender with spender as Pool address.

Input Parameters:

NameTypeDescription
assetaddressThe address of underlying asset being supplied. The same asset as used in permit v, s, and r
amountuint256The amount of asset to be supplied and signed for approval. The same amount as used in permit v, s, and r
onBehalfOfaddressThe address that will receive the aTokens. This will be the same as msg.sender if the user wants to receive aTokens into their own wallet, or use a different address if the beneficiary of aTokens is a different wallet
referralCodeuint16Referral supply is currently inactive, you can pass 0. This code is used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-men
deadlineuint256The unix timestamp up until which the permit signature is valid
permitVuint8The v parameter of the EIP-712 permit signature
permitRbytes32The r parameter of the EIP-712 permit signature
permitSbytes32The s parameter of the EIP-712 permit signature

withdraw

Solidity
function withdraw(address asset, uint256 amount, address to) public virtual override returns (uint256)

Withdraws an amount of underlying asset from the reserve, burning the equivalent aTokens owned. For example, if a user has 100 aUSDC and calls withdraw(), they will receive 100 USDC, burning the 100 aUSDC.

If user has any existing debt backed by the underlying token, then the maximum amount available to withdraw is the amount that will not leave user’s health factor < 1 after withdrawal.

When withdrawing to another address, msg.sender must hold the aToken that Pool burns. Before withdrawing other assets, disable 0% LTV reserves as collateral (with Pool.setUserUseReserveAsCollateral or a full withdrawal).

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset to withdraw, not the aToken
amountuint256The underlying amount to be withdrawn (the amount supplied), expressed in wei units. Use type(uint256).max to withdraw the entire aToken balance
toaddressThe address that will receive the underlying asset. This will be the same as msg.sender if the user wants to receive the tokens into their own wallet, or use a different address if the beneficiary is a different wallet

Return Values:

TypeDescription
uint256The final amount withdrawn

borrow

Solidity
function borrow(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    uint16 referralCode,
    address onBehalfOf
) public virtual override

Allows users to borrow a specific amount of the reserve underlying asset, provided the borrower has already supplied enough collateral, or they were given enough allowance by a credit delegator on the corresponding debt token (VariableDebtToken). For example, if a user borrows 100 USDC passing their own address as onBehalfOf, they will receive 100 USDC into their wallet and 100 variable debt tokens.

If onBehalfOf differs from msg.sender, onBehalfOf must have enough collateral via supply() and must delegate credit to msg.sender via approveDelegation().

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset to borrow
amountuint256The amount to be borrowed, expressed in wei units
interestRateModeuint256Should always be passed a value of 2 (variable rate mode)
referralCodeuint16Referral supply is currently inactive, you can pass 0. This code is used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-men
onBehalfOfaddressThis should be the address of the borrower calling the function if they want to borrow against their own collateral, or the address of the credit delegator if the caller has been given credit delegation allowance

repay

Solidity
function repay(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf
) public virtual override returns (uint256)

Repays a borrowed amount on a specific reserve, burning the equivalent debt tokens owned. For example, if a user repays 100 USDC, the 100 variable debt tokens owned by the onBehalfOf address will be burned.

msg.sender must first approve() the Pool on the underlying ERC-20 token for at least the repay amount.

Input Parameters:

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed
amountuint256The amount to repay, expressed in wei units. Use type(uint256).max in order to repay the whole debt, ONLY when the repayment is not executed on behalf of a 3rd party. In case of repayments on behalf of another user, it’s recommended to send an amount slightly higher than the current borrowed amount
interestRateModeuint256Only available option is 2 (variableRateMode)
onBehalfOfaddressThe address of the user who will get their debt reduced/removed. This should be the address of the user calling the function if they want to reduce/remove their own debt, or the address of any other borrower whose debt should be removed

repayWithPermit

Solidity
function repayWithPermit(
    address asset,
    uint256 amount,
    uint256 interestRateMode,
    address onBehalfOf,
    uint256 deadline,
    uint8 permitV,
    bytes32 permitR,
    bytes32 permitS
) public virtual override returns (uint256)

Repay with transfer approval of the borrowed asset to be repaid, done via permit function. This method removes the need for separate approval tx before repaying asset to the pool. See EIP-2612.

Permit signature must be signed by msg.sender with spender value as Pool address.

Input Parameters:

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed. The same asset as used in permit v, r, and s
amountuint256The amount to repay, expressed in wei units. Use type(uint256).max to repay the whole debt (only when repaying your own debt). The same amount as used in permit v, r, s
interestRateModeuint256Only available option is 2 (variableRateMode)
onBehalfOfaddressThe address of the user who will get their debt reduced/removed. This should be the address of the user calling the function if they want to reduce/remove their own debt, or the address of any other borrower whose debt should be removed
deadlineuint256The unix timestamp up until which the permit signature is valid
permitVuint8The v parameter of the EIP-712 permit signature
permitRbytes32The r parameter of the EIP-712 permit signature
permitSbytes32The s parameter of the EIP-712 permit signature

Return Values:

TypeDescription
uint256The final amount repaid

repayWithATokens

Solidity
function repayWithATokens(address asset, uint256 amount, uint256 interestRateMode
) public virtual override returns (uint256)

Allows a user to repay a borrowed amount on a specific reserve using the reserve aTokens, burning the equivalent debt tokens. For example, a user repays 100 USDC using 100 aUSDC, burning 100 variable debt tokens. Passing type(uint256).max as the amount will clean up any residual aToken dust balance, if the user aToken balance is not enough to cover the whole debt.

Input Parameters:

NameTypeDescription
assetaddressThe address of the borrowed underlying asset previously borrowed
amountuint256The amount to repay. Use type(uint256).max in order to repay the whole debt for asset to pay without leaving aToken dust
interestRateModeuint256Only available option is 2 (variableRateMode)

Return Values:

TypeDescription
uint256The final amount repaid

setUserUseReserveAsCollateral

Solidity
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) public virtual override

Allows suppliers to enable/disable a specific supplied asset as collateral. Sets the asset of msg.sender to be used as collateral or not.

  • In an isolated E-Mode category, only assets in its collateral bitmap can be enabled as collateral.
  • Assets with 0% LTV can’t be enabled as collateral.
  • With open debt, you can’t disable collateral if that drops the Health Factor below HEALTH_FACTOR_LIQUIDATION_THRESHOLD.

Input Parameters:

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

liquidationCall

Solidity
function liquidationCall(
    address collateralAsset,
    address debtAsset,
    address user,
    uint256 debtToCover,
    bool receiveAToken
) public virtual override

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

When the health factor of a position is below 1, the caller (liquidator) repays the debtToCover amount of debt of the user getting liquidated. This is part or all of the outstanding borrowed amount on behalf of the borrower. The caller then receives a proportional amount of the collateralAsset (discounted amount of collateral) plus a liquidation bonus to cover market risk.

Liquidators can decide if they want to receive an equivalent amount of collateral aTokens instead of the underlying asset. When the liquidation is completed successfully, the health factor of the position is increased, bringing the health factor above 1.

Liquidators can repay up to 50% of the user’s total debt. The full debt of the reserve can be liquidated when the health factor is at or below 0.95, or when the user’s collateral or debt in the reserve is worth less than 2,000 base currency units (USD on most markets). The liquidation discount applies to this amount. See Liquidations.

  • In most scenarios, profitable liquidators will choose to liquidate as much as they can.
  • debtToCover parameter can be set to type(uint256).max and the protocol will proceed with the highest possible liquidation allowed by the close factor.
  • To check a user’s health factor, use getUserAccountData().

Liquidators must approve() the Pool contract to use debtToCover of the underlying ERC-20 of the asset used for the liquidation.

Input 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 will repay
receiveATokenbooltrue if the liquidator wants to receive the aTokens equivalent of the purchased collateral, false if they want to receive the underlying collateral asset directly

flashLoan

Solidity
function flashLoan(
    address receiverAddress,
    address[] calldata assets,
    uint256[] calldata amounts,
    uint256[] calldata interestRateModes,
    address onBehalfOf,
    bytes calldata params,
    uint16 referralCode
) public virtual override

Allows users to access liquidity of the pool for a given list of assets within one transaction, as long as the amount taken plus a fee is returned. The receiver must approve the Pool contract for at least the amount borrowed + fee, otherwise the transaction will revert.

The flash loan fee is waived for approved FLASH_BORROWER.

Flash loan receiver contracts carry security risks. Read the Flash Loan Developers Guide first.

Input Parameters:

NameTypeDescription
receiverAddressaddressThe address of the contract receiving the flash-borrowed funds, implementing the IFlashLoanReceiver interface
assetsaddress[]The addresses of the assets being flash-borrowed
amountsuint256[]The amounts of the assets being flash-borrowed. This needs to contain the same number of entries as assets
interestRateModesuint256[]The types of the debt position to open if the flash loan is not returned: 0 -> Don’t open any debt, the amount + fee must be paid in this case or just revert if the funds can’t be transferred from the receiver. 2 -> Open variable rate borrow position for the value of the amount flash-borrowed to the onBehalfOf address
onBehalfOfaddressThe address that will receive the debt if the associated interestRateModes is 2. onBehalfOf must already have approved sufficient borrow allowance of the associated asset to msg.sender
paramsbytesVariadic packed params to pass to the receiver as extra information
referralCodeuint16Referral supply is currently inactive, you can pass 0. This code is used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-men

flashLoanSimple

Solidity
function flashLoanSimple(
    address receiverAddress,
    address asset,
    uint256 amount,
    bytes calldata params,
    uint16 referralCode
) public virtual override

Allows users to access liquidity of the pool for a given asset within one transaction, as long as the amount taken plus a fee is returned. The receiver must approve the Pool contract for at least the amount borrowed + fee, otherwise the transaction will revert.

This function does not waive the fee for approved FLASH_BORROWER, nor does it allow for opening a debt position instead of repaying.

Flash loan receiver contracts carry security risks. Read the Flash Loan Developers Guide first.

Input Parameters:

NameTypeDescription
receiverAddressaddressThe address of the contract receiving the flash-borrowed funds, implementing the IFlashLoanReceiver 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
referralCodeuint16Referral supply is currently inactive, you can pass 0. This code is used to register the integrator originating the operation, for potential rewards. 0 if the action is executed directly by the user, without any middle-men

mintToTreasury

Solidity
function mintToTreasury(address[] calldata assets) external virtual override

Mints the assets accrued through the reserve factor to the treasury in the form of aTokens for the given list of assets.

Input Parameters:

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

finalizeTransfer

Solidity
function finalizeTransfer(
    address asset,
    address from,
    address to,
    uint256 scaledAmount,
    uint256 scaledBalanceFromBefore
) external virtual override

Validates and finalizes an aToken transfer. It is only callable by the overlying aToken of the asset.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the aToken
fromaddressThe user from which the aTokens are transferred
toaddressThe user receiving the aTokens
scaledAmountuint256The scaled amount being transferred/withdrawn
scaledBalanceFromBeforeuint256The aToken scaled balance of the from user before the transfer

setUserEMode

Solidity
function setUserEMode(uint8 categoryId) external virtual override

Allows a user to use the protocol in efficiency mode. The category id must be a valid id already defined by Pool or Risk Admins.

Reverts if the user borrows an incompatible asset or if the change drops the Health Factor below HEALTH_FACTOR_LIQUIDATION_THRESHOLD.

Input Parameters:

NameTypeDescription
categoryIduint8The eMode category id (0 - 255) defined by Risk or Pool Admins. categoryId set to 0 is a non eMode category

initReserve

Solidity
function initReserve(
    address asset,
    address aTokenAddress,
    address variableDebtAddress
) external virtual override onlyPoolConfigurator

Initializes a reserve, activating it, assigning an aToken and debt tokens. All reserves share the interest rate strategy returned by RESERVE_INTEREST_RATE_STRATEGY().

Only callable by the PoolConfigurator contract.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve
aTokenAddressaddressThe address of the aToken that will be assigned to the reserve
variableDebtAddressaddressThe address of the VariableDebtToken that will be assigned to the reserve

setConfiguration

Solidity
function setConfiguration(address asset, DataTypes.ReserveConfigurationMap calldata configuration) external virtual override onlyPoolConfigurator

Sets the configuration bitmap of the reserve as a whole.

Only callable by the PoolConfigurator contract.

Input Parameters:

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

See the bit layout under getConfiguration.

updateFlashloanPremium

Solidity
function updateFlashloanPremium(uint128 flashLoanPremium) external virtual override onlyPoolConfigurator

Updates the flash loan premium. The protocol treasury collects the whole premium, which is calculated on the total borrowed amount.

Only callable by the PoolConfigurator contract.

Input Parameters:

NameTypeDescription
flashLoanPremiumuint128The flash loan premium, expressed in bps

configureEModeCategory

Solidity
function configureEModeCategory(uint8 id, DataTypes.EModeCategoryBaseConfiguration calldata category) external virtual override onlyPoolConfigurator

Configures a new eMode category or alters an existing one. In eMode, the protocol allows very high borrowing power to borrow assets of the same category. The category 0 is reserved for volatile heterogeneous assets and it’s always disabled.

Only callable by the PoolConfigurator contract.

Input Parameters:

NameTypeDescription
iduint8The id of the category
categoryDataTypes.EModeCategoryBaseConfigurationThe configuration of the category

The DataTypes.EModeCategoryBaseConfiguration struct is composed of the following fields:

NameTypeDescription
ltvuint16The custom Loan to Value for the eMode category
liquidationThresholduint16The custom liquidation threshold for the eMode category
liquidationBonusuint16The liquidation bonus for the eMode category
isolatedboolIf true, only assets in the category’s collateral bitmap contribute LTV (Aave V3.7)
labelstringThe custom label describing the eMode category

configureEModeCategoryIsolated

Solidity
function configureEModeCategoryIsolated(uint8 id, bool isolated) external virtual override onlyPoolConfigurator

Sets the isolated flag of an eMode category. When a category is isolated, users with collateral enabled on assets outside the category cannot enter it, and assets outside the category’s collateral bitmap are treated as LTV 0. Added in Aave V3.7.

Only callable by the PoolConfigurator contract.

Input Parameters:

NameTypeDescription
iduint8The id of the category
isolatedbooltrue if the eMode category is isolated

rescueTokens

Solidity
function rescueTokens(address token, address to, uint256 amount) external virtual override onlyPoolAdmin

Rescue and transfer tokens locked in this contract.

Only callable by the POOL_ADMIN role, which governance selects.

Input Parameters:

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

eliminateReserveDeficit

Solidity
function eliminateReserveDeficit(address asset, uint256 amount) external override onlyUmbrella returns (uint256)

Covers the deficit of a specified reserve by burning the equivalent aToken amount for assets with virtual accounting enabled or the equivalent amount of underlying for assets with virtual accounting disabled (e.g. GHO). Only callable by address with onlyUmbrella modifier.

Input Parameters:

NameTypeDescription
assetaddressUnderlying token address
amountuint256The amount to be covered, in aToken or underlying on non-virtual accounted assets

Return Values:

TypeDescription
uint256The amount of tokens burned

View Methods

getUserAccountData

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

Returns the user account data across all the reserves.

Input 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

getConfiguration

Solidity
function getConfiguration(address asset) external view virtual override returns (DataTypes.ReserveConfigurationMap memory)

Returns the configuration of the reserve.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values:

TypeDescription
DataTypes.ReserveConfigurationMapThe configuration of the reserve

The DataTypes.ReserveConfigurationMap struct is composed of the following fields:

bitDescription
0-15LTV
16-31Liquidation threshold
32-47Liquidation bonus
48-55Decimals
56Reserve is active
57Reserve is frozen
58Borrowing is enabled
59Deprecated Stable rate borrowing enabled
60Asset is paused
61Deprecated Borrowing in isolation mode is enabled
62Deprecated Siloed borrowing is enabled
63Flashloaning enabled
64-79Reserve factor
80-115Borrow cap in whole tokens, borrowCap == 0 => no cap
116-151Supply cap in whole tokens, supplyCap == 0 => no cap
152-167Liquidation protocol fee
168-175Deprecated EMode category
176-211Deprecated Unbacked mint cap
212-251Deprecated Debt ceiling for isolation mode
252Deprecated Virtual accounting is enabled
253-255Unused

getUserConfiguration

Solidity
function getUserConfiguration(address user) external view virtual override returns (DataTypes.UserConfigurationMap memory)

Returns the configuration of the user across all the reserves.

Input Parameters:

NameTypeDescription
useraddressThe user address

Return Values:

TypeDescription
DataTypes.UserConfigurationMapThe configuration of the user

The DataTypes.UserConfigurationMap struct is composed of the following fields:

NameTypeDescription
datauint256Bitmap of the user’s collaterals and borrows, two bits per reserve in getReservesList() order. For reserve index i, bit 2*i is set if the user borrows the reserve and bit 2*i+1 is set if the user uses it as collateral

For example, 0x40020 (binary 1000000000000100000) sets bit 5 and bit 18: bit 5 = 3rd reserve used as collateral, bit 18 = 10th reserve borrowed.

getReserveNormalizedIncome

Solidity
function getReserveNormalizedIncome(address asset) external view virtual override returns (uint256)

Returns the ongoing normalized income for the reserve.

A value of 1e27 means there is no income. As time passes, the yield is accrued. A value of 2*1e27 means for each unit of asset, one unit of income has been accrued.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values:

TypeDescription
uint256The reserve’s normalized income

getReserveNormalizedVariableDebt

Solidity
function getReserveNormalizedVariableDebt(address asset) external view virtual override returns (uint256)

Returns the normalized variable debt per unit of asset.

A value of 1e27 means there is no debt. As time passes, the debt is accrued. A value of 2*1e27 means that for each unit of debt, one unit worth of interest has been accumulated.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values:

TypeDescription
uint256The reserve normalized variable debt

getReservesList

Solidity
function getReservesList() external view virtual override returns (address[] memory)

Returns the list of the underlying assets of all the initialized reserves. It does not include dropped reserves.

Return Values:

TypeDescription
address[]The addresses of the underlying assets of the initialized reserves

getReserveAddressById

Solidity
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.

Input Parameters:

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

Return Values:

TypeDescription
addressThe address of the reserve associated with id

getEModeCategoryData

Solidity
function getEModeCategoryData(uint8 id) external view virtual override returns (DataTypes.EModeCategoryLegacy memory)

Returns the data of an eMode category.

Deprecated. Use the independent getters instead, such as getEModeCategoryCollateralConfig, getEModeCategoryLabel and getIsEModeCategoryIsolated.

Input Parameters:

NameTypeDescription
iduint8The id of the category

Return Values:

TypeDescription
DataTypes.EModeCategoryLegacyThe configuration data of the category

The DataTypes.EModeCategoryLegacy struct is composed of the following fields:

NameTypeDescription
ltvuint16The custom Loan to Value for the eMode category
liquidationThresholduint16The custom liquidation threshold for the eMode category
liquidationBonusuint16The liquidation bonus for the eMode category
priceSourceaddressDeprecated
labelstringThe custom label describing the eMode category

getIsEModeCategoryIsolated

Solidity
function getIsEModeCategoryIsolated(uint8 id) external view returns (bool)

Returns whether an eMode category is isolated. Added in Aave V3.7.

Input Parameters:

NameTypeDescription
iduint8The id of the category

Return Values:

TypeDescription
booltrue if the eMode category is isolated

getReserveData

Solidity
function getReserveData(address asset) external view virtual override returns (DataTypes.ReserveDataLegacy memory)

Returns the state and configuration of the reserve.

Input Parameters:

NameTypeDescription
assetaddressThe address of the underlying asset of the reserve

Return Values:

TypeDescription
DataTypes.ReserveDataLegacyThe state and configuration data of the reserve

The DataTypes.ReserveDataLegacy struct is composed of the following fields:

NameTypeDescription
configurationReserveConfigurationMapStores the reserve configuration
liquidityIndexuint128The yield generated by the reserve during time interval since lastUpdatedTimestamp. Expressed in ray
currentLiquidityRateuint128The current supply rate. Expressed in ray
variableBorrowIndexuint128The yield accrued by reserve during time interval since lastUpdatedTimestamp. Expressed in ray
currentVariableBorrowRateuint128The current variable borrow rate. Expressed in ray
currentStableBorrowRateuint128Deprecated in Aave V3.2
lastUpdateTimestampuint40The timestamp of when reserve data was last updated. Used for yield calculation
iduint16The id of the reserve. It represents the reserve’s position in the list of active reserves
aTokenAddressaddressThe address of associated aToken
stableDebtTokenAddressaddressDeprecated in Aave V3.2
variableDebtTokenAddressaddressThe address of associated variable debt token
interestRateStrategyAddressaddressDeprecated in Aave V3.4. Use RESERVE_INTEREST_RATE_STRATEGY() on the Pool
accruedToTreasuryuint128The current treasury balance (scaled)
unbackeduint128Deprecated in Aave V3.4
isolationModeTotalDebtuint128Deprecated in Aave V3.7

getUserEMode

Solidity
function getUserEMode(address user) external view virtual override returns (uint256)

Returns eMode the user is using. 0 is a non eMode category.

Input Parameters:

NameTypeDescription
useraddressThe address of the user

Return Values:

TypeDescription
uint256The eMode id

FLASHLOAN_PREMIUM_TOTAL

Solidity
function FLASHLOAN_PREMIUM_TOTAL() public view virtual override returns (uint128)

Returns the percent of total flashloan premium paid by the borrower. The whole premium is accrued to the treasury.

Return Values:

TypeDescription
uint128The total fee on flashloans

FLASHLOAN_PREMIUM_TO_PROTOCOL

Solidity
function FLASHLOAN_PREMIUM_TO_PROTOCOL() public view virtual override returns (uint128)

Returns the share of the flash loan premium sent to the treasury. Always 100_00 (100%) since Aave V3.4.

Return Values:

TypeDescription
uint128The share of the premium sent to the treasury, in bps

MAX_NUMBER_RESERVES

Solidity
function MAX_NUMBER_RESERVES() public view virtual override returns (uint16)

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

Return Values:

TypeDescription
uint16The maximum number of reserves supported

getLiquidationGracePeriod

Solidity
function getLiquidationGracePeriod(address asset) external view virtual override returns (uint40)

Returns the liquidation grace period of the given asset

Input Parameters:

NameTypeDescription
assetaddressUnderlying token address

Return Values:

TypeDescription
uint40Timestamp when the liquidation grace period will end

getReserveDeficit

Solidity
function getReserveDeficit(address asset) external view returns (uint256);

Returns the current deficit of a reserve.

Input Parameters:

NameTypeDescription
assetaddressUnderlying token address

Return Values:

TypeDescription
uint256Current reserve deficit from undercollateralized borrow positions

getReserveAToken

Solidity
function getReserveAToken(address asset) external view returns (address);

Returns the aToken address of a reserve.

Input Parameters:

NameTypeDescription
assetaddressUnderlying token address

Return Values:

TypeDescription
addressThe address of the AToken

getReserveVariableDebtToken

Solidity
function getReserveVariableDebtToken(address asset) external view returns (address);

Returns the variableDebtToken address of a reserve.

Input Parameters:

NameTypeDescription
assetaddressUnderlying token address

Return Values:

TypeDescription
addressThe address of the VariableDebtToken