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

[TAS-174] Implement swap routes #24

Closed
9 tasks done
toniocodo opened this issue Aug 30, 2023 · 0 comments
Closed
9 tasks done

[TAS-174] Implement swap routes #24

toniocodo opened this issue Aug 30, 2023 · 0 comments
Assignees

Comments

@toniocodo
Copy link
Collaborator

toniocodo commented Aug 30, 2023

Proposal to mimics a conventional AMM:

  • we stick to the idea of tokenIn and tokenOut, the ‘You pay’ ⇒ ‘You receive’ model of uniswap. For this example I’ll take the default route: tokenIn: ETH ⇒ tokenOut: OETH
  • when you click on a token select (i.e. tokenOut token), it opens the modal. The modals always shows all tokens available for the source (i.e. [OETH, ETH, MIX_TOKEN, WETH, stETH, rETH, frxETH, WOETH])
  • the list displays the tokens using 3 different states:
    • disabled: the currently selected token (i.e. OETH) is not clickable because it’s already selected (duh)
    • available: the tokens that are available for the other token selected (i.e. empty list in this case, only available route with tokenIn: ETH is to tokenOut: OETH). When the list is empty, it means the route is not supported. If an amount was already there, it’s not reset because the route is supported and we can trigger estimation.
    • greyed out: these are the other tokenOut that don’t have available routes with the tokenIn (i.e. [ETH, MIX_TOKEN, WETH, stETH, rETH, frxETH, WOETH]). Clicking on one of those will update the opposite field and set the amounts to zero. We can either set the opposite token to be the first available one or to null

That allows us to avoid inconsistencies in the form and always have it settled on a route that exists. I’ll implement it to verify that it behaves properly.

Tasks

@toniocodo toniocodo self-assigned this Aug 30, 2023
@smitch88 smitch88 linked a pull request Sep 1, 2023 that will close this issue
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 a pull request may close this issue.

1 participant