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

investigate: track fee balances separately from pool liquidity balances #4786

Closed
p0mvn opened this issue Mar 29, 2023 · 0 comments · Fixed by #5230
Closed

investigate: track fee balances separately from pool liquidity balances #4786

p0mvn opened this issue Mar 29, 2023 · 0 comments · Fixed by #5230
Assignees
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board

Comments

@p0mvn
Copy link
Member

p0mvn commented Mar 29, 2023

Background

Similar to #4785 , we currently track unclaimed fees in the same module account with pool liquidity and incentives.

This poses a security risk because if there is an accounting problem with accumulators when claiming fees, the upper bound is the entire pool liquidity.

Contrary to CFMM pools, fees do not contribute to the pool liquidity / are not reinvested in CL>

However, separating fees from pool balances is no as trivial as #4785 due to low-level accounting stemming from bank transfers that operate on ints and fee accumulators that operate on decimals.

Additionally, from looking into Uniswap code, it seems to me that they also track fees together with pool balances.

My interpretation is consistent with chat gpt discussions:
image

Suggested Design

Investigate if we can implement fees being tracked in a separate account from pool liquidity without affecting calculations too much.

Acceptance Criteria

  • decide if the suggestion is worth being pursued
    • if yes, implement it
    • if not, close issue
@p0mvn p0mvn added the F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board label Mar 29, 2023
@github-project-automation github-project-automation bot moved this to Needs Triage 🔍 in Osmosis Chain Development Mar 29, 2023
@p0mvn p0mvn moved this from Needs Triage 🔍 to Todo 🕒 in Osmosis Chain Development Mar 30, 2023
@p0mvn p0mvn assigned czarcas7ic and unassigned czarcas7ic Mar 30, 2023
@p0mvn p0mvn moved this from Todo 🕒 to Needs Triage 🔍 in Osmosis Chain Development Apr 10, 2023
@czarcas7ic czarcas7ic self-assigned this May 17, 2023
@czarcas7ic czarcas7ic moved this from Needs Triage 🔍 to In Progress🏃 in Osmosis Chain Development May 18, 2023
@github-project-automation github-project-automation bot moved this from In Progress🏃 to Done ✅ in Osmosis Chain Development May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants