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] Improve Performance of Liquidity Query via using iterators #4704

Closed
mattverse opened this issue Mar 23, 2023 · 0 comments · Fixed by #4805
Closed

[CL] Improve Performance of Liquidity Query via using iterators #4704

mattverse opened this issue Mar 23, 2023 · 0 comments · Fixed by #4805
Assignees
Labels
C:x/concentrated-liquidity F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board

Comments

@mattverse
Copy link
Member

mattverse commented Mar 23, 2023

Background

In PR #4691 and #4714, we introduced a query to obtain the total liquidity across the entire pool. Currently, we iterate to the next pool using the NextInitializedTick method, which presents an opportunity to enhance performance. We aim to achieve this performance improvement by employing iterators and store helpers.

Unfortunately, we cannot directly use store helpers, as they do not provide an iteration method with a stop function that returns both key-value pairs. Moreover, using store helpers might not be the most efficient approach, as we need to use the poolId to parse the key and extract the tick values.

To address these concerns and optimize performance, we can explore two potential methods: creating a new store helper in osmoutils or utilizing iterators directly. Regardless of the chosen approach, our goal is to improve the performance of this query by leveraging iterators more effectively.

Suggested Design

  • Remove using nextInitializedTick and changing it to use iterators
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
Projects
Archived in project
1 participant