{
    "Function": "_calculateCurrencyAmount",
    "File": "src/InvestmentManager.sol",
    "Parent Contracts": [
        "src/util/Auth.sol"
    ],
    "High-Level Calls": [
        "MathLib"
    ],
    "Internal Calls": [
        "_toPriceDecimals",
        "_getPoolDecimals",
        "_fromPriceDecimals"
    ],
    "Library Calls": [
        "mulDiv"
    ],
    "Low-Level Calls": [],
    "Code": "function _calculateCurrencyAmount(uint128 trancheTokenAmount, address liquidityPool, uint256 price)\n        internal\n        view\n        returns (uint128 currencyAmount)\n    {\n        (uint8 currencyDecimals, uint8 trancheTokenDecimals) = _getPoolDecimals(liquidityPool);\n\n        uint256 currencyAmountInPriceDecimals = _toPriceDecimals(\n            trancheTokenAmount, trancheTokenDecimals, liquidityPool\n        ).mulDiv(price, 10 ** PRICE_DECIMALS, MathLib.Rounding.Down);\n\n        currencyAmount = _fromPriceDecimals(currencyAmountInPriceDecimals, currencyDecimals, liquidityPool);\n    }"
}