The withdrawal queue is only updated when the liquidity is added
Sometimes when the amount of liquidity is not much higher than the number of tokens locked for the collateral, it's impossible to withdraw liquidity. For a user that wants to withdraw liquidity, a withdrawal request is created. If the request can't be executed, it's added to the withdrawal queue, and the user needs to wait until there's enough collateral for withdrawal. There are potentially 2 ways to achieve that: either someone adds more liquidity or some existing policies expire.\\nCurrently, the queue can only be cleared when the internal `_updateWithdrawalQueue` function is called. And it is only called in one place while adding liquidity:\\n```\\nfunction \\_addLiquidityFor(address \\_liquidityHolderAddr, uint256 \\_liquidityAmount, bool \\_isLM) internal {\\n  daiToken.transferFrom(\\_liquidityHolderAddr, address(this), \\_liquidityAmount);   \\n  \\n  uint256 \\_amountToMint = \\_liquidityAmount.mul(PERCENTAGE\\_100).div(getDAIToDAIxRatio());\\n  totalLiquidity = totalLiquidity.add(\\_liquidityAmount);\\n  \\_mintERC20(\\_liquidityHolderAddr, \\_amountToMint);\\n\\n  if (\\_isLM) {\\n    liquidityFromLM[\\_liquidityHolderAddr] = liquidityFromLM[\\_liquidityHolderAddr].add(\\_liquidityAmount);\\n  }\\n\\n  \\_updateWithdrawalQueue();\\n\\n  emit AddLiquidity(\\_liquidityHolderAddr, \\_liquidityAmount, totalLiquidity);\\n}\\n```\\n
It would be better if the queue could be processed when some policies expire without adding new liquidity. For example, there may be an external function that allows users to process the queue.
```\\nfunction \\_addLiquidityFor(address \\_liquidityHolderAddr, uint256 \\_liquidityAmount, bool \\_isLM) internal {\\n  daiToken.transferFrom(\\_liquidityHolderAddr, address(this), \\_liquidityAmount);   \\n  \\n  uint256 \\_amountToMint = \\_liquidityAmount.mul(PERCENTAGE\\_100).div(getDAIToDAIxRatio());\\n  totalLiquidity = totalLiquidity.add(\\_liquidityAmount);\\n  \\_mintERC20(\\_liquidityHolderAddr, \\_amountToMint);\\n\\n  if (\\_isLM) {\\n    liquidityFromLM[\\_liquidityHolderAddr] = liquidityFromLM[\\_liquidityHolderAddr].add(\\_liquidityAmount);\\n  }\\n\\n  \\_updateWithdrawalQueue();\\n\\n  emit AddLiquidity(\\_liquidityHolderAddr, \\_liquidityAmount, totalLiquidity);\\n}\\n```\\n