```\nfunction distributeFeeIfApplicable(uint amount) internal {\n    updateTokenPriceIfApplicable();\n\n    if (\n        FixedPoint.mulDecode(tokenPrice, amount) >= feeDistributionTransactionThreshold &&\n        FixedPoint.mulDecode(tokenPrice, balanceOf[address(this)]) >= feeDistributionBalanceThreshold\n    ) {\n        distributeFee();\n    }\n}\n```\n