FeedProjects
Developers
Settings
🎉 A new chapter begins: Boardroom has joined Agora
Learn more
protocol logo
Explore / Projects
Compound

Insights

Proposals

Discussions

Members

Information

Reports

Create Proposal

Compound

InsightsProposalsDiscussionsMembersInformationReports
Proposal
Back to Proposals
executedEnded 5 years ago ·  Onchain

Oracle Improvement

By 0x4ca7...a3801e

Introduction

This proposal will change the current oracle system from using Coinbase as the primary reporter of prices to Chainlink Price Feeds. Uniswap v2 is still used as an anchor (circuit breaker) and the anchor deviation window will change from 20% to 15%. As a precaution, the community multisig has the ability to engage a failover that will switch a market’s primary oracle from the current Price Feeds to Uniswap v2.

Proposal Call

Change the Comptroller oracle from 0x4007B71e01424b2314c020fB0344b03A7C499E1A to 0x841616a5CBA946CF415Efe8a326A621A794D0f97

Oracle Update Details

Each asset supported on the Compound market has a corresponding USD-paired price feed reference contract and a validatorProxy contract (which allows for the UniswapAnchorView (UAV) oracle contract to be updated by the community as new markets are added). When the reference contract of a Price Feed is updated by a decentralized network of oracle nodes with a new aggregated price value, the transmitter of that data also calls the validate() function on the market’s validatorProxy contract. When this function is called, the validatorProxy calls validate() on the UAV, which queries Uniswap v2 to check if the new price is within the Uniswap v2 TWAP anchor. If valid, the UAV is updated with the asset’s price. If invalid, the price data is not stored. Additional details on this process can be found in this comment here on the Compound forum.

Here is a visual example of how BAT/USD price feed is used, though this flow is the same for all asset markets.

The frequency of updates for each price feed depends on two triggers:

  • Deviation threshold - when the off-chain price of an asset is witnessed to have moved more than x% of the previously reported price, an on-chain update is initiated.

  • Heartbeat threshold - If x minutes have passed without an update, a new on-chain update is initiated.

More information can be found on data.chain.link. Example: ETH / USD.

Price update events can be witnessed on the Etherscan events tab.

The UniswapAnchorView token configuration has two additional fields: reporter & reporterMultiplier.

  • reporter: The address that submits prices for a particular cToken. This is always a ValidatorProxy contract that is always called by a price feed reference contract for each relevant price update posted by oracle nodes. In this case, 0xeBa6F33730B9751a8BA0b18d9C256093E82f6bC2 is the reporter of the price of BAT.

  • reporterMultiplier: Used to transform the price reported by the price feeds to the correct base unit that the UniswapAnchoredView expects. This is required because the price feeds report prices with different decimal placement than the UniswapAnchoredView.

Audit report: Trail of Bits was commissioned for audit of the contracts.ToB Audit report

Forum discussion and additional details: Oracle Infrastructure: Chainlink Proposal

Why

In late January I wrote on the forum “Compound NEEDS to improve the current oracle infrastructure as a matter of safety and growth. I think it is evident to users that the current solution is not ideal and not close to ideal. The event that occurred in November with Dai liquidations was preventable….In addition to preventing the November event from transpiring again, I think it is also in the protocol’s best interest to improve the oracle situation so Compound can safely support more assets.”

Five months, two forum threads, 114 forum replies, numerous calls, countless messages, and finally, we have a robust solution to improve the oracle system. This has been a long process, going over and re-reviewing many nuanced details with the community. Building in public is not always easy, but it was an insightful process and I am excited to see more assets on Compound. I look forward to continuing to improve the oracle system as the crypto landscape changes.

Continue Reading
Connect Wallet to Add Note
0
Votes 32
VoterCast PowerVote & Rationale
0x9AA8...62cCF1
345,000

FOR

0x4ca7...a3801e
307,031

FOR

0x6626...15c35c
126,085

FOR

0x54A3...61E189
100,080

FOR

0x1d29...Da5D1f
50,009

FOR

SHOW MORE
VOTE POWER
0
Connect Wallet
Proposal Status
  • Published Onchain 0x4ca7...a3801e
  • Wed June 16 2021, 08:47 pmVoting Period Starts
  • Sat June 19 2021, 10:20 pmEnd Voting Period
  • Sat June 19 2021, 10:22 pmQueue Proposal
  • Mon June 21 2021, 10:28 pmExecute Proposal
Current Results

1-FOR

1.171M

2-ABSTAIN

0.25

0%

3-AGAINST

N/A Tokens

0%
DocumentationBrandingContact Us