Contract to get asset prices, manage price sources and update the fallback oracle.

Methods

View

getAssetPrice

function getAssetPrice(address asset)

Returns the price of the supported asset in BASE_CURRENCY of the HypurrFi Market in wei.

Return Value

TypeDescription
uint256Price in BASE_CURRENCY of the HypurrFi market in wei.

getAssetsPrices

function getAssetsPrices(address[] calldata assets)

Returns the prices of the supported assets in BASE_CURRENCY of the HypurrFi Market. All prices are in wei.

Call Params

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

Return Value

TypeDescription
uint256[]Prices in BASE_CURRENCY of the HypurrFi market in wei.

getSourceOfAsset

function getSourceOfAsset(address asset)

Returns the address of the price source for asset.

getFallbackOracle

function getFallbackOracle()

Returns the address of the fallback oracle.

Write

setAssetSources

function setAssetSources(address[] calldata assets, address[] calldata sources)

Sets the price source for given list of assets.

This method can be called only by POOL_ADMIN or ASSET_LISTING_ADMIN. Check [ACLManager] for details on system roles.

Call Params

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

function setFallbackOracle(address fallbackOracle)

Sets/updates the fallback oracle.

This method can be called only by POOL_ADMINorASSET_LISTING_ADMIN. Check [ACLManager] for details on system roles.

Call Params

NameTypeDescription
fallbackOracleaddressThe address of the fallback oracle.

ABI