@@ -94,8 +94,8 @@ contract UFragmentsPolicy is Ownable {
94
94
95
95
// DECIMALS decimal fixed point numbers.
96
96
// 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 ;
99
99
int256 public rebaseFunctionPositiveGrowth;
100
100
int256 public rebaseFunctionNegativeGrowth;
101
101
@@ -167,21 +167,20 @@ contract UFragmentsPolicy is Ownable {
167
167
orchestrator = orchestrator_;
168
168
}
169
169
170
-
171
- function setRebaseFunctionLowerPercentage (int256 rebaseFunctionLowerPercentage_ )
170
+ function setRebaseFunctionNegativePercentageLimit (int256 rebaseFunctionNegativePercentageLimit_ )
172
171
external
173
172
onlyOwner
174
173
{
175
- require (rebaseFunctionLowerPercentage_ <= 0 );
176
- rebaseFunctionLowerPercentage = rebaseFunctionLowerPercentage_ ;
174
+ require (rebaseFunctionNegativePercentageLimit_ <= 0 );
175
+ rebaseFunctionNegativePercentageLimit = rebaseFunctionNegativePercentageLimit_ ;
177
176
}
178
177
179
- function setRebaseFunctionUpperPercentage (int256 rebaseFunctionUpperPercentage_ )
178
+ function setRebaseFunctionPositivePercentageLimit (int256 rebaseFunctionPositivePercentageLimit_ )
180
179
external
181
180
onlyOwner
182
181
{
183
- require (rebaseFunctionUpperPercentage_ >= 0 );
184
- rebaseFunctionUpperPercentage = rebaseFunctionUpperPercentage_ ;
182
+ require (rebaseFunctionPositivePercentageLimit_ >= 0 );
183
+ rebaseFunctionPositivePercentageLimit = rebaseFunctionPositivePercentageLimit_ ;
185
184
}
186
185
187
186
function setRebaseFunctionPositiveGrowth (int256 rebaseFunctionPositiveGrowth_ ) external onlyOwner {
@@ -255,8 +254,8 @@ contract UFragmentsPolicy is Ownable {
255
254
256
255
rebaseFunctionPositiveGrowth = int256 (45 * (10 ** DECIMALS)); // Positive growth
257
256
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
260
259
261
260
minRebaseTimeIntervalSec = 1 days ;
262
261
rebaseWindowOffsetSec = 7200 ; // 2AM UTC
@@ -346,9 +345,19 @@ contract UFragmentsPolicy is Ownable {
346
345
// Determine growth and bounds based on positive or negative rebase
347
346
int256 rebasePercentage;
348
347
if (normalizedRate >= ONE) {
349
- rebasePercentage = computeRebasePercentage (normalizedRate, - rebaseFunctionUpperPercentage, rebaseFunctionUpperPercentage, rebaseFunctionPositiveGrowth);
348
+ rebasePercentage = computeRebasePercentage (
349
+ normalizedRate,
350
+ - rebaseFunctionPositivePercentageLimit,
351
+ rebaseFunctionPositivePercentageLimit,
352
+ rebaseFunctionPositiveGrowth
353
+ );
350
354
} else {
351
- rebasePercentage = computeRebasePercentage (normalizedRate, rebaseFunctionLowerPercentage, - rebaseFunctionLowerPercentage, rebaseFunctionNegativeGrowth);
355
+ rebasePercentage = computeRebasePercentage (
356
+ normalizedRate,
357
+ rebaseFunctionNegativePercentageLimit,
358
+ - rebaseFunctionNegativePercentageLimit,
359
+ rebaseFunctionNegativeGrowth
360
+ );
352
361
}
353
362
354
363
return uFrags.totalSupply ().toInt256Safe ().mul (rebasePercentage).div (ONE);
0 commit comments