Dynamic confirm / preview screen where quotes are refreshed
- See uniswap for example https://app.uniswap.org/swap
- click review and wait a bit for it to refresh
- quotes update on expiry even within the preview screen
- @twblack88 / prodcut to take a first pass at this to make sure we dont want to modify the UI and how we can signal this to the user.
- must be snappy! uniswap example again
After some discussion with engineering there may be some confusion, but to be absolutely certain commenting here to clear it up.
Quotes / rates should never refresh after a user has clicked the "Confirm and Trade" button. There should be no "blind" updating of quotes, even if expired in the app. It is better to have a trade fail on chain than execute a swap during big market movements that ends up with unexpected pricing to the user.
Technical flow:
Input Stage (shows all available routes) [no wallet required]
- Polling rates for all routes with best effort network fee estimation
Preview Stage (polling route picked) - [currently confirm screen] [no wallet required]
- Still polling rate for single route with best effort network fee estimation
- User clicks continue button
- Button is Confirm if the wallet is connected -> go to Execution Screen
- Button is Connect Wallet if no wallet is connected -> Button is Confirm -> go to Execution Screen
Execution Stage
- If approval needed, rates continue to poll until approval is completed
- If no approval is needed or approval has been completed, quotes start polling with accurate network fee estimation keeping the quote "fresh"
- Sign and Broadcast Button (isLoading/Disabled while fetching new quote)
- On button click - quote and network fees are locked in and polling stops, ensuring what is displayed on screen is as close to final on chain intention as possible
@shapeshift/product is thinking this through a bit and @NeOMakinG brought up that the swapper page is a bit bare. We're proposing a Landing stage. Its basically the swapper with marketing stuff beneath it with some pre-configurations. A mock will explain this far better than words.
As starting thoughts for @reallybeard : a dumb route with a more Superficial page to show functionality. Shows swapper front and center cycling between predefined quotes/pairs before inputs. two ways to hit preview stage:
- cta to "swap/get started". As the routes cycle you could just pick get started and it passes those as params.
- Or, if a user inputs a quote then it ingests that quote params. Boom you're dropped into preview stage.
if this works we could also consider bringing that to the .com domain as an iframe but probably ahead of ourselves.
to fix your trouble check this solution click maybe this will solve your problem.
moving to product team for more fleshing out PROD-13
thanks to @premiumjibles & @reallybeard we have a sweet :chefskiss: quote loader. closing this bad boi