Chainlink Underlier Feed
Chainlink Oracle Implementation
The Chainlink Oracle acts as a wrapper over a Chainlink Data Feed by fetching the latest price for a single token. Each Chainlink Oracle is updating the spot price for an underlier used by the FIAT protocol.
List of deployed Chainlink Oracles:
- DAI Oracle
- USDC Oracle
- LUSD Oracle
In order to deploy a Chainlink Oracle we only need the address of the Data Feed:
chainlinkAggregatorAddress
- the address of the deployed chainlink aggregator contract
All of the initial parameters are
immutable
which means once they are set they can not be modified.Each specific oracle implementation must define the
Oracle.getValue()
function. This function is called when the global execution flow is triggered by the Relayer. To obtain the new price the Oracle will retrieve the latest data from the Chainlink Data Feed by calling the
latestRoundData()
. After the price is retrieved it is converted to an 18-digit fix-point number.These methods can be called by anyone:
underlierDecimals
Returns the decimal value for the Chainlink Data Feed.
chainlinkAggregatorAddress
Returns the address of the Chainlink Data Feed.
getValue
Computes and returns the spot price.
description
Retrieves and returns the description of the Chainlink Data Feed.
Last modified 1yr ago