There is no check for stale prices in LiquidationPool::distributeAssets
.
Chainlink recommends checking that the latestTimestamp of the answer is recent enough:
Your application should track the latestTimestamp variable or use the updatedAt value from the latestRoundData() function to make sure that the latest answer is recent enough for your application to use it. If your application detects that the reported answer is not updated within the heartbeat or within time limits that you determine are acceptable for your application, pause operation or switch to an alternate operation mode while identifying the cause of the delay.
Possible scenario (unlikely but possible, just to illustrate the issue). The issue is also valid during liquidations:
distributeAssets
could be called by anyone.
There is 1 BTC in the pool.
Current BTC price is 10_000 EUR/BTC.
Stale price in Chainlink is 20_000 EUR/BTC.
20,000 EUR (not taking into account _collateralRate to simplify) would be got from holders and burnt.
Holders receive 1 BTC.
They sell 1 BTC.
They receive 10_000 EUR.
Holders' loss is 10_000 EUR.
Assets from LiquidationPool
could be distributed to holders by non-market prices (higher than real prices), holders will lose some funds since they couldn't buy back the same amount of EUROs after selling distributed assets.
Manual review
Use PriceCalculator
as a single source of prices.
In PriceCalculator
, check that the price is not older than:
Heartbeat for stable coin collaterals.
N (for example, 1 hour) for volatile collaterals (BTC, ETH, etc).
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.