Submitted by jonah1005
Theres a feature of virtualPrice that is monotonically increasing regardless of the market. This function is heavily used in multiple protocols. e.g.(curve metapool, mim, ) This is not held in the current implementation of customSwap since customPrecisionMultipliers can be changed by changing the target price.
There are two issues here:
The meaning of virtualPrice would be vague.
This may damage the lp providers as the protocol that adopts it may be hacked.
I consider this is a medium-risk issue.
We can set up a mockSwap with extra setPrecisionMultiplier to check the issue.
None
Dealing with the target price with multiplier precision seems clever as we can reuse most of the existing code. However, the precision multiplier should be an immutable parameter. Changing it after the pool is set up would create multiple issues. This function could be implemented in a safer way IMHO.
The quick fix would be to remove the getVirtualPrice function. I cant come up with a safe way if other protocol wants to use this function.
chickenpie347 (Boot Finance) confirmed
