Skip to content

Commit

Permalink
M-04
Browse files Browse the repository at this point in the history
  • Loading branch information
Picodes committed Jul 14, 2023
1 parent 6f2ffcb commit 337c65d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contracts/savings/SavingsVest.sol
Expand Up @@ -176,7 +176,12 @@ contract SavingsVest is BaseSavings {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

/// @notice Provides an estimated Annual Percentage Rate for base depositors on this contract
/// @dev This method is not meant to be accurate over time as the APR on the long run depends on the frequency of
/// calls to `accrue` versus the `vestingPeriod`
function estimatedAPR() external view returns (uint256 apr) {
// If everything has been vested current APR is 0
if (lockedProfit() == 0) return 0;

uint256 currentlyVestingProfit = vestingProfit;
uint256 weightedAssets = vestingPeriod * totalAssets();
if (currentlyVestingProfit != 0 && weightedAssets != 0)
Expand Down

0 comments on commit 337c65d

Please sign in to comment.