Submitted by obront, also found by Tointer, bin2chen, 0xcm, and zaskoh
The minDepositAmount() function is intended to ensure that all depositors into Public Vaults are depositing more than dust to protect against attacks like the 4626 front running attack. It is calculated as follows:
For assets with 18 decimals, this calculation is totally reasonable, as the minimum deposit is just 100 gwei (1/10k of a USD). However, for other assets, the formula returns 0.1 tokens, regardless of value.
While this may be fine for low-priced tokens, it leads to a minimum deposit for tokens like WBTC to be over $2000 USD, certainly too high for many user and not aligned with the intended behavior (which can be seen in the 18 decimal base case).
This is far out of line with the 1/10,000 USD expected for tokens with 18 decimals.
Since our requirements for the size of deposit are so low, we can customize a formula that ensures we get a small final result in all cases. For example:
SantiagoGregory (Astaria) confirmed
