The marketConfiguration is set through the MarketConfiguration.update function. However, the priceFeedHeartbeatSeconds variable is missing from the update function. The default value of 0 cannot be changed which means every price check will revert due to Errors.OraclePriceFeedHeartbeat(address(priceFeed)).
MarketConfiguration.Data is updated through the MarketConfiguration.update function, but the Data.priceFeedHeartbeatSeconds variable is missing. Therefore, even if the MarketConfiguration.update function passes in the priceFeedHeartbeatSeconds parameter, it cannot be assigned a value.
Since the priceFeedHeartbeatSeconds variable cannot be assigned a value, the initial value is maintained at 0.
The Data.priceFeedHeartbeatSeconds variable is used by the getIndexPrice function to check when getting the price. It indicates the maximum acceptable timeout.
As shown in the code, since priceFeedHeartbeatSeconds is always 0, the price can only be obtained correctly when block.timestamp<=updatedAt. That is, the price can only be obtained correctly at the moment when the priceFeed price is updated. Which is practically impossible.
The impact is high since it breaks all price requests and the likelyhood is 100%, so we believe this merits a High severity.
Manual Review
Update the update function so that it will correctly set the priceFeedHeartBeatSeconds variable.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.