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
Copy file name to clipboardExpand all lines: public/content/developers/docs/design-and-ux/dex-design-best-practice/index.md
+23-19Lines changed: 23 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,20 @@
1
1
---
2
-
title: Decentralised Exchange (DEX) Design Best Practice
2
+
title: Decentralized exchange (DEX) design best practices
3
3
description: A guide explaining UX/UI decisions for swapping tokens.
4
4
lang: en
5
5
---
6
-
# Introduction to Decentralised Exchanges
7
6
8
-
Since the launch of Uniswap in 2018, there have been hundreds of Decentralised Exchanges launched across dozens of different chains.
7
+
# Introduction to decentralized exchanges {#introduction-to-decentralized-exchanges}
8
+
9
+
Since the launch of Uniswap in 2018, there have been hundreds of decentralized exchanges launched across dozens of different chains.
9
10
Many of these have introduced new elements or added their own twist, but the interface has remained generally the same.
10
11
11
12
One reason for this is [Jakob’s Law](https://lawsofux.com/jakobs-law/):
12
13
13
14
> Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know.
14
15
15
16
Thanks to early innovators like Uniswap, Pancakeswap, and Sushiswap, DeFi users have a collective idea of what a DEX looks like.
16
-
For this reason, something like “best practice” is now emerging. We see more and more design decisions being standardised across sites. You can see the evolution of DEXes as a giant example of testing it live. Things that worked stayed, things that didn’t, got tossed out. There’s still room for personality, but there are certain standards a DEX should conform to.
17
+
For this reason, something like “best practice” is now emerging. We see more and more design decisions being standardized across sites. You can see the evolution of DEXes as a giant example of testing it live. Things that worked stayed, things that didn’t, got tossed out. There’s still room for personality, but there are certain standards a DEX should conform to.
17
18
18
19
This article is a summary of:
19
20
- what to include
@@ -24,7 +25,7 @@ All of the example wireframes were made specifically for this article, although
24
25
25
26
The Figma kit is also included at the bottom - feel free to use it and speed up your own wireframes!
26
27
27
-
## Basic Anatomy of a DEX
28
+
## Basic anatomy of a DEX {#basic-anatomy-of-a-dex}
28
29
29
30
The UI generally contains three elements:
30
31
1. Main form
@@ -34,25 +35,25 @@ The UI generally contains three elements:
34
35

35
36
36
37
37
-
## Variations
38
+
## Variations {#variations}
38
39
39
-
This will be a common theme in this article, but there are various different ways these elements can be organised. The “details panel” can be:
40
+
This will be a common theme in this article, but there are various different ways these elements can be organized. The “details panel” can be:
40
41
- Above the button
41
42
- Below the button
42
43
- Hidden in an accordion panel
43
44
- And/or on a “preview” modal
44
45
45
46
N.B. A “preview” modal is optional, but if you are showing very few details on the main UI, it becomes essential.
46
47
47
-
## Structure of the Main Form
48
+
## Structure of the main form {#structure-of-the-main-form}
48
49
49
50
This is the box where you actually choose which token you want to swap. The component consists of an input field and a small button in a row.
50
51
51
52
DEXes typically display additional details in one row above and one row below, although this can be configured differently.
52
53
53
54

54
55
55
-
## Variations
56
+
## Variations {#variations2}
56
57
57
58
Two UI variations are shown here; one without any borders, creating a very open design, and one where the input row has a border, creating a focus on that element.
58
59
@@ -62,7 +63,7 @@ This basic structure allows **four key pieces of info** to be shown in the desig
62
63
63
64
During the evolution of DeFi, lots of different things have been included here.
64
65
65
-
## Key Info to Include
66
+
## Key info to include {#key-info-to-include}
66
67
67
68
- Balance in wallet
68
69
- Max button
@@ -81,7 +82,7 @@ Extra details can be shown below the main form. As this type of info is mostly f
81
82
82
83

83
84
84
-
## Extra Info to Include
85
+
## Extra info to include {#extra-info-to-include}
85
86
86
87
- Token price
87
88
- Slippage
@@ -117,7 +118,8 @@ Entering numbers in Main Form → Scanning Details → Clicking to Preview Scree
117
118
Should the details panel be visible at all times, or does the user need to click it to expand?
118
119
Should you create friction by adding a preview screen? This forces the user to slow down and consider their trade, which can be useful. But do they want to see all the same info again? What is most useful to them at this point?
119
120
120
-
## Design Options
121
+
## Design options {#design-options}
122
+
121
123
As mentioned, a lot of this comes down to your personal style
122
124
Who is your user?
123
125
What is your brand?
@@ -126,13 +128,15 @@ Even if you’re aiming for the pro users who want all info possible, you should
126
128
127
129
> No matter how beautiful, no matter how cool your interface, it would be better if there were less of it.
128
130
129
-
### Structure
131
+
### Structure {#structure}
132
+
130
133
- tokens on the left, or tokens on the right
131
134
- 2 rows or 3
132
135
- details above or below the button
133
136
- details expanded, minimized, or not shown
134
137
135
-
### Component Style
138
+
### Component style {#component-style}
139
+
136
140
- empty
137
141
- outlined
138
142
- filled
@@ -157,7 +161,7 @@ Take a look at the below examples to see different ways you can put it all toget
157
161
158
162

159
163
160
-
## But which side should the token go on?
164
+
## But which side should the token go on? {#but-which-side-should-the-token-go-on}
161
165
162
166
The bottom line is that it probably doesn’t make a huge difference to usability. There are a few things to bear in mind, however, which might sway you one way or the other.
163
167
@@ -175,15 +179,15 @@ The law of proximity states that items that are close together are perceived as
175
179
176
180
Ultimately, there are pluses and minuses for both options, but it is interesting how the trend appears to be towards token on the right.
177
181
178
-
# Button Behaviour
182
+
# Button behavior {#button-behavior}
179
183
180
184
Don’t have a separate button for Approve. Also don’t have a separate click for Approve. The user wants to Swap, so just say “swap” on the button and initiate the approval as the first step. A modal can show progress with a stepper, or a simple “tx 1 of 2 - approving” notification.
181
185
182
186

183
187
184
188

185
189
186
-
## Button as contextual help
190
+
## Button as contextual help {#button-as-contextual-help}
187
191
188
192
The button can do double duty as an alert!
189
193
@@ -197,11 +201,11 @@ If the main action - SWAP - is unavailable due to an error, the reason why can b
197
201
198
202
The button can also be **mapped to the action** that needs to be performed. For example, if the user cannot swap because they are on the wrong network, the button should say “switch to Ethereum”, and when the user clicks on the button, it should switch the network to Ethereum. This speeds up the user flow significantly.
199
203
200
-

204
+

201
205
202
206

203
207
204
-
## Build Your Own with this Figma File
208
+
## Build your own with this figma file {#build-your-own-with-this-figma-file}
205
209
206
210
Thanks to the hard work of multiple protocols, DEX design has improved a lot. We know what info the user needs, how we should show it, and how to make the flow as smooth as possible.
207
211
Hopefully this article provides a solid overview of the UX principles.
Copy file name to clipboardExpand all lines: public/content/developers/docs/design-and-ux/heuristics-for-web3/index.md
+18-20Lines changed: 18 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ description: Principles to improve the usability of Web3
4
4
lang: en
5
5
---
6
6
7
-
# Heuristics for Web3
7
+
# Heuristics for Web3 {#heuristics-for-web3}
8
8
9
9
Usability heuristics are broad “rules of thumb” that you can use to measure the usability of your site.
10
10
These heuristics are specifically tailored for Web3 and should be used alongside Jakob Nielsen's [10 general principles for interaction design](https://www.nngroup.com/articles/ten-usability-heuristics/).
11
11
12
-
## Seven Usability Heuristics for Web3
12
+
## Seven usability heuristics for web3 {#seven-usability-heuristics-for-web3}
13
13
14
14
1. Feedback follows action
15
15
2. Security and trust
@@ -20,9 +20,9 @@ These heuristics are specifically tailored for Web3 and should be used alongside
20
20
7. Control from the app, not the wallet
21
21
22
22
23
-
## Definitions and Examples
23
+
## Definitions and examples {#definitions-and-examples}
**It should be obvious when something has happened, or is happening.**
28
28
@@ -39,10 +39,10 @@ Showing each step involved in a transaction helps users know where they are in t
39
39
40
40

41
41
42
-
### 2. Security and Trust are Baked in
42
+
### 2. Security and trust are baked in {#security-and-trust-are-backed-in}
43
43
44
-
Security should be prioritised, and this should be emphasised for the user.
45
-
People care deeply about their data. Safety is often a primary concern for users, so it should be considered at all levels of the design. You should always be seeking to earn the trust of your users, but the way you do this can mean different things on different apps. It should not be an afterthought, but should be designed consciously throughout. Build trust throughout the user experience, including social channels and documentation, as well as the final UI. Things like the level of decentralisation, the treasury multi-sig status, and whether the team is doxxed, all affect users' trust
44
+
Security should be prioritized, and this should be emphasized for the user.
45
+
People care deeply about their data. Safety is often a primary concern for users, so it should be considered at all levels of the design. You should always be seeking to earn the trust of your users, but the way you do this can mean different things on different apps. It should not be an afterthought, but should be designed consciously throughout. Build trust throughout the user experience, including social channels and documentation, as well as the final UI. Things like the level of decentralization, the treasury multi-sig status, and whether the team is doxxed, all affect users' trust
46
46
47
47
**Tips:**
48
48
- List your audits proudly
@@ -57,24 +57,24 @@ Include your audits in the footer, at a prominent size.
57
57
58
58

59
59
60
-
### 3. The Most Important Info is Obvious
60
+
### 3. The most important info is obvious {#the-most-important-info-is-obvious}
61
61
62
-
For complex systems, show only the most relevant data. Determine what is most important, and prioritise its display.
62
+
For complex systems, show only the most relevant data. Determine what is most important, and prioritize its display.
63
63
Too much information is overwhelming and users typically anchor on one piece of information when making decisions. In DeFi, this will probably be APR on yield apps and LTV on lending apps.
64
64
65
65
**Tips:**
66
66
- User research will uncover the most important metric
67
67
- Make the key info big, and the other details small and unobtrusive
68
68
- People don’t read, they scan; ensure your design is scannable
69
69
70
-
**Example:** Large tokens in full colour are easy to find when scanning. The APR is big and highlighted in an accent colour.
70
+
**Example:** Large tokens in full color are easy to find when scanning. The APR is big and highlighted in an accent color.
71
71
72
72

73
73
74
-
### 4. Clear Terminology
74
+
### 4. Clear terminology {#clear-terminology}
75
75
76
76
Terminology should be understandable and appropriate.
77
-
Technical jargon can be a huge blocker, because it requires the construction of a completely new mental model. Users are unable to relate the design to words, phrases and concepts they already know. Everything seems confusing and unfamiliar, and there is a steep learning curve before they can even attempt to use it. A users might approach DeFi wanting to save some money, and what they find is: Mining, farming, staking, emissions, bribes, vaults, lockers, veTokens, vesting, epochs, decentralised algorithms, protocol-owned liquidity…
77
+
Technical jargon can be a huge blocker, because it requires the construction of a completely new mental model. Users are unable to relate the design to words, phrases and concepts they already know. Everything seems confusing and unfamiliar, and there is a steep learning curve before they can even attempt to use it. A users might approach DeFi wanting to save some money, and what they find is: Mining, farming, staking, emissions, bribes, vaults, lockers, veTokens, vesting, epochs, decentralized algorithms, protocol-owned liquidity…
78
78
Try to use simple terms that will be understood by the broadest group of people. Do not invent brand new terms just for your project.
79
79
80
80
**Tips:**
@@ -89,22 +89,20 @@ Try to use simple terms that will be understood by the broadest group of people.
89
89
90
90

91
91
92
-
### 5. Actions are as Short as Possible
92
+
### 5. Actions are as short as possible {#actions-are-as-short-as-possible}
93
93
94
94
Speed up the user’s interactions by grouping sub actions.
95
95
This may be done on the smart contract level, as well as the UI. The user should not have to move from one part of the system to another – or leave the system entirely – to complete a common action.
96
96
97
97
**Tips:**
98
-
- Incorporate zappers for adding liquidity
99
-
- Combine “Approve” with the “Deposit” action
100
-
- Combine “Deposit” and “Stake” actions
101
-
- Allow the user to close a loan position and withdraw collateral entirely
98
+
- Combine "Approve" with other actions where possible
99
+
- Bundle signing steps as close together as possible
102
100
103
101
**Example:** Combining “add liquidity” and “stake” is a simple example of an accelerator that saves a user both time and gas.
104
102
105
103

106
104
107
-
### 6. Network Connections are Visible and Flexible
105
+
### 6. Network connections are visible and flexible {#network-connections-are-visible-and-flexible}
108
106
109
107
Inform the user about what network they are connected to, and provide clear shortcuts to change network.
110
108
This is especially important on multichain apps. The main functions of the app should still be visible while disconnected or connected to a non-supported network.
@@ -120,7 +118,7 @@ This is especially important on multichain apps. The main functions of the app s
120
118
121
119

122
120
123
-
### 7. Control from the App, not the Wallet
121
+
### 7. Control from the app, not the wallet {#control-from-the-app-not-the-wallet}
124
122
125
123
The UI should tell the user everything they need to know and give them control over everything they need to do.
126
124
In Web3, there are actions you take in the UI, and actions you take in the wallet. Generally, you initiate an action in the UI, and then confirm it in the wallet. Users can feel uncomfortable if these two strands are not integrated carefully.
@@ -133,4 +131,4 @@ In Web3, there are actions you take in the UI, and actions you take in the walle
133
131
134
132
**Example:** A subtle container shows the user what relevant tokens they have in their wallet, and the main CTA provides a shortcut to change the network.
135
133
136
-

134
+

0 commit comments