comet icon indicating copy to clipboard operation
comet copied to clipboard

Price feeds for WETH deployment

Open kevincheng96 opened this issue 2 years ago • 4 comments

This PR implements and modifies price feeds to support the upcoming WETH deployment. The favored plan so far is to use ETH-denominated price feeds as opposed to USD price feeds, but stick with using 8 decimals for prices to avoid having to change the Comet and Configurator implementations.

This would require:

  • A new wrapper price feed (ScalingPriceFeed.sol) that scales prices up or down to 8 decimals
  • A new ConstantPriceFeed that always returns 1e8 for the WETH base asset, since should always hold a 1:1 value with ETH
  • Modifications to the WstETHPriceFeed to return prices in terms of ETH instead of USD

This is an alternative approach to #626, which is a more complex change but could be a better long-term solution.

kevincheng96 avatar Nov 18 '22 21:11 kevincheng96

The description of this PR is out of date now, right? This is now a PR to do truncated USD prices, not ETH

jflatow avatar Nov 23 '22 17:11 jflatow

The description of this PR is out of date now, right? This is now a PR to do truncated USD prices, not ETH

The description should still be accurate since this PR is for ETH-denominated prices, not USD. The ScalingPriceFeed can be used for any price denomination, but the changes to WstETHPriceFeed specifically make it denominated in ETH rather than USD.

kevincheng96 avatar Nov 30 '22 19:11 kevincheng96

Updated this PR with a new IPriceFeed interface to be used by the wrapper price feeds and Comet. Discussion can be found here: https://github.com/compound-finance/comet/pull/625#discussion_r1029839340

kevincheng96 avatar Dec 05 '22 20:12 kevincheng96

Updated this PR with a new IPriceFeed interface to be used by the wrapper price feeds and Comet. Discussion can be found here: #625 (comment)

💪 Thanks for making this change!

jflatow avatar Dec 07 '22 17:12 jflatow