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 Test): Add tests for inverse relationship testing between TickToPrice and PriceToTick #3993

Closed
mattverse opened this issue Jan 12, 2023 · 7 comments · Fixed by #4060
Closed
Assignees
Labels
C:x/concentrated-liquidity F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board Help wanted

Comments

@mattverse
Copy link
Member

Background

Upon implementing #3874 tick spacing), we have re-implemented TickToPrice function and PriceToTick function.

As we test the inverse relationship for joinPool and exitPool in the gamm module, it would be best if we could add a test for ensuring the inverse calculation between the two methods.

Acceptance Criteria

  • Added test case using pre-defined test vectors that calls TickToPrice and then using the returned value calling PriceToTick and then checking if we get the same test vectors that we used as inputs
@mattverse mattverse added C:x/concentrated-liquidity F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board labels Jan 12, 2023
@github-project-automation github-project-automation bot moved this to Needs Review 🔍 in Osmosis Chain Development Jan 12, 2023
@p0mvn
Copy link
Member

p0mvn commented Jan 13, 2023

Marked this as "Help wanted" since this test is not on the critical path.

@hieuvubk
Copy link
Contributor

Hi could I work with it @mattverse @p0mvn

@mattverse
Copy link
Member Author

@hieuvubk yes please!

@hieuvubk hieuvubk self-assigned this Jan 16, 2023
@ThanhNhann
Copy link
Contributor

Hey @mattverse, I checked the code again and see that the TickToPrice function is not in main branch right now, can you plz check it?

@ThanhNhann
Copy link
Contributor

I see that this #4003 had changed TickToPrice to TicksToSqrtPrice, should we change the name function to keep working on this issue? @mattverse

@mattverse
Copy link
Member Author

@ThanhNhann Yes in this case, lets test inverse relationship between TicksToSqrtPrice and PriceToTick. Im assuming that there would be a little bit of margin of error that would have to be considered when designing the test cases

@ThanhNhann
Copy link
Contributor

Thank @mattverse, I have updated the tests

@github-project-automation github-project-automation bot moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/concentrated-liquidity F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board Help wanted
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants