KVORUM
compoundSource: Compound governor bravo · #47

Oracle Improvement

executedJun 19, 2021, 10:20 PM UTCby4C0x4ca7…801e

01Summary

AISummary by Kvorumclaude-haiku-4-5

Replace Compound's oracle system from Coinbase-based pricing to Chainlink Price Feeds with Uniswap v2 as anchor circuit breaker, tightening the anchor deviation window from 20% to 15%, while enabling community multisig failover capability.

Type
protocol addition

Key changes

  • Switch primary oracle from Coinbase to Chainlink Price Feeds(high)
  • Tighten anchor deviation window from 20% to 15% using Uniswap v2 TWAP(high)
  • Implement community multisig failover mechanism to switch to Uniswap v2 in emergency(medium)
  • Add ValidatorProxy contracts for each supported asset to validate price feeds against Uniswap anchor(high)

Notable concerns

  • Oracle infrastructure change requires careful implementation to prevent price manipulation
  • Dependency on Chainlink network decentralization and oracle node reliability
  • Uniswap v2 anchor remains critical as fallback mechanism
Contracts0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b0x841616a5CBA946CF415Efe8a326A621A794D0f970x4007B71e01424b2314c020fB0344b03A7C499E1A
Generated by Kvorum
model: claude-haiku-4-5
provider: anthropic
profile: anthropic-fast-v1
prompt: v1.0
generated: 2mo ago
Read the description ↗

02Description

615 words

Oracle Improvement

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.

03Mismatch analysis

AIMismatch analysis by Kvorumclaude-sonnet-5
Consistent

The proposal contains a single on-chain action: a call to _setPriceOracle on the Comptroller, pointing it to the new oracle address 0x841616a5CBA946CF415Efe8a326A621A794D0f97. This exactly matches the 'Proposal Call' section of the description, which states the oracle is being switched to this same address. The description's additional claims (20%→15% anchor deviation window, multisig failover capability) are architectural properties baked into the new oracle contract itself (UniswapAnchoredView deployment), not separate governance actions requiring additional calldata — so their absence from the decoded actions is expected and does not constitute an omission. No numeric values, targets, or transfers in the calldata contradict the prose. The single action is fully and accurately represented by the description's primary call-to-action. Overall the description and calldata are consistent with high confidence.

Generated by Kvorum
model: claude-sonnet-5
provider: anthropic
profile: anthropic-strong-v1
prompt: v1.0
generated: 2mo ago
Review the decoded actions ↗

04Actions

1 total
#0_setPriceOracle(address)chain 0x1
Target
0x3d98…cd3b
Value
0 wei
Function
_setPriceOracle(address)
Arguments
{
  "0": "0x841616a5CBA946CF415Efe8a326A621A794D0f97"
}
Calldata

05Tally

Summed from votes

Voters0
VP participating0
Outcome (current)—
Current support—

06Voters

0 total

No votes recorded yet.

07Forum

No forum thread is confidently linked to this proposal.