```\nfunction _convertToToken(address token, address receiver) internal returns (uint256 amountOut) {\n    // this value should be whatever glp is received by calling withdraw/redeem to junior vault\n    uint256 outputGlp = fsGlp.balanceOf(address(this));\n\n    // using min price of glp because giving in glp\n    uint256 glpPrice = _getGlpPrice(false);\n\n    // using max price of token because taking token out of gmx\n    uint256 tokenPrice = gmxVault.getMaxPrice(token);\n\n    // apply slippage threshold on top of estimated output amount\n    uint256 minTokenOut = outputGlp.mulDiv(glpPrice * (MAX_BPS - slippageThreshold), tokenPrice * MAX_BPS);\n\n    // will revert if atleast minTokenOut is not received\n    amountOut = rewardRouter.unstakeAndRedeemGlp(address(token), outputGlp, minTokenOut, receiver);\n}\n```\n