Submitted by cmichel
The SynthVault._deposit function adds weight for the user that depends on the spot value of the deposit synth amount in BASE.
This spot price can be manipulated and the cost of manipulation is relative to the pools liquidity.
However, the reward (see calcReward) is measured in BASE tokens unrelated to the pool.
Therefore, if the pools liquidity is low and the reward reserve is high, the attack can be profitable:
The users weight is now inflated compared to the deposited / locked-up amount and they can claim a large share of the rewards. The cost of the attack depends on the pools liquidity and the profit depends on the reserve. It could therefore be profitable under certain circumstances.
Recommend tracking a TWAP price of the synth instead, store the deposited synths instead, and compute the weight & total weight on the fly based on the TWAP * deposit amount instead of at the time of deposit.
verifyfirst (Spartan) acknowledged:
