KVORUM
compoundSource: Compound governor bravo · #143

Compound UAV v3 Upgrade

executedJan 15, 2023, 12:47 PM UTCbyA60xa6e8…eef6

01Summary

AISummary by Kvorumclaude-haiku-4-5

Upgrade Compound II's price oracle from UniswapAnchoredView (UAV) v2 to UAV v3, which will update reference prices from Uniswap V2 pools to Uniswap V3 pools. The new oracle queries Uniswap V3's observe function for time-weighted average prices instead of maintaining its own observations.

Type
contract upgrade

Key changes

  • Replace price oracle contract with new UniswapAnchoredView v3 implementation at address 0x50ce56A3239671Ab62f185704Caedf626352741e(high)
  • Migrate from Uniswap V2 pool references to Uniswap V3 pools for price discovery(high)
  • Remove internal observation recording; instead query Uniswap V3 pool's observe function directly for time-weighted average prices(high)
  • Implement Uniswap V3 tick-based price calculation (price = 1.0001^tick) and add TickMath and FullMath libraries(high)
  • Increase Uniswap observation cardinality to 150 on pools below that threshold(medium)
  • Modify getUnderlyingPrice function to fetch token configuration using cToken address instead of calling underlying function(medium)
  • Update test suite to use Hardhat with forked mainnet instead of mocking Uniswap V3 pools(low)

Notable concerns

  • GFX Labs has not simulated the full outcome of the proposal themselves, though OpenZeppelin has reviewed it and Chainlink has thoroughly tested it
Contracts0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b0x50ce56A3239671Ab62f185704Caedf626352741e
Generated by Kvorum
model: claude-haiku-4-5
provider: anthropic
profile: anthropic-fast-v1
prompt: v1.0
generated: 2mo ago
Read the description ↗

02Description

276 words

Compound UAV v3 Upgrade

Details

Set new price oracle to 0x50ce56A3239671Ab62f185704Caedf626352741e

Info

GFX Labs is proposing on behalf of Chainlink to upgrade the Compound II UniswapAnchoredView (UAV) Oracle. The upgrade will update the UAV’s reference prices from Uniswap V2 pools to Uniswap V3 pools.

Forum Post

Updates include:

  • The new UniswapAnchoredView (UAV) no longer records and keeps observations but instead queries the respective Uniswap V3 pool’s observe function to get a TWATP with the set anchor period when it’s needed (i.e., when a reporter calls validate on the UAV).
  • The price of an asset in Uniswap V3 is a function of the “tick” of the pool. The formula is price = 1.0001^tick. The math required for conversion between posted prices and the Uniswap V3 TWATP and the UAV representation has been modified to support this. Relevant libraries (TickMath and FullMath) have been included from the Uniswap V3 codebase.
  • The tests from the original UAV have been adapted to the new Uniswap V3 architecture - i.e., observations/TWATP tests were removed. Hardhat (+typechain) has been implemented so real Uniswap V3 pools can be used via forked mainnet in tests and eliminate the need for mocking Uniswap V3 pools.
  • Increased the Uniswap observation cardinality to 150 on pools that were below 150.
  • Updated the getUnderlyingPrice function to fetch the token configuration using the cToken address instead of calling the underlying function from the token.

The community can review changes in PR14 and successful test results here. Please note that GFX Labs has not simulated the full outcome of the proposal, but OZ has reviewed it and Chainlink has thoroughly tested it.

03Mismatch analysis

AIMismatch analysis by Kvorumclaude-sonnet-5
Consistent

The proposal description states a single concrete on-chain action: setting a new price oracle address (0x50ce56A3239671Ab62f185704Caedf626352741e) via the Comptroller. The decoded calldata contains exactly one action, calling _setPriceOracle(address) with that exact address on the Comptroller contract. The address matches exactly (case differences aside, which are cosmetic), the function matches the described intent, and there is only one action, consistent with the description's single 'Details' bullet. The remainder of the description (background on UAV v3 architecture, TWATP math, cardinality increases, etc.) describes the off-chain code changes within the deployed oracle contract itself, not additional on-chain governance actions, so their absence from the calldata is expected and not a discrepancy — the oracle contract deployment and its internal logic are not something the governance proposal calldata would need to separately encode. No value, target, or function mismatches were found.

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": "0x50ce56A3239671Ab62f185704Caedf626352741e"
}
Calldata

05Tally

Summed from votes

Voters61
VP participating495.5K
Outcome (current)For
Current support100%

06Voters

61 total
Filter:
VoterChoice% of totalRationale
880x88fb…3981For90.8K18.32%—4y ago
8D0x8d07…a265For70K14.13%—4y ago
540x54a3…e189For57.6K11.62%—4y ago
A60xa6e8…eef6For55K11.10%—4y ago
7A0x7ae1…e585For50K10.09%—4y ago
B40xb49f…7948For50K10.09%—4y ago
070x0703…961bFor50K10.09%—4y ago
130x13bd…8548For50K10.09%—4y ago
0A0x0a09…b92eFor15K3.03%—4y ago
230x2380…b5f2For7.1K1.44%—4y ago
660x66cd…65f9For23.30.00%—4y ago
5C0x5cb3…a9b1For1.50.00%—4y ago
220x22b2…cf45For10.00%—4y ago
980x987f…e999For10.00%—4y ago
B20xb213…7d03For0.60.00%—4y ago
A10xa144…0fffFor0.50.00%—4y ago
F00xf0f7…a3c9For0.50.00%—4y ago
400x40f4…85f7For0.40.00%—4y ago
BC0xbc47…66deFor0.40.00%—4y ago
980x98a7…def8For0.30.00%—4y ago
D40xd44b…40acFor0.30.00%—4y ago
B20xb250…6a66For0.30.00%—4y ago
340x34a1…c888For0.30.00%—4y ago
320x32e1…8a9fFor0.30.00%—4y ago
960x9640…e6fcFor0.20.00%—4y ago
CF0xcf8e…e28bFor0.20.00%—4y ago
9C0x9c72…4d6eFor0.20.00%—4y ago
590x597f…aef1For0.20.00%—4y ago
220x2238…69c5For0.20.00%—4y ago
080x080a…68bbFor0.20.00%—4y ago
6D0x6d25…6fa9For0.20.00%—4y ago
A10xa1ca…619eFor0.20.00%—4y ago
D20xd2e1…2307For0.20.00%—4y ago
3A0x3aa5…2136For0.20.00%—4y ago
770x77ad…b5f1For0.20.00%—4y ago
920x92cb…617dFor0.10.00%—4y ago
550x55fb…ef4aFor0.10.00%—4y ago
0D0x0df6…9d19For0.10.00%—4y ago
9A0x9a3a…9538For0.10.00%—4y ago
780x78d0…7702For0.10.00%—4y ago
C00xc0b6…8d38For0.10.00%—4y ago
540x54c2…6fedAgainst0.10.00%—4y ago
810x8149…f4fcFor0.10.00%—4y ago
810x81aa…10a0For00.00%—4y ago
770x7713…0adaFor00.00%—4y ago
910x917b…8ad6For00.00%—4y ago
450x455d…099dFor00.00%—4y ago
B20xb2da…435cFor00.00%—4y ago
310x318f…2a13For00.00%—4y ago
000x00b6…3229For00.00%—4y ago
Showing 50

07Forum

AIForum synthesis by Kvorumclaude-sonnet-5
sentiment · favorablethread · constructive

Arguments for

  • The UAV oracle needs to follow the shift of liquidity from Uniswap V2 to V3 to reduce price manipulation risk and maintain reliability and security assurances.— CL_Michael
  • The upgrade has been thoroughly tested, including forked mainnet tests, comparisons between old and new UAV, and cToken price validations.— CL_Michael, cylon
  • OpenZeppelin independently ran separate simulations using Foundry and published testing scripts to confirm the fix is safe, given the past incident.— cylon
  • The changes have long-standing community consensus from a prior forum proposal and did not require a full CIP given prior review.— cylon
  • Morpho Labs independently performed additional integration testing of the new oracle contract and published results, adding further confidence.— MathisGD
  • The proposal makes sense and is worth supporting.— VonNeumann2022

Arguments against

None surfaced.

Unresolved concerns

  • The governance dashboard indicated no integration tests were run, and the reviewer could not find integration tests in the relevant PRs or repos, raising concern given the protocol manages billions of dollars.— elliot
  • Test scripts written for proposals are not normally published, which limits community ability to verify claims independently.— MathisGD, cylon
  • Existing test scenario coverage for v2 proposals is limited (only covering half the actions in the top 4 markets) and needs more sophistication.— jared
  • Ownership of the newly deployed oracle contract needed to be transferred from the deploying EOA to the Compound Community Multisig before execution could be considered complete.— elliot

Notable participants

  • CL_MichaelProposal author who detailed the technical upgrade, responded to testing concerns, and provided updates on passage and deprecation of the old UAV.
  • cylonOpenZeppelin representative who confirmed security review, published simulation scripts, and explained the CIP process rationale.
  • elliotSkeptical reviewer who raised concerns about missing integration tests and pointed out the need to transfer oracle ownership to the multisig.
  • MathisGDCommunity member (Morpho Labs) who requested more transparency on testing and contributed independent integration tests.
  • jaredMultisig signer who created example testing scenarios for v2 proposals to improve future confidence in simulations.
  • arr00Multisig signer who committed to processing the ownership transfer through the multisig.
  • VonNeumann2022Community member expressing brief support for the proposal.
Generated by Kvorum
model: claude-sonnet-5
provider: anthropic
profile: anthropic-strong-v1
prompt: v1.0
generated: 2mo ago
Open the thread ↗