Aave V3 Oracle Contract
The Aave contract returns asset prices and manages price sources.
The source code is available on GitHub.
Write methods are restricted to POOL_ and ASSET_ via the
ACLManager.
AaveOracle
Write Methods
setAssetSources
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_ or ASSET_. See
ACLManager for roles.
Input Parameters:
| Name | Type | Description |
|---|---|---|
| assets | address[] | The addresses of the assets for which source is being set |
| sources | address[] | The address of the source of each asset. Length of assets and sources array should be same |
setFallbackOracle
function setFallbackOracle(address fallbackOracle) external override onlyAssetListingOrPoolAdmins
Sets/updates the fallback.
Only callable by a POOL_ or ASSET_. See
ACLManager for roles.
Input Parameters:
| Name | Type | Description |
|---|---|---|
| fallbackOracle | address | The address of the fallback oracle |
View Methods
getAssetPrice
function getAssetPrice(address asset) public view override returns (uint256)
Returns the price of the supported asset in BASE_ of the Aave Market, scaled by BASE_ (8 decimals on USD markets).
Input Parameters:
| Name | Type | Description |
|---|---|---|
| asset | address | The address of the asset |
Return Values:
| Type | Description |
|---|---|
uint256 | The price of the asset in BASE_ of the Aave market, scaled by BASE_ (8 decimals on USD markets) |
getAssetsPrices
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_ of the Aave Market. All prices are scaled by BASE_ (8 decimals on USD markets).
Input Parameters:
| Name | Type | Description |
|---|---|---|
| assets | address[] | The list of assets addresses for which price is being queried |
Return Values:
| Type | Description |
|---|---|
uint256[] | The prices of the given assets in BASE_ of the Aave market, scaled by BASE_ (8 decimals on USD markets) |
getSourceOfAsset
function getSourceOfAsset(address asset) external view override returns (address)
Returns the address of the price source for an asset address.
Input Parameters:
| Name | Type | Description |
|---|---|---|
| asset | address | The address of the asset |
Return Values:
| Type | Description |
|---|---|
address | The address of the source |
getFallbackOracle
function getFallbackOracle() external view returns (address)
Returns the address of the fallback oracle.
Return Values:
| Type | Description |
|---|---|
address | The address of the fallback oracle |
PriceOracleSentinel
Aave V3.7 removed the Price 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_ on
the Pool returns 10 on Aave V3.6 and 11
on Aave V3.7. See the Aave V3.6
source.