[CL][Swap Router Module]: Pool ID routing #3097
Labels
C:x/swap-router
F: concentrated-liquidity
Tracking the development of concentrated liquidity feature to improve filtering on the project board
T:task ⚙️
A task belongs to a story
Milestone
Background
The current design in the swap router has a boolean field in the keeper method for
RouteMultihopSwapExactAmountIn
andMultihopSwapExactAmountOut
, that takes in the fieldisGamm
as a boolean field, in which routes to the correct pool module: either the gamm module or the concentrated liquidity module.This implementation is a half implementation of the swap router module.
We want to route the swap messages to the correct module given pool ID.
Suggested Design
There are two ways of doing this depending on which
We are assuming two things in this case:
This case should be easy, we simply route the swap message to the correct pool type by referencing to the pool Id format.
If preconditions mentioned above are not fulfilled, we need to use interfaces to find out which pool model it is given pool id. We can achieve this by using interfaces: traditional amms and concentrated amms has different APIs and methods - we can abstract them as interfaces to see if each pool fulfills this and find out which pool model it is to route to the correct pool
GetPoolById
The last possible approach of doing this is using
GetPoolById
. We can try callingGetPoolById
method from each pool model module and use the pool returned, if error returned assume that it's the other module.Acceptance Criteria
The text was updated successfully, but these errors were encountered: