Handsome Pineapple Mustang
Medium
As we can see that pyth.getPriceNoOlderThan in getThePrice we are checking for 600 sec but in the comment it is written around 90 sec so we are checking the wrong stale price as price will change after 90 sec.
function getThePrice(address tokenAddress) public view returns (int) { // falta hacer un chequeo para las l2 bytes32 _priceFeed = priceIdPerToken[tokenAddress]; require(_priceFeed != bytes32(0), "Price feed not set"); require(!isPaused, "Contract is paused");
// Get the price from the pyth contract, no older than 90 seconds
PythStructs.Price memory priceData = pyth.getPriceNoOlderThan(
_priceFeed,
@>> 600
);
No response
No response
No response
stale price may happen s we check the 600 sec in place of 90 sec.
No response
use 90 sec in place of 600 sec.