@@ -344,17 +344,24 @@ contract UFragmentsPolicy is Ownable {
344
344
int256 normalizedRate = rate.toInt256Safe ().mul (ONE).div (targetRateSigned);
345
345
346
346
// Determine growth and bounds based on positive or negative rebase
347
- int256 growth = normalizedRate >= ONE
348
- ? rebaseFunctionPositiveGrowth
349
- : rebaseFunctionNegativeGrowth;
350
- int256 lower = normalizedRate >= ONE
351
- ? - rebaseFunctionUpperPercentage
352
- : rebaseFunctionLowerPercentage;
353
- int256 upper = normalizedRate >= ONE
354
- ? rebaseFunctionUpperPercentage
355
- : - rebaseFunctionLowerPercentage;
356
-
357
- int256 rebasePercentage = computeRebasePercentage (normalizedRate, lower, upper, growth);
347
+ int256 rebasePercentage;
348
+
349
+ if (normalizedRate >= ONE) {
350
+ rebasePercentage = computeRebasePercentage (normalizedRate, - rebaseFunctionUpperPercentage, rebaseFunctionUpperPercentage, rebaseFunctionPositiveGrowth);
351
+ } else {
352
+ rebasePercentage = computeRebasePercentage (normalizedRate, rebaseFunctionLowerPercentage, - rebaseFunctionLowerPercentage, rebaseFunctionNegativeGrowth);
353
+ }
354
+ // int256 growth = normalizedRate >= ONE
355
+ // ? rebaseFunctionPositiveGrowth
356
+ // : rebaseFunctionNegativeGrowth;
357
+ // int256 lower = normalizedRate >= ONE
358
+ // ? -rebaseFunctionUpperPercentage
359
+ // : rebaseFunctionLowerPercentage;
360
+ // int256 upper = normalizedRate >= ONE
361
+ // ? rebaseFunctionUpperPercentage
362
+ // : -rebaseFunctionLowerPercentage;
363
+
364
+ // int256 rebasePercentage = computeRebasePercentage(normalizedRate, lower, upper, growth);
358
365
return uFrags.totalSupply ().toInt256Safe ().mul (rebasePercentage).div (ONE);
359
366
}
360
367
0 commit comments