Upon closing a profitable position, traders receive usdTokenwhich can be converted for available collateral from a vault (via initiateSwap and fulfillSwap ).
Traders can use sameusdToken to pay for negative PnL and required collateral amount is deposited via depositCreditForMarket .
The problem is that while in withdrawUsdTokenFromMarket the newly minted usdToken is added to market's netUsdTokenIssuance, in depositCreditForMarket the deposited amount is subtracted from netUsdTokenIssuance but the amount is never burned.
The usdToken balance of market-making will increase more and more over time.
The usdToken's totalSupply() will ever increase and in the end the token will depeg.
In CreditDelegationBranch::depositCreditForMarket burn the received usdToken . This way the usdToken balance of the market-making address is kept in sync with the market's netUsdTokenIssuance.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.