Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riemann average #82

Merged
merged 32 commits into from
Nov 16, 2023
Merged

Riemann average #82

merged 32 commits into from
Nov 16, 2023

Conversation

MathisGD
Copy link
Contributor

@MathisGD MathisGD commented Nov 15, 2023

Change

Uses Riemann sum to compute the integral (average) of the rate over the period. This method is much more robust than the previous analytical one.

The maths are written in the code directly.

Fixes:

Gas diff with refactor/curve

image

@MathisGD MathisGD changed the base branch from main to refactor/curve November 15, 2023 15:20
@MathisGD MathisGD self-assigned this Nov 15, 2023
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
@MathisGD MathisGD marked this pull request as ready for review November 15, 2023 18:16
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@Rubilmax Rubilmax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think this PR is fine, though I didn't have time to check the maths

There may be changes in how we store constants due to #66

src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
@peyha

This comment was marked as resolved.

test/SpeedJumpIrmTest.sol Show resolved Hide resolved
@MerlinEgalite MerlinEgalite merged commit 4637e31 into refactor/curve Nov 16, 2023
3 checks passed
@MerlinEgalite MerlinEgalite deleted the feat/riemann-avg branch November 16, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants