CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

Upgrade Balancer gateway to use SOR V2 #11

Closed fengtality closed 2 years ago

fengtality commented 3 years ago

Balancer has released a new version of their protocol that subsumes the old version. More details: https://docs.balancer.fi/getting-started/faqs/v2-in-a-nutshell

Update balancer service and routes to use SOR V2: https://docs.balancer.fi/developers/smart-order-router.

Don't add any new endpoints yet - we may do that in Gateway V2, but the goal with this task is to ensure that the existing Balancer endpoints are updated to use the Balancer V2 SDK and new addresses.

If there are any issues, you can ask the Balancer team in the "Hummingbot <> Balancer" Telegram group.

fengtality commented 3 years ago

Docs: https://docs.balancer.finance/api/migration-to-version-0.4.

Examples: https://docs.balancer.finance/smart-contracts/sor/development

dennisocana commented 3 years ago

We will move this to backlog for now. We are planning to work on this during sprint 2 of version 0.41 release to prioritize the 2nd iteration of Uniswap v3 strategy.

vic-en commented 3 years ago

To upgrade to Balancer SOR v2, here are some info I've found out:

dennisocana commented 3 years ago

As discussed during yesterday's standup, since this is a larger story we should break it down into smaller task for each step that needs to be done. Paulo will work with Victor to further refine this story.

vic-en commented 3 years ago

To-do:

  1. Update balancer endpoint functions to use SOR V2 (https://github.com/balancer-labs/balancer-sor/tree/develop-V2)
fengtality commented 3 years ago

I read through the Balancer SOR V2 docs and believe that the upgrade process should be relatively straightforward. There may be some changes needed to the service/routes, but basic structure is the same.

SOR: https://docs.balancer.fi/developers/smart-order-router Subgraph: https://docs.balancer.fi/developers/subgraph

Note that Balancer is in process of updating the V2 SOR, so we should keep them updated in the shared TG group on our progress and get feedback on our approach.