You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently with SwapExactAmountIn the gas goes over 50M with ~1K liquidity in a pool with over 100 positions initialized. The reason why the cost is so high is becasue we are crossing a lot of ticks. We can have more liquidity in ticks so that we dont cross tick with smaller swaps as well as figure out a way to optimize out swap functions to be more gas efficient
The first thing that comes to mind for me, is measuring gas cost for just getting a pool from state with all the spread accums / uptime accums in it.
Theres one trivial extra GetPool call we can eliminate from all swaps by making compute swap methods take in a pool instead of poolID
EDIT: I think its maybe two GetPools eliminatable, including the one in updatePoolForSwap? This one not as clear
Similarly we can use the multi-send api's from bank to optimize the final fund transfers
Acceptance Criteria
Swap functions should cost a lot less gas (numbers tbd)
The text was updated successfully, but these errors were encountered:
Background
Currently with
SwapExactAmountIn
the gas goes over 50M with ~1K liquidity in a pool with over 100 positions initialized. The reason why the cost is so high is becasue we are crossing a lot of ticks. We can have more liquidity in ticks so that we dont cross tick with smaller swaps as well as figure out a way to optimize out swap functions to be more gas efficientSuggested Design
@ValarDragon suggestion;
The first thing that comes to mind for me, is measuring gas cost for just getting a pool from state with all the spread accums / uptime accums in it.
Theres one trivial extra GetPool call we can eliminate from all swaps by making compute swap methods take in a pool instead of poolID
EDIT: I think its maybe two GetPools eliminatable, including the one in updatePoolForSwap? This one not as clear
Similarly we can use the multi-send api's from bank to optimize the final fund transfers
Acceptance Criteria
The text was updated successfully, but these errors were encountered: