CIP-4: Upgrade Compound v2 Oracle To Disable UAV

OpenZeppelin Fork Test Report: UAV and Price Oracle v2

Through extensive testing on the Comptroller and UAV, we have verified that the following functions operate correctly with the new oracle contract:

  • Minting on various markets
  • Redeeming assets post-minting on these markets
  • Borrowing of unpaused assets
  • Repaying outstanding borrows
  • Execution of specific liquidation scenarios

Additionally, we have confirmed that both debt and credit accrual processes will continue to function seamlessly after the oracle transition.

However, it’s important to note the current state of fixed price feeds within the UAV.

  • Markets with a fixed ETH price:
    • SAI
  • Markets with a fixed USD price:
    • cUSDC
    • cUSDT
    • cTUSD
    • cUSDP

In the new price oracle, the price of SAI is fixed in USD. To replicate the behavior of SAI within the UAV, a multiplicative price feed would be required to calculate the asset’s price by multiplying the fixed SAI/ETH ratio with the live ETH/USD feed. There is a risk that the SAI prices between the UAV and the new price oracle may diverge as ETH/USD changes.

Although SAI is deprecated, Comptroller still relies on its actual value in certain scenarios, most important ones are:

  • To calculate if accounts are underwater: When a user has borrowed SAI, the protocol must be able to calculate the value of the borrowed asset to identify any accounts that are underwater.
  • To calculate seized tokens in liquidations: To calculated the amount of seized tokens in case the requested liquidation collateral is one of such assets.
  • For maintaining price validity: The price of any asset should never be zero, as this could brick key functionalities within the protocol.

Overall, we believe that Price Oracle v2 should function correctly as a replacement for the UAV. This has been verified through fork testing and extensive scenario analysis, ensuring that the transition to the new oracles will maintain the integrity and accuracy of the protocol’s pricing mechanisms.

1 Like