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

Add built-in routing support #28

Open
polarker opened this issue Dec 21, 2023 · 0 comments
Open

Add built-in routing support #28

polarker opened this issue Dec 21, 2023 · 0 comments

Comments

@polarker
Copy link
Member

Due to input&output model, swap routing cannot be done in a single transaction with the current implementation.

However, it's possible to add this routing feature by implementing the protocol slightly differently. E.g. to swap via A -> B -> C:

  1. the DEX computes the amount change MB for B in (A, B) swap, the amount change MC for C in (B, C) swap.
  2. the DEX sends MA to (A, B) pool, moves MB from (A, B) pool to (B, C) pool, sends MC from (B, C) pool to the caller.
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

No branches or pull requests

1 participant