-
Notifications
You must be signed in to change notification settings - Fork 311
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
dex: create epoch-based cumulative volume indices #5015
Comments
cronokirby
added a commit
that referenced
this issue
Jan 30, 2025
## Describe your changes This PR: - expose a component level api `LqtRead` - define two new DEX state key modules: `lqt::v1::lp` and `lqt::v1::pair` - implements a `position_manager::volume_tracker` - stubs out the inner position manager entrypoint, deferring implementation to later ## Volume definition We track the **outflow** of staking tokens from the position. This means that an attacker controlled asset must commit to a staking token inventory for at least a full block execution. ## State key modeling The lookup index maps an epoch index and a position id to a cumulative volume tally. The full sorted index orders position ids by cumulative volume (keyed to the epoch). ## Issue ticket number and link Part of #5015 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. N/A - [x] 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: > LQT branch --------- Signed-off-by: Erwan Or <[email protected]> Co-authored-by: Lúcás Meier <[email protected]>
conorsch
pushed a commit
that referenced
this issue
Jan 31, 2025
## Describe your changes This PR: - expose a component level api `LqtRead` - define two new DEX state key modules: `lqt::v1::lp` and `lqt::v1::pair` - implements a `position_manager::volume_tracker` - stubs out the inner position manager entrypoint, deferring implementation to later ## Volume definition We track the **outflow** of staking tokens from the position. This means that an attacker controlled asset must commit to a staking token inventory for at least a full block execution. ## State key modeling The lookup index maps an epoch index and a position id to a cumulative volume tally. The full sorted index orders position ids by cumulative volume (keyed to the epoch). ## Issue ticket number and link Part of #5015 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. N/A - [x] 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: > LQT branch --------- Signed-off-by: Erwan Or <[email protected]> Co-authored-by: Lúcás Meier <[email protected]>
conorsch
pushed a commit
that referenced
this issue
Feb 4, 2025
## Describe your changes This PR: - expose a component level api `LqtRead` - define two new DEX state key modules: `lqt::v1::lp` and `lqt::v1::pair` - implements a `position_manager::volume_tracker` - stubs out the inner position manager entrypoint, deferring implementation to later ## Volume definition We track the **outflow** of staking tokens from the position. This means that an attacker controlled asset must commit to a staking token inventory for at least a full block execution. ## State key modeling The lookup index maps an epoch index and a position id to a cumulative volume tally. The full sorted index orders position ids by cumulative volume (keyed to the epoch). ## Issue ticket number and link Part of #5015 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. N/A - [x] 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: > LQT branch --------- Signed-off-by: Erwan Or <[email protected]> Co-authored-by: Lúcás Meier <[email protected]>
conorsch
pushed a commit
that referenced
this issue
Feb 5, 2025
## Describe your changes This PR: - expose a component level api `LqtRead` - define two new DEX state key modules: `lqt::v1::lp` and `lqt::v1::pair` - implements a `position_manager::volume_tracker` - stubs out the inner position manager entrypoint, deferring implementation to later ## Volume definition We track the **outflow** of staking tokens from the position. This means that an attacker controlled asset must commit to a staking token inventory for at least a full block execution. ## State key modeling The lookup index maps an epoch index and a position id to a cumulative volume tally. The full sorted index orders position ids by cumulative volume (keyed to the epoch). ## Issue ticket number and link Part of #5015 ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. N/A - [x] 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: > LQT branch --------- Signed-off-by: Erwan Or <[email protected]> Co-authored-by: Lúcás Meier <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We want to track the staking token denominated "outbound" volume that goes through a liquidity position. We use a sorted volume index, equipped with a lookup table to update entries.
State keys
dex/lqt/v1/lp/lookup/ || asset || position_id
** is a cumulative volume lookup tabledex/lqt/v1/lp/by_asset/ || asset || BE(!volume) || position_id
is a sorted index that tracks best performing LPsThe text was updated successfully, but these errors were encountered: