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

refactor: handle GetTotalPoolLiquidity incompatibility with the CL pool #4787

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

refactor: handle GetTotalPoolLiquidity incompatibility with the CL pool #4787

p0mvn opened this issue Mar 29, 2023 · 0 comments · Fixed by #4801
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

Currently, we don't have GetTotalPoolLiquidity implemented for CL:

// TODO: finish this function
func (p Pool) GetTotalPoolLiquidity(ctx sdk.Context) sdk.Coins {
return sdk.Coins{}
}

The reason is that we do not track the pool liquidity directly in the pool struct. Contraty to balancer and stableswap pools, CL only needs current tick liquidity and sqrt price for internal calculations. As a result, CL total liquidity can only be inferred from pool's bank balance.

Suggested Design

Therefore, it makes sense to move the query from PoolI interface to the PoolModuleI interface. That way, we will be able to implement the GetTotalPoolLiquidity in CL keeper by grabbing it from the pool's bank balance

Acceptance Criteria

  • move method from PoolI to PoolModuleI
  • refactor other modules to grab pool liquidity from pool manager by pool id
@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
@p0mvn p0mvn self-assigned this 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 moved this from Todo 🕒 to In Progress🏃 in Osmosis Chain Development Mar 30, 2023
@p0mvn p0mvn moved this from In Progress🏃 to Needs Triage 🔍 in Osmosis Chain Development Mar 31, 2023
@p0mvn p0mvn moved this from Needs Triage 🔍 to Needs PR Review in Osmosis Chain Development Mar 31, 2023
@github-project-automation github-project-automation bot moved this from Needs PR Review to Done ✅ in Osmosis Chain Development Mar 31, 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.

1 participant