I noticed a problem with ERC4626 shares when removing assets without adjusting the total number of minted shares (bad debt socialisation).
Imagine a single-token share vault following the ERC4626 standard. The share price is well-defined as long as the assets are monotonically increasing. However, the moment the assets decrease . due to debt socialisation or because an admin harvests part of the assets kept in the vault - complications arise.
New depositors will experience a share “boost”, receiving significantly more shares than earlier depositors. Essentially, these new depositors will steal any future profits accrued by the vault.
Numerical example:
- A deposits 1000 assets and receives 1000 shares (share price of 1).
- B deposits 500 assets and receives 500 shares.
- C deposits 1500 assets and receives 1500 shares.
At this point, the vault has 3000 assets. Suppose the vault then loses 2900 assets and is left with only 100.
- D deposits 1000 assets and receives 33000 shares.
Now, D effectively owns most of the vault. If the admin reintroduces the 2900 assets, the ownership distribution is as follows:
- A’s 1000 shares are now worth 121 assets.
- B’s 500 shares are now worth 61 assets.
- C’s 1500 shares are equivalent to 182 assets.
- D’s 33000 shares are equal to 3636 assets.
D now owns most of the vault assets.
This issue persists even if shadow shares are utilised.