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

[CL][Liquidity Provision]: investigate implementation of join pool / exit pool methods with hardcoded values #3034

Closed
Tracked by #3028
p0mvn opened this issue Oct 17, 2022 · 3 comments
Assignees
Labels
C:x/gamm Changes, features and bugs related to the gamm module. F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board

Comments

@p0mvn
Copy link
Member

p0mvn commented Oct 17, 2022

Background

For Milestone 1, out goal is to be able to provide liquidity with pre-computed hard-coded values.

This task is focused on analyzing, prototyping and documenting our existing pool interface methods defined on the concentrated liquidity pool

Suggested Design

We need to have a direction for the following methods:

  • JoinPoolNoSwap / CalcJoinPoolSharesNoSwap
  • ExitPool / CalcExitPoolShares

Additionally, it seems that JoinPool is not valid for concentrated liquidity pools because we must always be adding liquidity proportional to the existing pool reserves.

Recall that the proportion of current pool reserves tells the current spot price. Assume we added 1 ETH and 5000 USDC. So if we want to put more tokens into the pool and keep the same price, the amounts must be proportional, e.g.: 2 ETH and 10,000 USDC; 10 ETH and 50,000 USDC, etc.

Therefore we need to determine how we are going to go about JoinPool / CalcJoinPoolShares methods. Options are:

  • Disable it by always erroring or panicking
  • Move it into an extension interface
  • Modifying the spec to be compatible with the new abstraction and verifying that balancer and stableswap implementation are still aligned with the spec

Acceptance Criteria

  • Summary of the subsequent steps for each of the above methods / potentially a prototype
  • Summary of constraints that we need to tackle (e.g. logarithm implementation)
  • New issues with the next steps created
@p0mvn p0mvn added the C:x/gamm Changes, features and bugs related to the gamm module. label Oct 17, 2022
@osmo-bot osmo-bot moved this to Needs Review 🔍 in Osmosis Chain Development Oct 17, 2022
@mattverse
Copy link
Member

mattverse commented Oct 19, 2022

This is to be completed in milestone2, given that the current structure of pool-models is not suitable for storing additional states

@p0mvn p0mvn added the F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board label Oct 19, 2022
@p0mvn
Copy link
Member Author

p0mvn commented Oct 19, 2022

Agreed, moving to milestone 2. This is blocked by #3045 and #3044

@p0mvn
Copy link
Member Author

p0mvn commented Oct 19, 2022

The direction is clear now.

We will utilize the store logic from here: https://github.com/osmosis-labs/osmosis/blob/concentrated-liquidity/proto/osmosis/concentrated-liquidity/concentratedPool.proto

JoinPool logic is implemented on the keeper, swaps are routed directly into the concentrated liquidity pool defined here: #3047

@p0mvn p0mvn closed this as completed Oct 19, 2022
Repository owner moved this from Needs Review 🔍 to Done ✅ in Osmosis Chain Development Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/gamm Changes, features and bugs related to the gamm module. F: concentrated-liquidity Tracking the development of concentrated liquidity feature to improve filtering on the project board
Projects
Archived in project
Development

No branches or pull requests

2 participants