You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The content you are editing has changed. Please copy your edits and refresh the page.
Proposal to mimics a conventional AMM:
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
The text was updated successfully, but these errors were encountered: