{
    "Function": "getTransferFee",
    "File": "contracts/hyphen/LiquidityPool.sol",
    "Parent Contracts": [
        "contracts/hyphen/metatx/ERC2771ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
        "contracts/security/Pausable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol",
        "node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [
        "ITokenManager",
        "ITokenManager",
        "ILiquidityProviders"
    ],
    "Internal Calls": [
        "getCurrentLiquidity"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function getTransferFee(address tokenAddress, uint256 amount) public view returns (uint256 fee) {\n        uint256 currentLiquidity = getCurrentLiquidity(tokenAddress);\n        uint256 providedLiquidity = liquidityProviders.getSuppliedLiquidityByToken(tokenAddress);\n\n        uint256 resultingLiquidity = currentLiquidity - amount;\n\n        uint256 equilibriumFee = tokenManager.getTokensInfo(tokenAddress).equilibriumFee;\n        uint256 maxFee = tokenManager.getTokensInfo(tokenAddress).maxFee;\n        // Fee is represented in basis points * 10 for better accuracy\n        uint256 numerator = providedLiquidity * equilibriumFee * maxFee; // F(max) * F(e) * L(e)\n        uint256 denominator = equilibriumFee * providedLiquidity + (maxFee - equilibriumFee) * resultingLiquidity; // F(e) * L(e) + (F(max) - F(e)) * L(r)\n\n        if (denominator == 0) {\n            fee = 0;\n        } else {\n            fee = numerator / denominator;\n        }\n    }"
}