[CL][Swap Router Module]: investigate reducing the need for making public swap API with swapFee as parameter #3130
Labels
C:x/concentrated-liquidity
C:x/gamm
Changes, features and bugs related to the gamm module.
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
In #3128 we refactored gamm to lift multihop logic up to swap-router. This has led to
exporting a
gamm
andconcentrated-liquidity
swap APIs that take swap fee as parameter.This poses a security risk since a developer might accidentally provide a fee that is lower than the actual pool fee.
Ultimately, the only reason for exposing swap fee in the API is so that we can reduce the fee for osmo routed mutlihop:
osmosis/x/swaprouter/router.go
Lines 27 to 29 in 1f9680c
Suggested Design
We should investigate potential approaches to mitigate this security vulnerability and come up with an abstraction that does not expose
swapFee
publicly.Acceptance Criteria
swapFee
inSwapExactAmountIn
globallyswapFee
inSwapExactAmountOut
globallyThe text was updated successfully, but these errors were encountered: