CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

Simplify Uniswap V3 strategy #125

Closed fengtality closed 2 years ago

fengtality commented 2 years ago

Why

The current Uniswap V3 connector is too complicated. Since we are trying to create a strategy for Uniswap LPs, the first version of the connector and strategy should be as simple as possible.

What

  1. Remove or comment out every function and service not related to creating a position. The only remaining routes should be:

    /position: get information about an existing position
    /add-position: create a position
    /remove-position: remove position
  2. Merge in the changes to mf-uniswap branch for gas, token list, etc so that both Uniswap V2 and V3 connectors have the same architecture

fengtality commented 2 years ago

From testing, it appears that remaining issues may be in the strategy and client connector, rather in Gateway. I will run this branch in conjunction with development on the Hummingbot to identify them. The goal here is to allow users to create a simple DAI-WETH position and allow the strategy to automate how it rebalances.

fengtality commented 2 years ago

As discussed with @vic-en and @phbrgnomo today, we will try to simplify this strategy for the v0.43 release, since what's on master isn't working well.

The simplified strategy will:

  1. Create a single position at start
  2. If the price moves outside range, add a new position just on that side
  3. Don't remove any positions or do any swaps

The goal is to have a "minimum viable" Uniswap-V3 strategy that the community that test out and give feedback.