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][bug]: Non-monotonic square root function allows for multiple ticks to represent the same square root price #5517

Closed
AlpinYukseloglu opened this issue Jun 14, 2023 · 1 comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board T:bug 🐛 Something isn't working

Comments

@AlpinYukseloglu
Copy link
Contributor

AlpinYukseloglu commented Jun 14, 2023

Background

Since our ApproxRoot function is non-monotonic (ref: #5518), it is possible for multiple square root values to map to the same output. This allows for tick checks (potentially even those implemented in #5516) to be bypassed, risking another attack vector similar to #5493.

Suggested Design

  • Implement a monotonic square root function such that if p1 > p0, then ApproxRoot(p1) > ApproxRoot(p0) regardless of error in ApproxRoot

Acceptance Criteria

  • All new and existing tests pass, and monotonicity is tested for new ApproxRoot function
@AlpinYukseloglu
Copy link
Contributor Author

Fixed by #5543

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 T:bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant