-
Notifications
You must be signed in to change notification settings - Fork 607
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
feat: return bucket index of the current tick from LiquidityPerTickRange query #6805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming you've already tested the changes on localosmosis (I just reviewed code).
Had one comment around more clearly defining "bucket" for external users of this query but non-blocking so approving
// Returns index of the bucket that corresponds to the current tick. | ||
// For cases where there is no liqudity in the bucket but there may be liquidity to the right, the value will be -1. | ||
// For cases where there is no liquidity in the bucket but there may be liquidity to the left, the value will be len(liquidityDepthsForRange). | ||
// Otherwise, the index points to the bucket that corresponds to the current tick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to more concretely define "bucket" vs. "tick" either here or in docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs defines terminologies for these AFAIR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
osmosis/x/concentrated-liquidity/README.md
Lines 1893 to 1895 in f721f73
- `Tick` - a unit that has a 1:1 mapping with price | |
- `Bucket` - an area between two initialized ticks. |
…nge query (#6805) Closes: https://app.clickup.com/t/86a19jj0x ## What is the purpose of the change This PR is an update to the full range liquidity query. It adds a new return parameter that is the bucket index corresponding to the current tick. This functionality is necessary for the SQS router in: #6785 By having this index, we don't have to iterate all ticks in search of the current tick. Instead, we can index into the desired bucket in constant time. ## Testing and Verifying Added unit test and also tested on localosmosis ## Documentation and Release Note - [x] Does this pull request introduce a new feature or user-facing behavior changes? - [x] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A (cherry picked from commit 9755013)
…nge query (#6805) (#6806) Closes: https://app.clickup.com/t/86a19jj0x ## What is the purpose of the change This PR is an update to the full range liquidity query. It adds a new return parameter that is the bucket index corresponding to the current tick. This functionality is necessary for the SQS router in: #6785 By having this index, we don't have to iterate all ticks in search of the current tick. Instead, we can index into the desired bucket in constant time. ## Testing and Verifying Added unit test and also tested on localosmosis ## Documentation and Release Note - [x] Does this pull request introduce a new feature or user-facing behavior changes? - [x] Changelog entry added to `Unreleased` section of `CHANGELOG.md`? Where is the change documented? - [ ] Specification (`x/{module}/README.md`) - [ ] Osmosis documentation site - [ ] Code comments? - [ ] N/A (cherry picked from commit 9755013) Co-authored-by: Roman <[email protected]>
Closes: https://app.clickup.com/t/86a19jj0x
What is the purpose of the change
This PR is an update to the full range liquidity query. It adds a new return parameter that is the bucket index corresponding to the current tick.
This functionality is necessary for the SQS router in: #6785
By having this index, we don't have to iterate all ticks in search of the current tick. Instead, we can index into the desired bucket in constant time.
Testing and Verifying
Added unit test and also tested on localosmosis
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?Where is the change documented?
x/{module}/README.md
)