{
    "Function": "_estimateSellAmount",
    "File": "contracts/routers/StrategyRouter.sol",
    "Parent Contracts": [
        "contracts/helpers/StrategyTypes.sol",
        "contracts/interfaces/IStrategyRouter.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "IERC20",
        "SafeMath"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "div",
        "mul"
    ],
    "Low-Level Calls": [],
    "Code": "function _estimateSellAmount(\n        address strategy,\n        address token,\n        uint256 amount,\n        uint256 estimatedValue\n    ) internal view returns (uint256) {\n        uint256 balance = IERC20(token).balanceOf(strategy);\n        if (estimatedValue > amount) {\n          return balance.mul(amount).div(estimatedValue);\n        } else {\n          return balance;\n        }\n    }"
}