ThemisOracle
Last updated
Last updated
Contract to get asset prices, manage price sources and update the fallback oracle. Themis Protocol V2 uses Chainlink Aggregators as the source of all asset prices.
function getAssetPrice(address asset)
Returns the price of the supported asset in BASE_CURRENCY of the Themis Market in wei.
Type | Description |
---|---|
function getAssetsPrices(address[] calldata assets)
Returns the prices of the supported assets in BASE_CURRENCY of the Themis Market. All prices are in wei.
Name | Type | Description |
---|---|---|
function getSourceOfAsset(address asset)
Returns the address of the price source for asset
.
function getFallbackOracle()
Returns the address of the fallback oracle.
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.
function setFallbackOracle(address fallbackOracle)
Sets/updates the fallback oracle.
This method can be called only by POOL_ADMIN or ASSET_LISTING_ADMIN . CheckACLManagerfor details on system roles.
Type | Description |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
uint256
Price in BASE_CURRENCY of the Themis market in wei.
assets
address[]
The addresses of the assets for which price is being queried.
uint256[]
Prices in BASE_CURRENCY of the Themis market in wei.
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.
fallbackOracle
address
The address of the fallback oracle.