@@ -94,8 +94,8 @@ contract UFragmentsPolicy is Ownable {
9494
9595 // DECIMALS decimal fixed point numbers.
9696 // Used in computation of (Upper-Lower)/(1-(Upper/Lower)/2^(Growth*delta))) + Lower
97- int256 public rebaseFunctionLowerPercentage ;
98- int256 public rebaseFunctionUpperPercentage ;
97+ int256 public rebaseFunctionNegativePercentageLimit ;
98+ int256 public rebaseFunctionPositivePercentageLimit ;
9999 int256 public rebaseFunctionPositiveGrowth;
100100 int256 public rebaseFunctionNegativeGrowth;
101101
@@ -167,21 +167,20 @@ contract UFragmentsPolicy is Ownable {
167167 orchestrator = orchestrator_;
168168 }
169169
170-
171- function setRebaseFunctionLowerPercentage (int256 rebaseFunctionLowerPercentage_ )
170+ function setRebaseFunctionNegativePercentageLimit (int256 rebaseFunctionNegativePercentageLimit_ )
172171 external
173172 onlyOwner
174173 {
175- require (rebaseFunctionLowerPercentage_ <= 0 );
176- rebaseFunctionLowerPercentage = rebaseFunctionLowerPercentage_ ;
174+ require (rebaseFunctionNegativePercentageLimit_ <= 0 );
175+ rebaseFunctionNegativePercentageLimit = rebaseFunctionNegativePercentageLimit_ ;
177176 }
178177
179- function setRebaseFunctionUpperPercentage (int256 rebaseFunctionUpperPercentage_ )
178+ function setRebaseFunctionPositivePercentageLimit (int256 rebaseFunctionPositivePercentageLimit_ )
180179 external
181180 onlyOwner
182181 {
183- require (rebaseFunctionUpperPercentage_ >= 0 );
184- rebaseFunctionUpperPercentage = rebaseFunctionUpperPercentage_ ;
182+ require (rebaseFunctionPositivePercentageLimit_ >= 0 );
183+ rebaseFunctionPositivePercentageLimit = rebaseFunctionPositivePercentageLimit_ ;
185184 }
186185
187186 function setRebaseFunctionPositiveGrowth (int256 rebaseFunctionPositiveGrowth_ ) external onlyOwner {
@@ -255,8 +254,8 @@ contract UFragmentsPolicy is Ownable {
255254
256255 rebaseFunctionPositiveGrowth = int256 (45 * (10 ** DECIMALS)); // Positive growth
257256 rebaseFunctionNegativeGrowth = int256 (45 * (10 ** DECIMALS)); // Negative growth
258- rebaseFunctionUpperPercentage = int256 (5 * (10 ** (DECIMALS - 2 ))); // 0.05
259- rebaseFunctionLowerPercentage = int256 ((- 77 ) * int256 (10 ** (DECIMALS - 3 ))); // -0.077
257+ rebaseFunctionPositivePercentageLimit = int256 (5 * (10 ** (DECIMALS - 2 ))); // 0.05
258+ rebaseFunctionNegativePercentageLimit = int256 ((- 77 ) * int256 (10 ** (DECIMALS - 3 ))); // -0.077
260259
261260 minRebaseTimeIntervalSec = 1 days ;
262261 rebaseWindowOffsetSec = 7200 ; // 2AM UTC
@@ -346,9 +345,19 @@ contract UFragmentsPolicy is Ownable {
346345 // Determine growth and bounds based on positive or negative rebase
347346 int256 rebasePercentage;
348347 if (normalizedRate >= ONE) {
349- rebasePercentage = computeRebasePercentage (normalizedRate, - rebaseFunctionUpperPercentage, rebaseFunctionUpperPercentage, rebaseFunctionPositiveGrowth);
348+ rebasePercentage = computeRebasePercentage (
349+ normalizedRate,
350+ - rebaseFunctionPositivePercentageLimit,
351+ rebaseFunctionPositivePercentageLimit,
352+ rebaseFunctionPositiveGrowth
353+ );
350354 } else {
351- rebasePercentage = computeRebasePercentage (normalizedRate, rebaseFunctionLowerPercentage, - rebaseFunctionLowerPercentage, rebaseFunctionNegativeGrowth);
355+ rebasePercentage = computeRebasePercentage (
356+ normalizedRate,
357+ rebaseFunctionNegativePercentageLimit,
358+ - rebaseFunctionNegativePercentageLimit,
359+ rebaseFunctionNegativeGrowth
360+ );
352361 }
353362
354363 return uFrags.totalSupply ().toInt256Safe ().mul (rebasePercentage).div (ONE);
0 commit comments