Submitted by jonah1005
stopRampTargetPrice would set the tokenPrecisionMultipliers to originalPrecisionMultipliers[0].mul(currentTargetPrice).div(WEI_UNIT);
Once the tokenPrecisionMultipliers is changed, the price in the AMM pool would change. Arbitrager can sandwich stopRampTargetPrice to gain profit.
Assume the decision is made in the DAO, an attacker can set up the bot once the proposal to stopRampTargetPrice has passed. I consider this is a medium-risk issue.
The precisionMultiplier is set here:
Swap.sol#L661-L666
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 setup would create multiple issues. This function could be implemented in a safer way IMHO.
A quick fix I would come up with is to ramp the tokenPrecisionMultipliers as the aPrecise is ramped. As the tokenPrecision is slowly increased/decreased, the arbitrage space would be slower and the profit would (probably) distribute evenly to lpers.
Please refer to _getAPreceises implementation
SwapUtils.sol#L227-L250
chickenpie347 (Boot Finance) confirmed
