Using Price Feeds
The Witnet's Price Feeds Router allows your smart contract, or Web3 application, to get the latest updated price value of any of the currency pairs subsidized by the Witnet Foundation, without needing to know the actual contract addresses in charge of requesting and receiving price updates from the Witnet oracle's sidechain.
Currency pairs are identified by a bytes32 value, calculated as the keccak256 hash of the currency pair caption. The caption is composed as the string concatenation of: Price-, first asset denomination (e.g. BTC), /, second asset denomination (e.g. USD), -, 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 bytes32 identifier (ID32).
From the Price Router you may also retrieve the Witnet's Price Feed contract that is currently serving a given currency pair, if any. While the Witnet Foundation will make its best to keep all committed currency pairs updated in a timely manner, you can always use the Price Feed contract to trigger a new price update at any time, if willing to pay the required gas for that.

Currency pairs

This table contains the currency pairs that are currently updated by the Witnet Foundation on a regular basis:
Caption
ID4
ID32
​Price-AVAX/USD-6​
0x356ba62f
0x356ba62f72df54463d38fa6850079d4ca77a035bd8f193f17b10e40d67638d57
​Price-BOBA/USDT-6​
0xf723bde1
0xf723bde14abbffbe1f7e4cc11b10fcffdeb0873cadb864d13ca5fe5fa83255af
0x3a9faa5a
0x3a9faa5a41fb4ac71aee7850eda9baeae8e35cd64977afa3eaad8bcca04658d6
​Price-BTC/USD-6​
0x24beead4
0x24beead43216e490aa240ef0d32e18c57beea168f06eabb94f5193868d500946
​Price-CELO/EUR-6​
0x21a79821
0x21a798210f2f9a59348801ac3dd2d6ba14edec757bd7bc1894181af90a7fd3a2
​Price-CELO/USD-6​
0x9ed884be
0x9ed884be27401b98a6c3e9d830d4288c949712e57a58235927b1a00dcd487073
​Price-CFX/USDT-6​
0x65784185
0x65784185a07d3add5e7a99a6ddd4477e3c8caad717bac3ba3c3361d99a978c29
​Price-CRO/USDT-6​
0x6b8258ca
0x6b8258ca2eb12b227a7f6a0962ad90723fb176285659b4dd6f755c1fc728a2ff
​Price-DAI/USD-6​
0x9899e356
0x9899e35601719f1348e09967349f72c7d04800f17c14992d6dcf2f17fac713ea
​Price-ETH/USD-6​
0x3d15f701
0x3d15f7018db5cc80838b684361aaa100bfadf8a11e02d5c1c92e9c6af47626c8
​Price-FRAX/USDT-6​
0x1a3ea43e
0x1a3ea43ec9fce5649302474844b0d2c0734ad605b3adfaf3baaab3b7ad43b1a4
​Price-FXS/USDT-6​
0x5a352c58
0x5a352c582f56d09a9d4372befee579d09061510e65d795c20901d53fa95fb9f3
​Price-GLINT/USD-6​
0x5825c341
0x5825c341b55f4565086205df4508d5c676990e84c479a70694d63fc781870ea0
​Price-GLINT/USDC-6​
0x38b57cfe
0x38b57cfe2aab9a063c4eaf8e57ad9f8319d106ef354cde5cf1c7575ba1c9757c
​Price-GLINT/USDT-6​
0x6d85fc1a
0x6d85fc1ab4e41a1fc4b751a289ad9e33e38534e48e98d1b2e11693cc03ede0fb
​Price-GLMR/USD-6​
0xbd1318d3
0xbd1318d300971b390ddfb28da684ad5f54c9ca1e30c4f71cdde3f2dcce9c6b83
​Price-GLMR/USDT-6​
0xe4cc70ab
0xe4cc70abfc7ab1836bb8f6dd4888b8c4aa6f3ad1d445d2c9886e5ae2750e7e14
​Price-IMMO/MCUSD-6​
0x1aa645a8
0x1aa645a8e8124b720e3f7dc5162efd386f327ea59f855b1afeb8ae4c54f6f8ab
​Price-KCS/USDT-6​
0x31debffc
0x492d115cec10a14a55ad4494b59ffba99eda5e5907632c9e51116c87ff1aa8db
Clicking on any of the captions above will take you to the Javascript equivalent of the RADON script that is processed by the Witnet oracle on every single price update of the corresponding currency pair.
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.
Copy link
Edit on GitHub