```\nFile: LimitOrderRegistry.sol\n    function claimOrder(uint128 batchId, address user) external payable returns (ERC20, uint256) {\n        Claim storage userClaim = claim[batchId];\n        if (!userClaim.isReadyForClaim) revert LimitOrderRegistry__OrderNotReadyToClaim(batchId);\n        uint256 depositAmount = batchIdToUserDepositAmount[batchId][user];\n        if (depositAmount == 0) revert LimitOrderRegistry__UserNotFound(user, batchId);\n\n        // Zero out user balance.\n        delete batchIdToUserDepositAmount[batchId][user];\n\n        // Calculate owed amount.\n        uint256 totalTokenDeposited;\n        uint256 totalTokenOut;\n        ERC20 tokenOut;\n\n        // again, remembering that direction == true means that the input token is token0.\n        if (userClaim.direction) {\n            totalTokenDeposited = userClaim.token0Amount;\n            totalTokenOut = userClaim.token1Amount;\n            tokenOut = poolToData[userClaim.pool].token1;\n        } else {\n            totalTokenDeposited = userClaim.token1Amount;\n            totalTokenOut = userClaim.token0Amount;\n            tokenOut = poolToData[userClaim.pool].token0;\n        }\n\n        uint256 owed = (totalTokenOut * depositAmount) / totalTokenDeposited;\n\n        // Transfer tokens owed to user.\n        tokenOut.safeTransfer(user, owed);\n```\n