Comment on page
How To Use Witnet Price Feeds
The preferred way to consume the Witnet-powered price feeds is through the Price Feeds Router.
This smart contract is deployed in all the supported chains and allows your own smart contracts and Web3 applications to get the latest price of any of the supported currency pairs by providing the identifier of the pair to a single Solidity method. This removes the need to know the actual contract addresses handling the price updates from the Witnet oracle.
Alternatively, the Price Feeds Router also lets you find out the actual address of the Price Feed contract that is currently serving a specific currency pair (if that pair is supported in your chain).
Currency pairs are identified by a
bytes32value, calculated as the
keccak256hash of the currency pair caption. The caption is composed as the string concatenation of:
Price-, first asset denomination (e.g.
/, second asset denomination (e.g.
-, and the number of decimals.
For the sake of simplicity, currency pairs served by the Witnet's Price Router can also be identified by just using the first 4 bytes (see ID4 below) of the full
This table contains all the currency pairs that are currently being updated on a regular basis:
As introduced by the 2017 Witnet whitepaper, RADON is "a flow-based, tacit, point-free scripting language [...] implemented as a domain specific language (DSL), [... that] includes normalization and aggregation methods in a MapReduce style".
Basically, it specifies the math, filters, reducers and tally operator to apply to the values fetched from a set of given sources, as well as the witnessing thresholds and quality levels to be met by the Witnet oracle when solving the price update.