You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CompoundPricer requires that ChainlinkPricer's dispute period is over and the price is finalized before running and calculating the cToken exchange rate in USD or requires that the dispute period for the CompoundPricer is longer than the ChainlinkPricer.
This sets the cToken/USD price, which depends on getExpiryPrice to calculate the cToken/USD fx rate
if we set the if the CompoundPricer price and then the ChainlinkPricer's price of the underlying asset changes via a dispute, our cToken/USD fx rate is wrong
function setExpiryPriceInOracle(uint256 _expiryTimestamp) external {
(uint256 underlyingPriceExpiry, ) = oracle.getExpiryPrice(address(underlying), _expiryTimestamp);
require(underlyingPriceExpiry > 0, "CompoundPricer: underlying price not set yet");
uint256 cTokenPrice = _underlyingPriceToCtokenPrice(underlyingPriceExpiry);/
oracle.setExpiryPrice(address(cToken), _expiryTimestamp, cTokenPrice);
}
Two solutions:
Require that the dispute for CompoundPricer is greater or equal to than the ChainlinkPricer that it depends on (either via code or via checks off chain before deploying).
Have CompoundPricer check the dispute period of the underlying asset and only allow a setExpiryPriceInOracle when the dispute period has ended, that would allow a dispute period of 0 for CompoundPricer.
Require that disputes in underlying assets in compound style pricers reset the dispute period for the compound pricer.
I think solution 1 is fine and just ensure we deploy correctly, this is more of a note, but need to be careful with the deployed parameters for this.
The text was updated successfully, but these errors were encountered:
CompoundPricer requires that ChainlinkPricer's dispute period is over and the price is finalized before running and calculating the cToken exchange rate in USD or requires that the dispute period for the CompoundPricer is longer than the ChainlinkPricer.
This sets the cToken/USD price, which depends on getExpiryPrice to calculate the cToken/USD fx rate
if we set the if the CompoundPricer price and then the ChainlinkPricer's price of the underlying asset changes via a dispute, our cToken/USD fx rate is wrong
Two solutions:
I think solution 1 is fine and just ensure we deploy correctly, this is more of a note, but need to be careful with the deployed parameters for this.
The text was updated successfully, but these errors were encountered: