```\nelse{\n //swap token1 for token0\n swap = uint256(swapAmount);\n IHypervisor(pos).token0().transferFrom(msg.sender, address(this), deposit0+swap);\n\n amountOut = router.exactInput(\n ISwapRouter.ExactInputParams(\n path,\n address(this),\n block.timestamp + swapLife,\n swap,\n deposit1\n )\n ); \n}\n\nrequire(amountOut > 0, "Swap failed");\n\nif (positions[pos].version < 2) {\n // requires lp token transfer from proxy to msg.sender\n shares = IHypervisor(pos).deposit(deposit0, deposit1, address(this));\n IHypervisor(pos).transfer(to, shares);\n}\n```\n