https://github.com/code-423n4/2024-05-predy/blob/a9246db5f874a91fb71c296aac6a66902289306a/src/PriceFeed.sol#L45-L58
This function returns the square root of the baseToken price quoted in quoteToken, and this data is queried when checking if the vault is in danger in order to liquidate it, with needing a confirmation via PositionCalculator.isLiquidatable().
The problem is that unlike the way Pyth is being queried which includes a VALID_TIME_PERIOD to act as a stale check for Pyths getPriceNoOlderThan(). In the case of Chainlink, the protocol just ingests whatever price is returned from the feed even though it might be stale/not safe.
One thing with using Chainlink on L2 chains is that there is a need to check if the sequencer is down to avoid prices from looking like they are fresh although they are not. The bug could then be leveraged by malicious actors to take advantage of the sequencer downtime.
Core functionalities across protocol would be somewhat broken on L2 chains where the networks could be down for a while.
As this, in its sense, is like a pausing functionality on the chain and any action thats time-restricted has a potential of been flawly finalized, popular bug ideas include users not being able say add collateral if they had borrowed a position making them immediately liquidatable when the sequencer comes back on, etc. This could be coined to fit into any time-restricted logic.
If the sequencer goes down, the protocol will allow users to continue to operate at the previous (stale) prices.
Consider reimplementing the timing logics on the L2 side of the protocol to take the fact that the sequencer could indeed be down into account.
Additionally, since Chainlink recommends that all Optimistic L2 oracles consult the Sequencer Uptime Feed to ensure that the sequencer is live before trusting the data returned by the oracle introduce a seqeuncer check to ensure that the sequencer is active and prices returned are accurate.
