`PerpDepository._rebalanceNegativePnlWithSwap()` shouldn't use a `sqrtPriceLimitX96` twice.
`PerpDepository._rebalanceNegativePnlWithSwap()` shouldn't use a `sqrtPriceLimitX96` twice.\\nCurrently, `_rebalanceNegativePnlWithSwap()` uses a `sqrtPriceLimitX96` param twice for placing a perp order and swapping.\\n```\\n    function _rebalanceNegativePnlWithSwap(\\n        uint256 amount,\\n        uint256 amountOutMinimum,\\n        uint160 sqrtPriceLimitX96,\\n        uint24 swapPoolFee,\\n        address account\\n    ) private returns (uint256, uint256) {\\n        uint256 normalizedAmount = amount.fromDecimalToDecimal(\\n            ERC20(quoteToken).decimals(),\\n            18\\n        );\\n        _checkNegativePnl(normalizedAmount);\\n        bool isShort = false;\\n        bool amountIsInput = true;\\n        (uint256 baseAmount, uint256 quoteAmount) = _placePerpOrder(\\n            normalizedAmount,\\n            isShort,\\n            amountIsInput,\\n            sqrtPriceLimitX96\\n        );\\n        vault.withdraw(assetToken, baseAmount);\\n        SwapParams memory params = SwapParams({\\n            tokenIn: assetToken,\\n            tokenOut: quoteToken,\\n            amountIn: baseAmount,\\n            amountOutMinimum: amountOutMinimum,\\n            sqrtPriceLimitX96: sqrtPriceLimitX96, //@audit \\n            poolFee: swapPoolFee\\n        });\\n        uint256 quoteAmountOut = spotSwapper.swapExactInput(params);\\n```\\n\\nIn `_placePerpOrder()`, it uses the uniswap pool inside the perp protocol and uses a `spotSwapper` for the second swap which is for the uniswap as well.\\nBut as we can see here, Uniswap V3 introduces multiple pools for each token pair and 2 pools might be different and I think it's not good to use the same `sqrtPriceLimitX96` for different pools.\\nAlso, I think it's not mandatory to check a `sqrtPriceLimitX96` as it checks `amountOutMinimum` already. (It checks `amountOutMinimum` only in `_openLong()` and _openShort().)
I think we can use the `sqrtPriceLimitX96` param for one pool only and it would be enough as there is an `amountOutMinimum` condition.
`PerpDepository._rebalanceNegativePnlWithSwap()` might revert when it should work as it uses the same `sqrtPriceLimitX96` for different pools.
```\\n    function _rebalanceNegativePnlWithSwap(\\n        uint256 amount,\\n        uint256 amountOutMinimum,\\n        uint160 sqrtPriceLimitX96,\\n        uint24 swapPoolFee,\\n        address account\\n    ) private returns (uint256, uint256) {\\n        uint256 normalizedAmount = amount.fromDecimalToDecimal(\\n            ERC20(quoteToken).decimals(),\\n            18\\n        );\\n        _checkNegativePnl(normalizedAmount);\\n        bool isShort = false;\\n        bool amountIsInput = true;\\n        (uint256 baseAmount, uint256 quoteAmount) = _placePerpOrder(\\n            normalizedAmount,\\n            isShort,\\n            amountIsInput,\\n            sqrtPriceLimitX96\\n        );\\n        vault.withdraw(assetToken, baseAmount);\\n        SwapParams memory params = SwapParams({\\n            tokenIn: assetToken,\\n            tokenOut: quoteToken,\\n            amountIn: baseAmount,\\n            amountOutMinimum: amountOutMinimum,\\n            sqrtPriceLimitX96: sqrtPriceLimitX96, //@audit \\n            poolFee: swapPoolFee\\n        });\\n        uint256 quoteAmountOut = spotSwapper.swapExactInput(params);\\n```\\n