ChronicleOracle calculates staleness incorrectly
totomanov opened this issue · comments
The IChronicle
interface returns uint256 age
, the timestamp of the price update, while the adapter code interprets it as staleness.
Location
euler-price-oracle/src/adapter/chronicle/ChronicleOracle.sol
Lines 55 to 57 in afb32ee
Fix
uint256 staleness = block.timestamp - age;
if (staleness > maxStaleness) revert Errors.PriceOracle_TooStale(staleness, maxStaleness);
For example, see this poke transaction, which sets age
to 1710916503.