Skip to Content
docs

Aave V3 Oracle Contract

The AaveOracle contract returns asset prices and manages price sources.

The source code is available on GitHub.

Write methods are restricted to POOL_ADMIN and ASSET_LISTING_ADMIN via the ACLManager.

AaveOracle

Write Methods

setAssetSources

Solidity
function setAssetSources(address[] calldata assets, address[] calldata sources) external override onlyAssetListingOrPoolAdmins

Sets the price sources for given list of assets.

Only callable by a POOL_ADMIN or ASSET_LISTING_ADMIN. See ACLManager for roles.

Input Parameters:

NameTypeDescription
assetsaddress[]The addresses of the assets for which source is being set
sourcesaddress[]The address of the source of each asset. Length of assets and sources array should be same

setFallbackOracle

Solidity
function setFallbackOracle(address fallbackOracle) external override onlyAssetListingOrPoolAdmins

Sets/updates the fallbackOracle.

Only callable by a POOL_ADMIN or ASSET_LISTING_ADMIN. See ACLManager for roles.

Input Parameters:

NameTypeDescription
fallbackOracleaddressThe address of the fallback oracle

View Methods

getAssetPrice

Solidity
function getAssetPrice(address asset) public view override returns (uint256)

Returns the price of the supported asset in BASE_CURRENCY of the Aave Market, scaled by BASE_CURRENCY_UNIT (8 decimals on USD markets).

Input Parameters:

NameTypeDescription
assetaddressThe address of the asset

Return Values:

TypeDescription
uint256The price of the asset in BASE_CURRENCY of the Aave market, scaled by BASE_CURRENCY_UNIT (8 decimals on USD markets)

getAssetsPrices

Solidity
function getAssetsPrices(address[] calldata assets) external view override returns (uint256[] memory)

Returns a list of prices from a list of the supported assets addresses in BASE_CURRENCY of the Aave Market. All prices are scaled by BASE_CURRENCY_UNIT (8 decimals on USD markets).

Input Parameters:

NameTypeDescription
assetsaddress[]The list of assets addresses for which price is being queried

Return Values:

TypeDescription
uint256[]The prices of the given assets in BASE_CURRENCY of the Aave market, scaled by BASE_CURRENCY_UNIT (8 decimals on USD markets)

getSourceOfAsset

Solidity
function getSourceOfAsset(address asset) external view override returns (address)

Returns the address of the price source for an asset address.

Input Parameters:

NameTypeDescription
assetaddressThe address of the asset

Return Values:

TypeDescription
addressThe address of the source

getFallbackOracle

Solidity
function getFallbackOracle() external view returns (address)

Returns the address of the fallback oracle.

Return Values:

TypeDescription
addressThe address of the fallback oracle

PriceOracleSentinel

Aave V3.7 removed the PriceOracleSentinel and its sequencer oracle. Borrows and liquidations are no longer gated by L2 sequencer uptime: borrows succeed when the standard checks pass, and liquidations proceed whenever the Health Factor is below 1 and the liquidation grace period has elapsed.

Some Aave V3 instances may still run Aave V3.6, where the sentinel can block borrows and delay liquidations after a sequencer outage. POOL_REVISION() on the Pool returns 10 on Aave V3.6 and 11 on Aave V3.7. See the Aave V3.6 source.