Submitted by d3e4
It is possible that the amount of dUSD minted in discount fees are greater than the discount loss. An attacker can therefore deliberately trigger a fee and, provided he has a large stake in the yDUSD vault, he can claim more dUSD in fees, than lost from the trade.
The root cause is that the discount fee is fixed in proportion only to the entire debt.
Suppose dUSD trades at the intended 1:1 peg. The effective loss from placing an order at the price 0.95 is then 0.05 * ercAmount.
Since the difference in price is >1% the discount fee kicks in.
discountPct is first calculated to 0.05. Then, after applying the discountMultiplier (10 by default) it will be 0.5 * daysElapsed.
If sufficiently many days have passed the discount will thus be an arbitrarily high number k.
pctOfDiscountedDebt will be k * ercAmount / ercDebt. This must be >0.01 for the fee to be applied. I.e. ercAmount = 0.01 * ercDebt / k (or slightly more) is sufficient.
The loss is then 0.0005 * ercDebt / k.
The discountPenaltyFee is 0.1% and is applied to (almost) the entire ercDebt. This, 0.001 * ercDebt is the amount dUSD minted.
The question is then whether the loss 0.0005 * ercDebt / k can be smaller than the 0.001 * ercDebt minted. This will happen if k > 0.5, for which two days is sufficient.
ditto-eth (sponsor) disputed and commented:
hansfriese (judge) commented:
d3e4 (warden) commented:
hansfriese (judge) commented:
ditto-eth (sponsor) commented:
