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

ConcentratedLiquidityPool:rangeFeeGrowth issue #338

Open
theKata opened this issue Mar 26, 2022 · 0 comments
Open

ConcentratedLiquidityPool:rangeFeeGrowth issue #338

theKata opened this issue Mar 26, 2022 · 0 comments

Comments

@theKata
Copy link

theKata commented Mar 26, 2022

function rangeFeeGrowth(int24 lowerTick, int24 upperTick) public view returns (uint256 feeGrowthInside0, uint256 feeGrowthInside1) {
int24 currentTick = nearestTick;
Tick storage lower = ticks[lowerTick];
Tick storage upper = ticks[upperTick];

When calculating feeGrowth, currentTick must be calculated based on the current price for it to be calculated correctly.

  • AS-IS
int24 currentTick = nearestTick; 
  • TO-BE
int24 currentTick = TickMath.getTickAtSqrtRatio(price);
@mshakeg mshakeg mentioned this issue Nov 1, 2022
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

No branches or pull requests

1 participant