Skip to content

Commit 6238c82

Browse files
authored
refactor: update setRebaseRateMax function to clarify APR parameters and improve documentation (#2785)
1 parent 05c8ac0 commit 6238c82

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

contracts/contracts/vault/VaultAdmin.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,19 @@ abstract contract VaultAdmin is VaultCore {
122122
// slither-disable-start reentrancy-no-eth
123123
/**
124124
* @notice Set a yield streaming max rate. This spreads yield over
125-
* time if it is above the max rate.
126-
* @param yearlyApr in 1e18 notation. 3 * 1e18 = 3% APR
125+
* time if it is above the max rate. This is a per rebase APR which
126+
* due to compounding differs from the yearly APR. Governance should
127+
* consider this fact when picking a desired APR
128+
* @param apr in 1e18 notation. 3 * 1e18 = 3% APR
127129
*/
128-
function setRebaseRateMax(uint256 yearlyApr)
130+
function setRebaseRateMax(uint256 apr)
129131
external
130132
onlyGovernorOrStrategist
131133
{
132134
// The old yield will be at the old rate
133135
_rebase();
134136
// Change the rate
135-
uint256 newPerSecond = yearlyApr / 100 / 365 days;
137+
uint256 newPerSecond = apr / 100 / 365 days;
136138
require(newPerSecond <= MAX_REBASE_PER_SECOND, "Rate too high");
137139
rebasePerSecondMax = newPerSecond.toUint64();
138140
emit RebasePerSecondMaxChanged(newPerSecond);

0 commit comments

Comments
 (0)