What Is a DEX? Decentralized Exchanges, Explained
A decentralized exchange, or DEX, is exactly what it sounds like– a cryptocurrency exchange that is completely decentralized. Here are three reasons DEXes are worth paying attention to:
- Decentralized exchanges are peer-to-peer hubs where users can directly trade crypto without intermediaries like centralized exchanges or other financial gatekeepers.
- It’s a booming sector– The top 10 centralized exchanges have nearly $9 billion in Total Value Locked, with leader Uniswap facilitating between $1.5 to $3.5 billion per day.
- DEXs are a living, breathing example of smart contracts and liquidity pools at work. The technology is fascinating– DEX smart contracts set prices algorithmically; users can deposit funds and earn rewards in liquidity pools, which makes trading possible.
DEXes offer significant advantages over their centralized counterparts, including wider varieties of tokens and trading pairs, the mandatory use of non-custodial wallets, utility in places with poor banking infrastructure, and anonymity– perhaps their most controversial feature.
Decentralized exchanges also come with a basket of drawbacks and risks, including smart contract vulnerabilities, a higher risk of scams due to the wider availability of unvetted tokens, and sometimes even extremely high costs linked to high gas fees, such as those seen on the Ethereum network.
The following DEX guide explores everything you should know about decentralized exchanges.
Custodial vs. Non-Custodial, Centralized vs. Decentralized
In order to understand DEXs, it’s important to realize that cryptocurrency exchanges exist on two basic axes: custody and centralization.
Custody refers to who holds the keys to accounts on the exchange. When you buy a Bitcoin on Coinbase, for example, it shows up in your Coinbase account, but you don’t actually own and control that Bitcoin yet. You need to request a transfer off Coinbase to an external wallet address that you control before the Bitcoin is really yours. If Coinbase is attacked, slowed down, or has technical issues, you don’t have recourse to secure your Bitcoin. This has been a problem so often with many exchanges that “funds are safe” has become a meme in the community as exchange operators attempt to reassure users in the wake of system problems.
A non-custodial exchange leaves all funds in the private wallets of its users. Users can then submit and confirm trades on their own from their personal wallets, essentially using the exchange as a matching service. An in-between solution involves users submitting funds to open-source, verified smart contracts that execute when a match is made and can be canceled at any time. This has the advantage of security and automation, but there is a period of time when funds aren’t in users’ wallets. If there’s an issue with the contract, the funds could disappear.
Centralization refers to where the order matching, routing, and execution take place. In a centralized exchange, there’s a proprietary order book that reviews all incoming orders and creates matches between users. The exchange software and servers then execute the transaction.
Decentralized exchanges operate on a network of computers. Some function directly on-chain through the use of smart contracts. Others rely on second-layer networks of trusted nodes, known as relayers, to find and make order matches.
Decentralized exchanges typically trade at about 10% to 20% of centralized exchange volume, up from the meager 1% in 2018, when we first wrote this article. Still, the vast majority of crypto trading happens through centralized institutions. To some, this is an enormous shortcoming of the cryptocurrency space, building a decentralized future atop centralized exchange providers.
For others, it seems obvious that an exchange should be centralized. In fact, many have argued that “decentralized exchange” is an oxymoron. After all, an exchange is a gathering point where people congregate to trade. Of course, it should be a single entity to quickly facilitate transactions.
As with most debates, both sides have merit in their arguments. The challenges of building a great non-custodial DEX are highly nuanced, but the benefits are also difficult to deny.
A Deeper Look at the Decentralized Exchange Benefits
Trading on a DEX comes with many benefits that make it attractive to cryptocurrency users. Most importantly, DEXs disintermediate the exchange ecosystem, removing middlemen and allowing free, direct trade between parties. This fits with the decentralizing philosophy and mission of crypto generally. That alone makes DEXs a rallying cry for the decentralization-at-any-cost, libertarian diehards, of which the crypto community has a fair few.
But there are other benefits to DEXs that the average user might also find attractive.
1. Decentralized Exchange Anonymity Trading
Since DEXs in their purest form use only blockchain information, all you need to share in order to use a DEX is a public address. Most centralized exchanges require a complete signup process with name, email, and even bank account information. Even anonymous crypto-to-crypto exchanges still require location information and other personal details to comply with government regulations and restrictions.
That said, if DEXs come to greater prominence, they’ll likely meet up against regulators. Most DEX creators plan to say they’re only releasing open source software and are not liable for what the community does with that software, thus avoiding the KYC and AML issues. However, it remains to be seen if that argument holds up legally long-term, especially if damages result from a poorly written smart contract or security flaw.
2. DEX Control of Funds
DEXs are generally, but not necessarily, non-custodial. As a result, users keep control of their funds throughout the entire transfer process until the moment of exchange, when a smart contract executes the signed trade. No more “funds are safu” messages. Keeping your funds safe is your own responsibility of a DEX.
3. Hacks: DEX vs CEX
Since a DEX exists across a network of computers, it becomes much more complicated to attack. There’s no single point of entry or failure. This makes DEXs exponentially more secure on this front.
However, DEXes can still be hacked and funds can be put in danger through smart contract bugs and other exploits.
Because there’s no single point of failure in a distributed exchange, there’s less chance of DEX going down. Rollouts of updates happen on a node-by-node basis. Even if individual nodes have to go down due to maintenance or an attack, the remaining nodes can still operate the exchange network.
Drawbacks of DEXs
DEXs are inherently more complicated than their centralized counterparts. This leads to challenges in implementation and usability that major DEXs have yet to fully address.
The first and biggest challenge is user-friendliness. Creating an account on a major centralized exchange is a fairly straightforward process, and it functions much like banking and brokerage applications that users are familiar with. On the other hand, using a DEX requires connecting to a DApp or even installing a standalone DEX client.
At its simplest, you may only need to set up a MetaMask wallet, fund that wallet, then connect with an Ethereum-based DEX DApp. At its most complicated, you might have to set up an independent node and stay online for long periods of time to sign transactions.
2. Simplified Trading Tools
Centralized exchanges offer advanced tools like options and margin trading. These simply aren’t possible for today’s DEXs. Trading on a DEX typically includes buy or sell orders only.
3. Low Liquidity
DEXs represent about one percent of the cryptocurrency market’s trading volume. As a result, only low volume trading of popular coins is possible. There’s not enough liquidity to allow for high-volume trading, and there are no centralized institutions providing market-maker services.
When you make a trade on an exchange, you want as close to instant execution as possible. Otherwise, you could miss out on a price change. Unfortunately, DEXs so far have shown slow cancelation and slow order processing times, since all requests have to propagate across the decentralized network. As a result, price slipping–price changes between order time and execution time–is common.
Because you must broadcast your intentions to the entire network in order to execute a trade, it’s possible for bad actors on the network with fast connections to jump ahead of you in line and buy up coins at a lower price in order to sell them back to you. Known as front-running, this practice undermines the fairness of the exchange. There’s no real way to make sure miners or relayers on a decentralized exchange can’t jump in line for orders. Currently, DEX creators are working on potential solutions that involve signatures or collateral, but no concrete solution exists thus far.
6. Real Decentralization?
Some DEXs still require you to hand over custody of your coins. Others involve small, centralized node networks of relayers. Still, others run an off-chain order book that must be maintained somehow by third-party entities. These caveats all subvert the exchanges’ claims of decentralization.
Top DEX Projects
Ethereum-based DEXes like UniSwap lead the pack, but several Ethereum-based Layer-2 DEXes have emerged with lower network fees, as well as Layer-1 competitors like Solana.
Final Thoughts: What’s the Future of Decentralized Exchanges
Decentralized exchanges are well-positioned for popularity and growth in the near future due to a few factors:
- 2022 saw several custody-based companies like FTX, Celsius, and Voyager go bankrupt, locking up billions of user funds in the process. Not a good look for custody-based services.
- The SEC has been gunning after centralized exchanges in 2023: it charged popular exchange Bittrex with operating as an unregistered national securities exchange, broker, and clearing agent, with the exchange filing bankruptcy in May. It has also been going after Kraken and Binance with similar claims.
- DEX trial and error continues to gather favorable data.