Skip to content

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

Merged
pr0n00gler merged 2 commits intomainfrom
feat/better-indexing-of-dex-shares
May 14, 2025
Merged

feat: allow indexers to know pool_id without a chain query#912
pr0n00gler merged 2 commits intomainfrom
feat/better-indexing-of-dex-shares

Conversation

@dib542
Copy link
Contributor

@dib542 dib542 commented May 13, 2025

(this PR is a neutron branch version of #876)

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).

@pr0n00gler
Copy link
Collaborator

@pr0n00gler pr0n00gler merged commit 6e0d381 into main May 14, 2025
18 of 21 checks passed
@dib542 dib542 deleted the feat/better-indexing-of-dex-shares branch May 16, 2025 03:33
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