Skip to content

Commit

Permalink
docs: document riemann avg
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Nov 15, 2023
1 parent fd24cc2 commit 3ea4939
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/SpeedJumpIrm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ contract AdaptativeCurveIrm is IIrm {
startRateAtTarget.wMulDown(MathLib.wExp(linearAdaptation)).bound(MIN_RATE_AT_TARGET, MAX_RATE_AT_TARGET);

// Then we compute the average rate over the period, with a Riemann sum.
// We omit the multiplication by the rectangle length because we would divide everything by the total length
// at the end, because we want to compute the average and not the integral.
int256 averageRateAtTarget;
int256 step = linearAdaptation / N_STEPS;
for (int256 k = 1; k <= N_STEPS; k++) {
Expand Down

0 comments on commit 3ea4939

Please sign in to comment.