Stale Price Risk
What it detects
This detector tracks how long oracle prices remain unchanged and whether functions guard against stale values. Using old prices can trigger wrong collateral calls or unprofitable trades.
Typical symptoms
- No expiry time on stored prices
- Large gap between oracle updates
Solidity snippet (v0.8.25)
pragma solidity ^0.8.25;
contract PriceGuard {
uint256 public lastUpdate;
uint256 public price;
function setPrice(uint256 newPrice) external {
price = newPrice;
lastUpdate = block.timestamp;
}
function usePrice() external view returns (uint256) {
// Doesn't check if price is too old
return price;
}
}
Why it matters on EVM
Stale prices can cause insolvency or arbitrage losses when market conditions change rapidly.