Function closePosition() of the ClearingHouse contract checks if the size sent as an argument to this function is smaller than the size of the position to close.
If the size to close is greater than the position size, the execution reverts with error INSUFFICIENT_SIZE. This error name is misleading and could lead a user into thinking they called the function with insufficient size, and call the same function again with a greater size, which would lead to another revert.
For clarification, take a look at a simplified code segment illustrating this issue
function closePosition(IRouter amm, uint256 size, uint256 quoteLimit)
external {
int256 oldSize = _assertOpenPosition(amm, msg.sender);
uint256 oldSizeAbs = oldSize.abs();
if (size > oldSizeAbs) revert INSUFFICIENT_SIZE();
(...)
}Status
Acknowledged