The short can be created with values less than the minAskEth and minShortErc causing that the created order with minimum values would not be attractive to be liquidated if it is the case.
The short order creation is possible using the ShortOrdersFacet::createLimitShort() function. It checks for minAskEth and minShortErc minimum values before everything else. The problem is that the number of bids orders can not be enough to complete the short order causing the creation of the short order with minimum values. Please consider the next scenario:
The new short order is executed with ercAmount: 2, price: 1, initialMargin: 500, the next validation does not rever the transaction (2 < 2 || 2 < 2 is False):
The new short order is matched with the unique bid order avaliable. The fillErc = 1 and fillEth = 1. The matchTotal.colUsed is 1 (incomingSellPrice) * 1 (fillErc) * 500 (initialMargin) = 500
Since there is only one bid order, the matching process ends and the next validation in the code line 666 is not True so the leftover incomingSell.ercAmount (1 amount) is not assigned to the orderbook (1 [left ercAmount] * 1 [incomingSellPrice] >= 2 is False).
The user short record creation ends with the next fills:
That is less than the required by minAskEth and minShortErc.
Shorts can be created with the less than the minimum value required by minAskEth and minShortErc causing that the short order would not be attractive to be liquidated by the liquidatiors since the collateral attached is not enough to cover the liquidation transaction.
Manual review
Verify the minimum required values minAskEth and minShortErc in the short record creation LibShortRecord::createShortRecord() function.
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.