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

CL: investigate removing a hack in tick updates when stopping swap within a bucket #5571

Closed
p0mvn opened this issue Jun 19, 2023 · 0 comments
Assignees
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board

Comments

@p0mvn
Copy link
Member

p0mvn commented Jun 19, 2023

Background

#5526 added a hack that was breaking some swap tick iterator tests:

// TEMPORARY HACK: this is to fix tick rounding error where
// the tick is off by 1 due to banker's rounding error in CalculatePriceToTick
// TODO: if this is to remain in the codebase, consider abstracting this into a
// method of swap strategy.
isZeroForOne := getZeroForOne(tokenInMin.Denom, p.GetToken0())
if isZeroForOne {
if newTick <= swapState.tick {
swapState.tick = newTick
}
} else {
if newTick > swapState.tick {
swapState.tick = newTick
}
}

Upon merging #5541, some of the branches stopped being hit by tests. Ref: https://github.com/osmosis-labs/osmosis/pull/5526/files#r1234321848

Suggested Design

After #5543 is merged, we should investigate removing the hack or ensuring that each branch is covered by a test and has an explanation

Acceptance Criteria

@p0mvn p0mvn added the F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board label Jun 19, 2023
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Osmosis Chain Development Jun 19, 2023
@p0mvn p0mvn self-assigned this Jun 19, 2023
@p0mvn p0mvn closed this as completed Jun 22, 2023
@github-project-automation github-project-automation bot moved this from Needs Triage 🔍 to Done ✅ in Osmosis Chain Development Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board
Projects
Archived in project
Development

No branches or pull requests

1 participant