Improving the DEX Trading UX
Introduction
Cryptocurrency trading has been gaining popularity in recent years, and as a result, there is a growing demand for easy-to-use and intuitive trading interfaces. However, the on-chain trading and decentralized user experience has been lagging behind more traditional or centralized exchange interfaces (CEX).
We will explore the key features and functionalities required for creating a cryptocurrency trading user-friendly and effective interface that assists traders by informing, executing, maintaining and recording their trades. The features we describe not only apply to DEXes and perpetuals, but are equally important for option protocols, interest rate swaps, yield farms and money markets. The features would ideally be available on the platform itself natively or in the form of embeds of external tooling. If this results in cluttering the interface or is not a possibility, users would still benefit from advice from the project and quick links to external tooling.
Future Trade: Inform
The decision of going into a trade is the most crucial aspect of trading, and it is essential to have a streamlined and straightforward interface aid in the decision making. A trader has to make an informed decision about assets pricing. Price feeds and charts even in the most basic form are helpful for checking the current and past prices. Specifically for futures or options protocols the underlying oracles for tracking price can be different and can be noted, either in the interface or with a link to the documentation. For futures or options the time to expiry and time zone of expiry should be clearly displayed.
On top of the asset price the platform adds fees, premiums or funding for execution, which a trader should be made aware of to avoid any surprises. After all, this is the cost of trading and will reduce the potential profits. For options protocols specifically the currency of the payout should be clear, since settlement can differ per asset posted as collateral.
The interface should also provide text or visualizations that make it easy to understand the trade’s potential outcome. Potential profit and loss (PnL) or risk estimates help traders make informed decisions. If the platform is meant to hedge positions, calculators to define the amount needed to hedge remove mistakes that can happen when a user manually has to calculate these amounts.
For example the Lyra interface shows the size of the position (Contracts), which a trader can alter for the desired size. The price per option is the price paid for the contracts (can be seen as the premium). At the lower part an interactive chart is available to show the potential payoffs at different ETH strike prices. Although fairly simple, the interface informs the trader well. A potential next step for Lyra or other option protocols is to create a position builder, which helps traders build complex option positions. An example of such a builder is the Deribit Position Builder.
Current Trade: Execute
The trading interface should provide a position builder feature that allows traders to choose their price and their position size. Often executing against an AMM is direct and uses market orders, which results in setting the price automatically. Luckily recently more protocols have added features such as limit orders and stop losses to aid traders in executing at more favorable prices and practicing their risk management. Off-chain infrastructure might be needed to provide these features, as long as trade settlement is on-chain.
Cryptocurrency markets can be volatile and unpredictable, and sudden price fluctuations can cause significant losses for traders who are not vigilant. Setting alerts can help traders stay informed about price changes, position changes and potential risks, allowing them to make more informed trading decisions. Alerts could be set to notify traders through email, Telegram, Discord or their favorite notification app.
Open trade: Maintain
Once a trade has been executed, traders need to keep track of their position’s unrealized and realized PNL, open position size, entry date and time, entry price, collateral (health or ratio) and funding or premium paid to date. The trading interface should display this information in a clear and concise manner, making it easy for traders to monitor their trades and adjust their strategies if necessary.
In this example from GMX we see essential information like PnL and pricing, while sadly open date and funding paid to date is missing from the interface.
Past Trade: Record
By keeping a record of each individual trade, traders can analyze their performance, identify their strengths and weaknesses, track their progress over time and make necessary adjustments to their trading strategies. Moreover, accurate and detailed trade records can be useful for tax reporting purposes, regulatory compliance, and other legal requirements.
Luckily since trades are recorded on-chain, protocols can build an interface that shows the traders history. The more detailed the better but basic information helps: dates for opening and closing trades, PnL, entry and exit prices, fees paid etc. Basically the information displayed in the sections above.
Keep It Simple But Expandable
Simplicity is key when it comes to trading interfaces. While data can be detailed, it is important to display it in an easy-to-understand manner. The interface could have both simple and advanced views that traders can toggle between to suit their preferences.
A good example of an expandable interface is the IPOR interest rate swap interface. The Simple view caters the less experienced users but still gives the essential information. The Advanced view provides more detail and customization in execution.
APIs And Composability
While the focus on a visual interface is important, some users would like to work with more detailed or extensive data from the project. An API is crucial for traders who want to retrieve data and execute programmatically. In addition to a standard API, smart contracts and on-chain data can be directly queried to help the user in parsing this data. The programmers of the protocol know the data definitions and details best, which puts them into the position for preprocessing of the data to service users. Users might be interested in their trading history, historical price and trade data for backtesting and research or pulling real time time data for executing trades. The APIs or smart contracts should make it easier to grab data for the user. Although highly specific to the project and user base, these examples might provide some inspiration:
- Write essential data for composability from the app to the chain and make smart contracts easily accessible to other on-chain apps.
- Spin up outbound oracles to make parsed blockchain data specifically for your project available through an API.
- Provide real time pricing and volume data like Rhino.fi.
- Indexers like the Arkiver from Robolabs could be used to index live and historical data and provide a user with queries or data specifically for your project.
- Help with setting up alerts for your users based on blockchain events with Robolab’s DeNotify or Alchemy’s Notify Custom Webhooks.
- Submit your project’s contracts for decoding on Dune to make it easier for yourself and your community to query and create dashboards.
- Build on chains that have SDKs that allow for a direct API to the chain through the nodes like Injective or Hyperliquid.
Conclusion
Creating a crypto trading interface requires careful consideration of the key features and functionalities that traders need to make informed decisions. Informing the user, execution of a trade, maintaining current trades, recording past trades and API integration are all essential aspects of a successful trading interface. By incorporating these features, traders can have a seamless and effective trading experience, ultimately leading to better trading performance and more satisfaction of using your application.
Below you will find a checklist with the most important features per step.
Inform
- Price feeds and charts
- Oracles and source of price (Futures and Options)
- Time to expiry and time zone of expiry (Options)
- Fees, premium and funding information
- Position, hedge and/or PnL calculators
Execute
- Order Types: market, limit, stop loss, fill or kill, etc.
- Alerts
Maintain
- Open positions interface
- Trade position tracking with fitting metrics
Record
- Individual trades
- Aggregated metrics
- Trade record exports
API
- Real time data
- Historical data
- Execution endpoints
Navigating this space alone can be daunting, if you are looking for help building your DEX or advisory please reach out to us here at Deus Ex DAO and our advisors would be happy to help you with any product related questions.