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

Extract coeff computation in curve function #59

Closed
wants to merge 4 commits into from

Conversation

MerlinEgalite
Copy link
Contributor

Based on this suggestion.

@MerlinEgalite MerlinEgalite requested review from a team November 6, 2023 07:37
@MerlinEgalite MerlinEgalite self-assigned this Nov 6, 2023
@MerlinEgalite MerlinEgalite requested review from Rubilmax, Jean-Grimal, QGarchery, peyha and MathisGD and removed request for a team November 6, 2023 07:37
@MerlinEgalite MerlinEgalite changed the title Extract coeff computation Extract coeff computation in curve function Nov 6, 2023
@MerlinEgalite MerlinEgalite mentioned this pull request Nov 6, 2023
@MerlinEgalite MerlinEgalite marked this pull request as ready for review November 6, 2023 07:51
src/SpeedJumpIrm.sol Outdated Show resolved Hide resolved
@@ -163,11 +164,9 @@ contract AdaptativeCurveIrm is IIrm {
/// r = ((1-1/C)*err + 1) * rateAtTarget if err < 0
/// ((C-1)*err + 1) * rateAtTarget else.
function _curve(uint256 _rateAtTarget, int256 err) private view returns (uint256) {
uint256 steeringCoeff = err < 0 ? WAD - WAD.wDivDown(CURVE_STEEPNESS) : CURVE_STEEPNESS - WAD;
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not the steering coefficient but the steering coefficient divided by _rateAtTarget.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So what name do you suggest? just coeff? coeffAdjusted?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest my proposal lol

Copy link
Contributor

Choose a reason for hiding this comment

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

Or we can divide by the denominator now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes but it's not readable to me

@MathisGD
Copy link
Contributor

MathisGD commented Nov 9, 2023

done in #54

@MathisGD MathisGD closed this Nov 9, 2023
@MathisGD MathisGD deleted the refactor/curve-formula branch November 9, 2023 10:25
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.

5 participants