`Compound()` will not work if there is only TokenA/TokenB in the trove.
The compound() function is designed to deposit Long tokens, Short tokens, or airdropped ARB tokens to the GMX for compounding. However, it will only work if there is ARB token in the trove. If there are only Long/Short tokens in the trove without any ARB, the function will not work.\\nThe `compound()` function is intended to be called by the keeper once a day to deposit all the Long/Short or ARB tokens to the GMX for further compounding. However, the logic for depositing to the GMX is restricted by the condition that the trove must always hold an airdropped ARB token.\\nHere is the relevant code snippet from the GitHub repository:\\n```\\n//@audit compound if only ARB is there, what about tokenA and tokenB?\\nif (_tokenInAmt > 0) {\\n      self.refundee = payable(msg.sender);\\n\\n      self.compoundCache.compoundParams = cp;\\n\\n      ISwap.SwapParams memory _sp;\\n\\n      _sp.tokenIn = cp.tokenIn;\\n      _sp.tokenOut = cp.tokenOut;\\n      _sp.amountIn = _tokenInAmt;\\n      _sp.amountOut = 0; // amount out minimum calculated in Swap\\n      _sp.slippage = self.minSlippage;\\n      _sp.deadline = cp.deadline;\\n\\n      GMXManager.swapExactTokensForTokens(self, _sp);\\n\\n      GMXTypes.AddLiquidityParams memory _alp;\\n\\n      _alp.tokenAAmt = self.tokenA.balanceOf(address(this));\\n      _alp.tokenBAmt = self.tokenB.balanceOf(address(this));\\n\\n      self.compoundCache.depositValue = GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenA),\\n        self.tokenA.balanceOf(address(this))\\n      )\\n      + GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenB),\\n        self.tokenB.balanceOf(address(this))\\n      );\\n\\n      GMXChecks.beforeCompoundChecks(self);\\n\\n      self.status = GMXTypes.Status.Compound;\\n\\n      _alp.minMarketTokenAmt = GMXManager.calcMinMarketSlippageAmt(\\n        self,\\n        self.compoundCache.depositValue,\\n        cp.slippage\\n      );\\n\\n      _alp.executionFee = cp.executionFee;\\n\\n      self.compoundCache.depositKey = GMXManager.addLiquidity(\\n        self,\\n        _alp\\n      );\\n    }\\n```\\n\\nThe code checks if there is a positive `_tokenInAmt` (representing ARB tokens) and proceeds with the depositing and compounding logic. However, if there is no ARB token but only tokenA and tokenB in the trove, the compounding will not occur and the tokens will remain in the compoundGMX contract indefinitely.\\nIt is important to note that the airdrop of ARB tokens is a rare event, making it less likely for this condition to be met. Therefore, if there are no ARB tokens but a significant amount of tokenA and tokenB in the trove, the compounding will not take place.
To mitigate this issue, it is important to always check if either tokenA/tokenB or ARB is present in the trove. If either of these is present, then proceed with the compound action. Otherwise, return.\\n```\\nif (_tokenInAmt > 0 || self.tokenA.balanceOf(address(this) > 0 || self.tokenB.balanceOf(address(this))  ) {\\n      self.refundee = payable(msg.sender);\\n\\n      self.compoundCache.compoundParams = cp;\\n\\n      ISwap.SwapParams memory _sp;\\n\\n      _sp.tokenIn = cp.tokenIn;\\n      _sp.tokenOut = cp.tokenOut;\\n      _sp.amountIn = _tokenInAmt;\\n      _sp.amountOut = 0; // amount out minimum calculated in Swap\\n      _sp.slippage = self.minSlippage;\\n      _sp.deadline = cp.deadline;\\n\\n      GMXManager.swapExactTokensForTokens(self, _sp);\\n\\n      GMXTypes.AddLiquidityParams memory _alp;\\n\\n      _alp.tokenAAmt = self.tokenA.balanceOf(address(this));\\n      _alp.tokenBAmt = self.tokenB.balanceOf(address(this));\\n\\n      self.compoundCache.depositValue = GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenA),\\n        self.tokenA.balanceOf(address(this))\\n      )\\n      + GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenB),\\n        self.tokenB.balanceOf(address(this))\\n      );\\n\\n      GMXChecks.beforeCompoundChecks(self);\\n\\n      self.status = GMXTypes.Status.Compound;\\n\\n      _alp.minMarketTokenAmt = GMXManager.calcMinMarketSlippageAmt(\\n        self,\\n        self.compoundCache.depositValue,\\n        cp.slippage\\n      );\\n\\n      _alp.executionFee = cp.executionFee;\\n\\n      self.compoundCache.depositKey = GMXManager.addLiquidity(\\n        self,\\n        _alp\\n      );\\n    }\\n```\\n
If the compounding doesn't happen this could lead to the indirect loss of funds to the user and loss of gas for the keeper who always calls this function just to transfer tokens and check the balance of ARB.
```\\n//@audit compound if only ARB is there, what about tokenA and tokenB?\\nif (_tokenInAmt > 0) {\\n      self.refundee = payable(msg.sender);\\n\\n      self.compoundCache.compoundParams = cp;\\n\\n      ISwap.SwapParams memory _sp;\\n\\n      _sp.tokenIn = cp.tokenIn;\\n      _sp.tokenOut = cp.tokenOut;\\n      _sp.amountIn = _tokenInAmt;\\n      _sp.amountOut = 0; // amount out minimum calculated in Swap\\n      _sp.slippage = self.minSlippage;\\n      _sp.deadline = cp.deadline;\\n\\n      GMXManager.swapExactTokensForTokens(self, _sp);\\n\\n      GMXTypes.AddLiquidityParams memory _alp;\\n\\n      _alp.tokenAAmt = self.tokenA.balanceOf(address(this));\\n      _alp.tokenBAmt = self.tokenB.balanceOf(address(this));\\n\\n      self.compoundCache.depositValue = GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenA),\\n        self.tokenA.balanceOf(address(this))\\n      )\\n      + GMXReader.convertToUsdValue(\\n        self,\\n        address(self.tokenB),\\n        self.tokenB.balanceOf(address(this))\\n      );\\n\\n      GMXChecks.beforeCompoundChecks(self);\\n\\n      self.status = GMXTypes.Status.Compound;\\n\\n      _alp.minMarketTokenAmt = GMXManager.calcMinMarketSlippageAmt(\\n        self,\\n        self.compoundCache.depositValue,\\n        cp.slippage\\n      );\\n\\n      _alp.executionFee = cp.executionFee;\\n\\n      self.compoundCache.depositKey = GMXManager.addLiquidity(\\n        self,\\n        _alp\\n      );\\n    }\\n```\\n