It's impossible for users to open maximum allowed positions per account because of the wrong check in validatePositionsLimit():
activePositionsLength >= maxPositionsPerAccount
One function of validatePositionsLimit() is to ensure an account doesn't open more than the maximum allowed positions. Hence this check:
if (activePositionsLength >= maxPositionsPerAccount) {
revert Errors.MaxPositionsPerAccountReached(self.id, activePositionsLength, maxPositionsPerAccount);
}
However, the use of "=" in the check means an account cannot open the allowed maximum positions. For example:
If an account is allowed 9 positions max, with the present check in the validatePositionsLimit(), an account cannot open 9 positions except 8. Whereas, 9 is the maximum allowed positions an account can open.
An account will not be able to open the allowed maximum position because of the wrong check in validatePositionsLimit().
Manual review
The check should be written this way:
if (activePositionsLength > maxPositionsPerAccount) {
revert Errors.MaxPositionsPerAccountReached(self.id, activePositionsLength, maxPositionsPerAccount);
}
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.