Submitted by turvy_fuzz, also found by SpicyMeatball
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L127
Borrowers collateralRatio in the liquidation() function is calculated by:
Notice it calls the getBorrowedOf() function, which
calculates the current borrowing amount for the borrower, including the borrowed shares and accumulated fees, not just the borrowed amount.
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L253
However, the providers collateralRatio in the rigidRedemption() function is calculated by:
https://github.com/code-423n4/2023-06-lybra/blob/main/contracts/lybra/pools/base/LybraPeUSDVaultBase.sol#L161
Here, the deposit asset is divided by only the borrowed amount, missing out on the borrowed shares and accumulated fees.
Visual Studio Code
Be consistent with collateralRatio calculation.
LybraFinance confirmed
