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

Add pindexer support for position timelines in the DEX explorer #4946

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

hdevalence
Copy link
Member

Describe your changes

These changes index the states of individual positions, allowing the dex explorer to render position timelines, allowing users to inspect their position history.

This also updates sqlx along the way.

Once these changes are merged, we'll need to trigger a reindex on the dev indexer.

Checklist before requesting a review

  • 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:

    indexer changes only

Comment on lines +214 to +223
"cc0d3c9eef0c7ff4e225eca85a3094603691d289aeaf428ab0d87319ad93a302", // USDY
"a7a339f42e671b2db1de226d4483d3e63036661cad1554d75f5f76fe04ec1e00", // SHITMOS
"29ea9c2f3371f6a487e7e95c247041f4a356f983eb064e5d2b3bcf322ca96a10", // UM
"76b3e4b10681358c123b381f90638476b7789040e47802de879f0fb3eedc8d0b", // USDC
"2923a0a87b3a2421f165cc853dbf73a9bdafb5da0d948564b6059cb0217c4407", // OSMO
"07ef660132a4c3235fab272d43d9b9752a8337b2d108597abffaff5f246d0f0f", // ATOM
"5314b33eecfd5ca2e99c0b6d1e0ccafe3d2dd581c952d814fb64fdf51f85c411", // TIA
"516108d0d0bba3f76e1f982d0a7cde118833307b03c0cd4ccb94e882b53c1f0f", // WBTC
"414e723f74bd987c02ccbc997585ed52b196e2ffe75b3793aa68cc2996626910", // allBTC
"bf8b035dda339b6cda8f221e79773b0fd871f27a472920f84c4aa2b4f98a700d", // allUSDT
Copy link
Member Author

Choose a reason for hiding this comment

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

I wrote this test while inspecting the data, and figured it would be useful to have a record of.

@hdevalence
Copy link
Member Author

No idea what the crate features error is about and the CI job doesn't say what the problem is.

@cronokirby
Copy link
Contributor

No idea what the crate features error is about and the CI job doesn't say what the problem is.

bumping the sqlx version might've done this, if there's a transitive dep which requires bumping the Rust version

@hdevalence hdevalence force-pushed the pindexer-dex-ex-position-timeline branch from 8239530 to 67a261b Compare December 2, 2024 23:31
This reverts commit c011f8c.

(Attempting to fix weird build issues in dependencies)
Comment on lines +128 to +129
height INTEGER NOT NULL,
time TIMESTAMPTZ NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

these are redundant if we link to the reserves, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, my thought was that they would be useful to have on hand when looking at an execution individually and there's not an issue with normalization for this application

Copy link
Member Author

Choose a reason for hiding this comment

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

Either way. Not particularly attached but also don't see a compelling reason not to have the data there.

Comment on lines +154 to +155
height INTEGER NOT NULL,
time TIMESTAMPTZ NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

Also redundant if we reference the reserves

Copy link
Member Author

Choose a reason for hiding this comment

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

Same reasoning

@hdevalence
Copy link
Member Author

@cronokirby FYI the reason I pulled newer sqlx was to get a conversion impl for the numeric types that didn't exist before (not otherwise attached to it but i think it would require more custom code to use the older version)

This adds a BigDecimal::from(u128) method which is very nice to have.
@cronokirby cronokirby merged commit 32963ba into main Dec 3, 2024
14 checks passed
@cronokirby cronokirby deleted the pindexer-dex-ex-position-timeline branch December 3, 2024 16:58
@conorsch conorsch mentioned this pull request Dec 9, 2024
6 tasks
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