Deposit and withdraw to the vault with the wrong decimals of amount in contract `PerpDepository`
Function `vault.deposit` and `vault.withdraw` of vault in contract `PerpDepository` need to be passed with the amount in raw decimal of tokens (is different from 18 in case using USDC, WBTC, ... as base and quote tokens). But some calls miss the conversion of decimals from 18 to token's decimal, and pass wrong decimals into them.\\nFunction `vault.deposit` need to be passed the param amount in token's decimal (as same as vault.withdraw). You can see at function `_depositAsset` in contract PerpDepository.\\n```\\nfunction _depositAsset(uint256 amount) private {\\n    netAssetDeposits += amount;\\n    \\n    IERC20(assetToken).approve(address(vault), amount);\\n    vault.deposit(assetToken, amount);\\n}\\n```\\n\\nBut there are some calls of `vault.deposit` and `vault.withdraw` that passed the amount in the wrong decimal (18 decimal). Let's see function `_rebalanceNegativePnlWithSwap` in contract PerpDepository:\\n```\\nfunction _rebalanceNegativePnlWithSwap(\\n    uint256 amount,\\n    uint256 amountOutMinimum,\\n    uint160 sqrtPriceLimitX96,\\n    uint24 swapPoolFee,\\n    address account\\n) private returns (uint256, uint256) {\\n    // rest of code\\n    (uint256 baseAmount, uint256 quoteAmount) = _placePerpOrder(\\n        normalizedAmount,\\n        isShort,\\n        amountIsInput,\\n        sqrtPriceLimitX96\\n    );\\n    vault.withdraw(assetToken, baseAmount); \\n    \\n    // rest of code\\n    \\n    vault.deposit(quoteToken, quoteAmount);\\n\\n    emit Rebalanced(baseAmount, quoteAmount, shortFall);\\n    return (baseAmount, quoteAmount);\\n}\\n```\\n\\nBecause function `_placePerpOrder` returns in decimal 18 (confirmed with sponsor WarTech), this calls pass `baseAmount` and `quoteAmount` in decimal 18, inconsistent with the above call. It leads to vault using the wrong decimal when depositing and withdrawing tokens.\\nThere is another case that use `vault.withdraw` with the wrong decimal (same as this case) in function _rebalanceNegativePnlLite:\\n```\\n//function _rebalanceNegativePnlLite, contract PerpDepository\\n// rest of code\\n\\n(uint256 baseAmount, uint256 quoteAmount) = _placePerpOrder(\\n    normalizedAmount,\\n    isShort,\\n    amountIsInput,\\n    sqrtPriceLimitX96\\n);\\nvault.withdraw(assetToken, baseAmount);\\n\\n// rest of code\\n```\\n
Should convert the param `amount` from token's decimal to decimal 18 before `vault.deposit` and `vault.withdraw`.
Because of calling `vault.deposit` and `vault.withdraw` with the wrong decimal of the param amount, the protocol can lose a lot of funds. And some functionalities of the protocol can be broken cause it can revert by not enough allowance when calling these functions.
```\\nfunction _depositAsset(uint256 amount) private {\\n    netAssetDeposits += amount;\\n    \\n    IERC20(assetToken).approve(address(vault), amount);\\n    vault.deposit(assetToken, amount);\\n}\\n```\\n