Closed izqui closed 4 years ago
I'm a fan of the idea of smoothing these events in order to turn them from a single discrete change into something more continuous. However, the mechanics of the current batch filling process seem like they have a pretty significant impact on this process.
Moved to #179.
Using
updateCollateralToken
will lead to major frontrunning opportunities (or not even, as if there's a vote involved it could be atomically attacked), which will result in the reserve bleeding value:updateCollateralToken
I am not super familiar with how the collateral updates impact the currently ongoing batch, but in case that the update happens immediately, the attack could be performed atomically (with a contract that performs steps 3-5 in one tx) with 0 risk for the attacker.
My proposal for tackling this problem would be to perform the parameter update progressively across a certain number of batches (could be a param to
updateCollateralToken
or a global variable), interpolating the change delta linearly across those batches.This wouldn't completely solve the problem, as if there is no more trading during that period, the attacker would be able to make the same profit as they can right now (but it shouldn't be any more profit). But if there's other trading, the value lost would also be captured by legitimate users. I was chatting with @vbuterin about this during the weekend in Taipei, and we couldn't come up with a better solution than this.
I don't see this as a requirement for the initial release, but it is an important upgrade that should be made before the bonding curves for ANJ and ARA are launched since it is going to be very hard to come up with the optimal reserve ratio and it will likely need to be changed.