Hey everyone, to provide some additional insight to some of the questions raised on the dev call today in the Discord, I wanted to provide some data and analytics info to show that the integration work with Chainlink price feeds and Compound is working as expected without issue.
First to note, the UniswapAnchoredView (UAV) contract used here is the same UAV contract that is currently being used in-production by the Compound protocol. It uses the same logic of ingesting data from a reporter, checking it against the Uniswap V2 TWAP, and storing the price if it is within the deviation threshold. The only change has been switching the reporter from Coinbase to Chainlink price feeds and a conversion of the decimal spacing to align to what is already being used. Additionally, the deviation threshold between the reporter and Uniswap has been lowered from 20% to 15%, providing additional protection against any potential outlier data.
The deployed UAV contract address is 0x841616a5CBA946CF415Efe8a326A621A794D0f97 and the recent updates can be seen on the Etherscan events page. PriceUpdated() is an event emitted when the stored price is updated and PriceGuarded() is an event when new prices are posted but the stored price is not updated due to the anchor deviation. The contract is also open-source and has been verified on Etherscan. Additionally, the UAV contract has been audited by Trail of Bits and the ValidatorProxy contracts has been audited by SigmaPrime.
The Chainlink Price Feeds being used by the UAV are the same data feeds that are already being used by other DeFi projects like Syntheix and Aave, and have operated for many months without issue. This includes during the recent market crash and network congestion when gas prices on Ethereum mainnet spiked to 2,500 Gwei. A visualization for these feeds is available from data.chain.link, which displays data that is stored on-chain and can be cross-referenced with the contracts on Etherscan. Below are the contract addresses and Etherscan links to the events page for each price feed which delivers data to the UAV through the ValidatorProxy contracts.
ETH/USD:
- Aggregator: 0x37bC7498f4FF12C19678ee8fE19d713b87F6a9e6
- ValidatorProxy: 0x264BDDFD9D93D48d759FBDB0670bE1C6fDd50236
- Chainlink Visual: data.chain.link/eth-usd
USDC/USD:
- Hardcoded at $1
DAI/USD:
- Aggregator: 0xDEc0a100eaD1fAa37407f0Edc76033426CF90b82
- ValidatorProxy: 0xb2419f587f497CDd64437f1B367E2e80889631ea
- Chainlink Visual: data.chain.link/dai-usd
WBTC/USD:
- Aggregator: 0xAe74faA92cB67A95ebCAB07358bC222e33A34dA7
- ValidatorProxy: 0x4846efc15CC725456597044e6267ad0b3B51353E
- Chainlink Visual: data.chain.link/btc-usd
USDT/USD:
- Hardcoded at $1
UNI/USD:
- Aggregator: 0x68577f915131087199Fe48913d8b416b3984fd38
- ValidatorProxy: 0x70f4D236FD678c9DB41a52d28f90E299676d9D90
- Chainlink Visual: data.chain.link/uni-usd
COMP/USD:
- Aggregator: 0x6eaC850f531d0588c0114f1E93F843B78669E6d2
- ValidatorProxy: 0xE270B8E9d7a7d2A7eE35a45E43d17D56b3e272b1
- Chainlink Visual: data.chain.link/comp-usd
ZRX/USD:
- Aggregator: 0x3d47eF9690Bd00C77c568b73140dC20F34453766
- ValidatorProxy: 0x5c5db112c98dbe5977A4c37AD33F8a4c9ebd5575
- Chainlink Visual: data.chain.link/zrx-usd
BAT/USD:
- Aggregator: 0xd90CA9ac986e453CF51d958071D68B82d17a47E6
- ValidatorProxy: 0xeBa6F33730B9751a8BA0b18d9C256093E82f6bC2
- Chainlink Visual: data.chain.link/bat-usd
TUSD/USD:
- Hardcoded at $1
LINK/USD:
- Aggregator: 0xDfd03BfC3465107Ce570a0397b247F546a42D0fA
- ValidatorProxy: 0xBcFd9b1a97cCD0a3942f0408350cdc281cDCa1B1
- Chainlink Visual: data.chain.link/link-usd
SAI/USD:
- Hardcoded to 0.005285 ETH
REP/USD:
- Aggregator: 0x9AdF01321833A5Cba51B9f8A4C420C7e62481Ae5
- ValidatorProxy: 0x90655316479383795416B615B61282C72D8382C1
- Chainlink Visual: data.chain.link/rep-usd
Auditing the Chainlink Visualization Page
The values displayed on the Chainlink visualization page can be audited by using the Etherscan events tab on the Aggregator contract of each market (hyperlinks above). Each price feed update generates an AnswerUpdated() event, which has a field [topic1] containing the new value encoded in hexadecimal. This value can be converted into decimals to see the price data and divided by 10^8 to get the correct price with decimals to then compare against the data displayed on data.chain.link.
For example, on the BAT/USD feed, this update transaction has an index_topic_1 int256 current value of 0x0000000000000000000000000000000000000000000000000000000004ca1b37. When converting into decimal, this results in a value of 80354103. When divided by 10^8, this results in a value of 0.80354103. When looking at the BAT/USD visualization page, this same value is shown in USD form $0.80354103.
Ethtx.info does a nice job showing the execution trace and emitted events.
To showcase that the decimal conversion in the UAV contract is occurring as expected, here is output of a script showing a comparison of pricing data from the production open oracle system with Coinbase, the proposed UAV with Chainlink price feeds, and the market-wide price from CoinGecko.
Values retrieved at: 2021-06-02 18:15:10.727044
bat
production: 835071000000000000
proposed: 811253000000000000
coingecko: 806510000000000000
comp
production: 449050000000000000000
proposed: 447514145000000000000
coingecko: 448400000000000000000
dai
production: 1001271000000000000
proposed: 1001143000000000000
coingecko: 1000000000000000000
eth
production: 2772600000000000000000
proposed: 2768319267000000000000
coingecko: 2760569999999999934464
link
production: 30696265000000000000
proposed: 31272512000000000000
coingecko: 31260000000000000000
rep
production: 29540000000000000000
proposed: 26186473000000000000
coingecko: 26620000000000000000
sai
production: 14653191000000000000
proposed: 14630567000000000000
coingecko: 14070000000000000000
tusd
production: 1000000000000000000
proposed: 1000000000000000000
coingecko: 999673000000000000
uni
production: 27319550000000000000
proposed: 28170000000000000000
coingecko: 28170000000000000000
usdc
production: 1000000000000000000000000000000
proposed: 1000000000000000000000000000000
coingecko: 999315000000000000000000000000
usdt
production: 1000000000000000000000000000000
proposed: 1000000000000000000000000000000
coingecko: 1000000000000000000000000000000
btc
production: 380981900000000000000000000000000
proposed: 378318378280000000000000000000000
coingecko: 378790000000000002621440000000000
btc2
production: 380981900000000000000000000000000
proposed: 378318378280000000000000000000000
coingecko: 378790000000000002621440000000000
zrx
production: 1147138000000000000
proposed: 1149519000000000000
coingecko: 1149999999999999872
As shown above, the decimal placement is correct and the proposed price feeds closely tracks the market-wide CoinGecko price.
To check each asset’s token configuration in the UniswapAnchorView contract go to the current UAV and the proposed UAV to compare them. Each contract is verified on Etherscan. To verify the token configuration use Etherscan’s read contract functionality and one/all of the getTokenConfigBy functions.
The proposed UAV also has an “owner” who has the ability to engage the failover function. Chainlink transferred ownership of the proposed UAV to the Compound community multisig
If there is any additional information the community is interested in, let me know.