Submitted by Infect3d, also found by zhaojohnson, Spearmint, lian886, pkqs90, and nnez
Because of the 1:1 conversion rate in PoolV3, if the pool incur a loss due to liquidation from borrowed asset through CDPVault, last user to withdraw will take the full loss.
Every user should be allowed to withdraw a fair share of whats is available in the vault. But as:
There will be situations where the last user to withdraw will not be made whole.
Also, if the last user A is not whole, and another user B deposit to the vault, A can get its missing assets from B deposit and B will be at loss waiting for another deposit.
Scenario:
Loss of funds for users. Unfair loss distribution among users, as the only last withdrawer will incur the entire loss of the vault
Add this test to src/test/unit/CDPVault.t.sol:
Logs:
When there are more shares than assets and vault cannot make all users whole. Withdrawals should be lossy to split loss over all users.
This could be something like this:
Math
0xtj24 (LoopFi) acknowledged
Koolex (judge) decreased severity to Medium
