MarketUtils.getFundingAmountPerSizeDelta() has a rounding logical error.
`MarketUtils.getFundingAmountPerSizeDelta()` has a rounding logical error. The main problem is the divisor always use a roundupDivision regardless of the input `roundUp` rounding mode. Actually the correct use should be: the divisor should use the opposite of `roundup` to achieve the same logic of rounding.\\n`MarketUtils.getFundingAmountPerSizeDelta()` is used to calculate the `FundingAmountPerSizeDelta` with a roundup input mode parameter.\\nThis function is used for example by the IncreaseLimit order via flow `OrderHandler.executeOrder() -> _executeOrder() -> OrderUtils.executeOrder() -> processOrder() -> IncreaseOrderUtils.processOrder() -> IncreasePositionUtils.increasePosition() -> PositionUtils.updateFundingAndBorrowingState() -> MarketUtils.updateFundingAmoutPerSize() -> getFundingAmountPerSizeDelta()`.\\nHowever, the main problem is the divisor always use a roundupDivision regardless of the input `roundUp` rounding mode. Actually the correct use should be: the divisor should use the opposite of `roundup` to achieve the same logic of rounding.\\nMy POC code confirms my finding: given fundingAmount = 2e15, openInterest = 1e15+1, and roundup = true, the correct answer should be: 1999999999999998000000000000001999999999999999. However, the implementation returns the wrong solution of : 1000000000000000000000000000000000000000000000. The reason is that the divisor uses a roundup and gets a divisor of 2, as a result, the final result is actually rounded down rather than rounding up!\\n```\\nfunction testGetFundingAmountPerSizeDelta() public{\\n        uint result = MarketUtils.getFundingAmountPerSizeDelta(2e15, 1e15+1, true);\\n        console2.log("result: %d", result);\\n        uint256 correctResult = 2e15 * 1e15 * 1e30 + 1e15; // this is a real round up\\n        correctResult = correctResult/(1e15+1);\\n        console2.log("correctResult: %d", correctResult);\\n        assertTrue(result  == 1e15 * 1e30);\\n    }\\n```\\n
Change the rounding mode of the divisor to the opposite of the input `roundup` mode. Or, the solution can be just as follows:\\n```\\nfunction getFundingAmountPerSizeDelta(\\n        uint256 fundingAmount,\\n        uint256 openInterest,\\n        bool roundUp\\n    ) internal pure returns (uint256) {\\n        if (fundingAmount == 0 || openInterest == 0) { return 0; }\\n     \\n       \\n\\n        // how many units in openInterest\\n// Remove the line below\\n        uint256 divisor = Calc.roundUpDivision(openInterest, Precision.FLOAT_PRECISION_SQRT);\\n\\n// Remove the line below\\n        return Precision.toFactor(fundingAmount, divisor, roundUp);\\n// Add the line below\\n       return Precision.toFactor(fundingAmount*Precision.FLOAT_PRECISION_SQRT, openInterest, roundUp\\n    }\\n```\\n
MarketUtils.getFundingAmountPerSizeDelta() has a rounding logical error, sometimes, when roundup = true, the result, instead of rounding up, it becomes a rounding down!
```\\nfunction testGetFundingAmountPerSizeDelta() public{\\n        uint result = MarketUtils.getFundingAmountPerSizeDelta(2e15, 1e15+1, true);\\n        console2.log("result: %d", result);\\n        uint256 correctResult = 2e15 * 1e15 * 1e30 + 1e15; // this is a real round up\\n        correctResult = correctResult/(1e15+1);\\n        console2.log("correctResult: %d", correctResult);\\n        assertTrue(result  == 1e15 * 1e30);\\n    }\\n```\\n