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

LQT: Indexing V2 #5113

Open
wants to merge 7 commits into
base: protocol/lqt_branch
Choose a base branch
from
Open

Conversation

cronokirby
Copy link
Contributor

Describe your changes

This updates the lqt indexing to provide what should be more or less a backing of the UI we want to end up with.

Compared to other indexers, this innovates by:

  • using a schema to have a nice namespace, rather than an ad-hoc table naming structure,
  • trying to lean more on SQL instead of Rust.

I've found the latter to be quite beneficial compared to the dex work. It does require some more prowess in SQL, but it is at least 50% less tedious to update a view than it is to update the Rust code. One big advantage is that you don't have to write out all the boilerplate needed to read the backing tables into Rust, which saves a lot of code.

Testing

Unfortunately, this won't work well on the testnet, because we don't have genesis params for the LQT.

On a devnet I ran this with a few interactions, getting the following results:
image
image
image

These all seem coherent at a basic level to me.

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Indexing only

This also does a bit of refactoring to avoid repeated logic w.r.t.
calculating position metrics. This extends to the actual volume tracking
itself, but there should be no functional changes anywhere because of this.
This will match what the UI will actually be.
@cronokirby cronokirby marked this pull request as draft February 28, 2025 22:15
@cronokirby cronokirby marked this pull request as ready for review February 28, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant