Skip to content

feat: allow indexers to know pool_id without a chain query#876

Closed
dib542 wants to merge 2 commits intoneutron-org:mainfrom
dib542:feat/better-indexing-of-dex-shares
Closed

feat: allow indexers to know pool_id without a chain query#876
dib542 wants to merge 2 commits intoneutron-org:mainfrom
dib542:feat/better-indexing-of-dex-shares

Conversation

@dib542
Copy link
Contributor

@dib542 dib542 commented Mar 30, 2025

Currently there is no way to determine a dex pool's properties (TickIndex and Fee) from every possible dex deposit and withdrawal without performing a chain query (eg. neutrond q dex show-pool-metadata 1).

This is very inconvenient for indexers that are attempting to stream real-time data about user<>dex positions and user<>vault<>dex as they are being made, as the requirement to query the chain separately both complicates and slows down the process to stream the data.

The easiest fix is to add the pool ID to the deposit and withdrawal events. An alternative approach would be a separate "new pool" event that would need to be before the deposit or withdrawal, however this is less convenient. It is helpful that the pool ID is attached to the related deposits and withdrawals as it provides an easy way to calculate the running total shares of each pool (sum of SharesMinted - SharesRemoved).

Copy link
Contributor

@jcompagni10 jcompagni10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@jcompagni10 jcompagni10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls fix linter errors

@jcompagni10
Copy link
Contributor

@dib542
Copy link
Contributor Author

dib542 commented May 12, 2025

@jcompagni10 fixed linter errors 🙏

@dib542
Copy link
Contributor Author

dib542 commented May 13, 2025

Closed in favor of #912

@dib542 dib542 closed this May 13, 2025
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.

2 participants