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.
This table contains all the currency pairs that are currently being updated on a regular basis: