{
    "Function": "addDividend",
    "File": "contracts/Router.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "iRESERVE",
        "Pool",
        "iDAO",
        "iDAO",
        "iBEP20"
    ],
    "Internal Calls": [
        "_DAO",
        "revenueDetails",
        "_DAO"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function addDividend(address _pool, uint256 _fees) internal {\n        if(!(normalAverageFee == 0)){\n            uint reserve = iBEP20(BASE).balanceOf(_DAO().RESERVE()); // Get SPARTA balance in the RESERVE contract\n            if(!(reserve == 0)){\n                uint dailyAllocation = (reserve / eraLength) / maxTrades; // Calculate max dividend\n                uint numerator = _fees * dailyAllocation;\n                uint feeDividend = numerator / (_fees + normalAverageFee); // Calculate actual dividend\n                revenueDetails(feeDividend, _pool); // Add to revenue metrics\n                iRESERVE(_DAO().RESERVE()).grantFunds(feeDividend, _pool); // Transfer dividend from RESERVE to POOL\n                Pool(_pool).sync(); // Sync the pool balances to attribute the dividend to the existing LPers\n            }\n        }\n    }"
}