Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tri hops with mid pool #411

Merged
merged 6 commits into from
Aug 9, 2023
Merged

Tri hops with mid pool #411

merged 6 commits into from
Aug 9, 2023

Conversation

johngrantuk
Copy link
Member

  • Adds 3 hop path creation through mid pools added to config under triPathMidPoolIds
  • Add Base config for examples with triPathMidPoolIds staBal pool added

Path creation:
For each midpool construct construct 3 hop paths like: tokenIn[poolA]tokenA[MidPool]tokenB[poolB]tokenOut.

  • tokenA/B are midpool pool tokens
  • poolA/B are most liquid pools connecting tokenIn/Out to tokenA/B
  • We only want to use a pool as middle hop if tokenIn/Out aren't it's pool tokens as normal algo should take care of that path.

To test:
On production UI, Base network, try a swap between DAI>BALD - currently it doesn't find a liquid path as we need to do a 3 hop non-boosted path.
Run SOR swapExample (need to add RPC_URL_BASE=https://mainnet.base.org to .env) - it should find a valid path.

Copy link
Member

@brunoguerios brunoguerios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Solution seems pretty straightforward and example works as expected on my end. ✅

@johngrantuk johngrantuk merged commit 0f8a503 into develop Aug 9, 2023
3 checks passed
@johngrantuk johngrantuk deleted the tri-hops-with-mid-pool branch August 9, 2023 13:41
@johngrantuk johngrantuk mentioned this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants