CVX/AURA distribution calculation is incorrect and will lead to loss of rewards at the end of each cliff
WAuraPools.sol#L233-L248\\n```\\n    if (cliff < totalCliffs) {\\n        /// e.g. (new) reduction = (500 - 100) * 2.5 + 700 = 1700;\\n        /// e.g. (new) reduction = (500 - 250) * 2.5 + 700 = 1325;\\n        /// e.g. (new) reduction = (500 - 400) * 2.5 + 700 = 950;\\n        uint256 reduction = ((totalCliffs - cliff) * 5) / 2 + 700;\\n        /// e.g. (new) amount = 1e19 * 1700 / 500 =  34e18;\\n        /// e.g. (new) amount = 1e19 * 1325 / 500 =  26.5e18;\\n        /// e.g. (new) amount = 1e19 * 950 / 500  =  19e17;\\n        mintAmount = (mintRequestAmount * reduction) / totalCliffs;\\n\\n        /// e.g. amtTillMax = 5e25 - 1e25 = 4e25\\n        uint256 amtTillMax = emissionMaxSupply - emissionsMinted;\\n        if (mintAmount > amtTillMax) {\\n            mintAmount = amtTillMax;\\n        }\\n    }\\n```\\n\\nThe above code is used to calculate the amount of AURA owed to the user. This calculation is perfectly accurate if the AURA hasn't been minted yet. The problem is that each time a user withdraws, AURA is claimed for ALL vault participants. This means that the rewards will be realized for a majority of users before they themselves withdraw. Since the emissions decrease with each cliff, there will be loss of funds at the end of each cliff.\\nExample: Assume for simplicity there are only 2 cliffs. User A deposits LP to WAuraPools. After some time User B deposits as well. Before the end of the first cliff User A withdraw. This claims all tokens owed to both users A and B which is now sitting in the contract. Assume both users are owed 10 tokens. Now User B waits for the second cliff to end before withdrawing. When calculating his rewards it will give him no rewards since all cliffs have ended. The issue is that the 10 tokens they are owed is already sitting in the contract waiting to be claimed.
I would recommend a hybrid approach. When rewards are claimed upon withdrawal, the reward per token should be cached to prevent loss of tokens that have already been received by the contract. Only unminted AURA should be handled this way.
All users will lose rewards at the end of each cliff due to miscalculation
```\\n    if (cliff < totalCliffs) {\\n        /// e.g. (new) reduction = (500 - 100) * 2.5 + 700 = 1700;\\n        /// e.g. (new) reduction = (500 - 250) * 2.5 + 700 = 1325;\\n        /// e.g. (new) reduction = (500 - 400) * 2.5 + 700 = 950;\\n        uint256 reduction = ((totalCliffs - cliff) * 5) / 2 + 700;\\n        /// e.g. (new) amount = 1e19 * 1700 / 500 =  34e18;\\n        /// e.g. (new) amount = 1e19 * 1325 / 500 =  26.5e18;\\n        /// e.g. (new) amount = 1e19 * 950 / 500  =  19e17;\\n        mintAmount = (mintRequestAmount * reduction) / totalCliffs;\\n\\n        /// e.g. amtTillMax = 5e25 - 1e25 = 4e25\\n        uint256 amtTillMax = emissionMaxSupply - emissionsMinted;\\n        if (mintAmount > amtTillMax) {\\n            mintAmount = amtTillMax;\\n        }\\n    }\\n```\\n