LiquidationPool::distributeAssets()
uses Chainlink price feeds but does not verify freshness of the data.
The recommendation from Chainlink docs
Speculations on potential causes for stale data generally center around economic drivers with dose of future gazing.
LiquidationPool::distributedAssets()
is called by LiquidationPoolManager.runLiquidation()
as an essential part of the liquidation process.
The liquidation process is the secondary pegging mechanism outlined in TheStandard whitepaper
With stale prices there are two possibilities are either over or under valuation of assets in LiquidationPool::distributedAssets()
.
Asset overvaluation: stakers looses out, paying more EUROs to the protocol for the assets.
Asset undervaluation: protocol looses out, taking fewer EUROs than it should from the stakers for the assets.
In the overall liquidation process, incorrect valuation can result in vaults being liquidated when should not be (based on L1 prices).
Manual review
From the Chainlink AggregatorV3Interface::latestRoundData() docs we can infer the use of updatedAt
as input to a tolerance check.
Unfortunately with each price feed being able to a different heartbeat, you would need a per-feed tolerance configuration.
To provide that a wrapper around the price feed could be used, a decorator pattern, with the only change being required in deployment scripts (at an increase in gas for the added call).
The intent is to provide the AggregatorV3Interface
functions, the calls the aggregator but also performs addition behaviours, such as checking for stale data in latestRoundData()
.
Create a decorator for each feed, then pass the decorators into the contracts instead of the feed in deployment.
LiquidationPool::eurUsd
will be the EUR/USD decorator address, instead of the Chainlink price feed directly.
ITokenManager::Token::clAddr
will be the Asset/USD decorator address, instead of the Chainlink price feed directly.
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.