Compound UAV v3 Upgrade
01Summary
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
Generated by Kvorum
02Description
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.
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
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
04Actions
- Target
- 0x3d98…cd3b
- Value
- 0 wei
- Function
- _setPriceOracle(address)
- Arguments
{ "0": "0x50ce56A3239671Ab62f185704Caedf626352741e" }- Calldata
05Tally
Summed from votes
06Voters
| Voter | Choice | % of total | Rationale | ||
|---|---|---|---|---|---|
| 880x88fb…3981 | For | 90.8K | 18.32% | — | 4y ago |
| 8D0x8d07…a265 | For | 70K | 14.13% | — | 4y ago |
| 540x54a3…e189 | For | 57.6K | 11.62% | — | 4y ago |
| A60xa6e8…eef6 | For | 55K | 11.10% | — | 4y ago |
| 7A0x7ae1…e585 | For | 50K | 10.09% | — | 4y ago |
| B40xb49f…7948 | For | 50K | 10.09% | — | 4y ago |
| 070x0703…961b | For | 50K | 10.09% | — | 4y ago |
| 130x13bd…8548 | For | 50K | 10.09% | — | 4y ago |
| 0A0x0a09…b92e | For | 15K | 3.03% | — | 4y ago |
| 230x2380…b5f2 | For | 7.1K | 1.44% | — | 4y ago |
| 660x66cd…65f9 | For | 23.3 | 0.00% | — | 4y ago |
| 5C0x5cb3…a9b1 | For | 1.5 | 0.00% | — | 4y ago |
| 220x22b2…cf45 | For | 1 | 0.00% | — | 4y ago |
| 980x987f…e999 | For | 1 | 0.00% | — | 4y ago |
| B20xb213…7d03 | For | 0.6 | 0.00% | — | 4y ago |
| A10xa144…0fff | For | 0.5 | 0.00% | — | 4y ago |
| F00xf0f7…a3c9 | For | 0.5 | 0.00% | — | 4y ago |
| 400x40f4…85f7 | For | 0.4 | 0.00% | — | 4y ago |
| BC0xbc47…66de | For | 0.4 | 0.00% | — | 4y ago |
| 980x98a7…def8 | For | 0.3 | 0.00% | — | 4y ago |
| D40xd44b…40ac | For | 0.3 | 0.00% | — | 4y ago |
| B20xb250…6a66 | For | 0.3 | 0.00% | — | 4y ago |
| 340x34a1…c888 | For | 0.3 | 0.00% | — | 4y ago |
| 320x32e1…8a9f | For | 0.3 | 0.00% | — | 4y ago |
| 960x9640…e6fc | For | 0.2 | 0.00% | — | 4y ago |
| CF0xcf8e…e28b | For | 0.2 | 0.00% | — | 4y ago |
| 9C0x9c72…4d6e | For | 0.2 | 0.00% | — | 4y ago |
| 590x597f…aef1 | For | 0.2 | 0.00% | — | 4y ago |
| 220x2238…69c5 | For | 0.2 | 0.00% | — | 4y ago |
| 080x080a…68bb | For | 0.2 | 0.00% | — | 4y ago |
| 6D0x6d25…6fa9 | For | 0.2 | 0.00% | — | 4y ago |
| A10xa1ca…619e | For | 0.2 | 0.00% | — | 4y ago |
| D20xd2e1…2307 | For | 0.2 | 0.00% | — | 4y ago |
| 3A0x3aa5…2136 | For | 0.2 | 0.00% | — | 4y ago |
| 770x77ad…b5f1 | For | 0.2 | 0.00% | — | 4y ago |
| 920x92cb…617d | For | 0.1 | 0.00% | — | 4y ago |
| 550x55fb…ef4a | For | 0.1 | 0.00% | — | 4y ago |
| 0D0x0df6…9d19 | For | 0.1 | 0.00% | — | 4y ago |
| 9A0x9a3a…9538 | For | 0.1 | 0.00% | — | 4y ago |
| 780x78d0…7702 | For | 0.1 | 0.00% | — | 4y ago |
| C00xc0b6…8d38 | For | 0.1 | 0.00% | — | 4y ago |
| 540x54c2…6fed | Against | 0.1 | 0.00% | — | 4y ago |
| 810x8149…f4fc | For | 0.1 | 0.00% | — | 4y ago |
| 810x81aa…10a0 | For | 0 | 0.00% | — | 4y ago |
| 770x7713…0ada | For | 0 | 0.00% | — | 4y ago |
| 910x917b…8ad6 | For | 0 | 0.00% | — | 4y ago |
| 450x455d…099d | For | 0 | 0.00% | — | 4y ago |
| B20xb2da…435c | For | 0 | 0.00% | — | 4y ago |
| 310x318f…2a13 | For | 0 | 0.00% | — | 4y ago |
| 000x00b6…3229 | For | 0 | 0.00% | — | 4y ago |
07Forum
- Upgrade Compound II’s Oracle to UAV3 ↗discourse · high confidence
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
08Similar proposals
- compoundexecutedCompound Oracle Upgrade v392%
- compoundexecutedUpgrade Compound v2 Oracle To Disable UAV88%
- compoundexecutedOracle Improvement78%
- compoundexecutedOpen Price Feed70%
- compoundexecutedOracle Update69%
- compounddefeatedAdd Market: MATIC & Update Price Oracle60%
- compoundexecutedAdd TUSD Support58%
- compoundexecutedAdd Market: USDP58%
- compoundexecutedAdd USDT Support58%
- compoundexecutedAdd LINK Support57%