What is a DEX?
Understand how decentralized exchanges work and learn how to access them via your wallet
A decentralized exchange (or DEX) is a peer-to-peer marketplace where transactions occur directly between crypto traders. DEXs fulfill one of crypto’s core possibilities: fostering financial transactions that aren’t officiated by banks, brokers, or any other intermediary. Many popular DEXs, like Uniswap and Sushiwap, run on the Ethereum blockchain.
A decentralized exchange (better known as a DEX) is a peer-to-peer marketplace where transactions occur directly between crypto traders. DEXs fulfill one of crypto’s core possibilities: fostering financial transactions that aren’t officiated by banks, brokers, payment processors, or any other kind of intermediary. The most popular DEXs — like Uniswap and Sushiswap — utilize the Ethereum blockchain and are part of the growing suite of decentralized finance (DeFi) tools, which make a huge range of financial services available directly from a compatible crypto wallet. DEXs are booming — in the first quarter of 2021, $217 billion in transactions flowed through decentralized exchanges. As of April 2021, there were more than two million DeFi traders, a ten-fold increase from May 2020.
How do DEXs work?
Unlike centralized exchanges like Coinbase, DEXs don’t allow for exchanges between fiat and crypto — instead, they exclusively trade cryptocurrency tokens for other cryptocurrency tokens. Via a centralized exchange (or CEX), you can trade fiat for crypto (and vice versa) or crypto-crypto pairs — say some of your bitcoin for ETH. You can also often make more advanced moves, like margin trades or setting limit orders. But all of these transactions are handled by the exchange itself via an “order book” that establishes the price for a particular cryptocurrency based on current buy and sell orders — the same method used by stock exchanges like Nasdaq.
Decentralized exchanges, on the other hand, are simply a set of smart contracts. They establish the prices of various cryptocurrencies against each algorithmically and use “liquidity pools” — in which investors lock funds in exchange for interest-like rewards — to facilitate trades.
While transactions on a centralized exchange are recorded on that exchange’s internal database, DEX transactions are settled directly on the blockchain.
DEXs are usually built on open-source code, meaning that anyone interested can see exactly how they work. That also means that developers can adapt existing code to create new competing projects — which is how Uniswap’s code has been adapted by an entire host of DEXs with “swap” in their names like Sushiswap and Pancakeswap.
What are potential benefits of using a DEX?
Vast variety: If you’re interested in finding a hot token in its infancy, DeFi is the place to be. DEXs offer a virtually limitless range of tokens, from the well-known to the weird and totally random. That’s because anyone can mint an Ethereum-based token and create a liquidity pool for it, so you’ll find a greater array of projects, both vetted and unvetted. (Buyer definitely beware!)
Hacking risks can be reduced: Because all of the funds in a DEX trade are stored on the traders’ own wallets, they are theoretically less susceptible to a hack. (Relatedly, DEXs also reduce what is known as “counterparty risk,” which is the likelihood that one of the involved parties — including potentially the central authority in a non-DeFi transaction — will default.)
Anonymity: No personal information is required to use most popular DEXs.
Utility in the developing world: The peer-to-peer lending, speedy transactions, and anonymity made possible by DEXs have made them increasingly popular in developing economies — where solid banking infrastructure might not be available. Anyone with a smartphone and an internet connection can trade via a DEX.
What are some potential downsides?
Trickier user interfaces Navigating decentralized exchanges requires some specialized knowledge and the interfaces aren’t always easy — be prepared to do a lot of research and don’t expect the DEX itself to offer much handholding. You’ll generally have to look offsite for a walk-through or explainer. Caution is required because it’s possible to make an unfixable error, like sending coins to the wrong wallet. Another common issue is known as “impermanent loss,” which can result from pairing a more volatile cryptocurrency with a less volatile one in a liquidity pool. (The main takeaway here? Do your own research.)
Smart contract vulnerability Any DeFi protocol is only as secure as the smart contracts that power it — and code can have exploitable bugs (despite lengthy testing) that can result in the loss of your tokens. And while a smart contract might work as intended under normal circumstances, not all rare events, human factors, and hacks can be anticipated by developers.
Riskier coins With the unvetted, vast array of tokens available on most DEXs, there are also a greater number of scams and schemes to be wary of. A token that’s on a hot streak could suddenly be “rug pulled,” when its creator mints a bunch of new tokens, overwhelming the liquidity pool and tanking the value of the coin. Before you buy a new-to-you cryptocurrency or experiment with a new protocol it’s important to learn as much as you can — read white papers, visit developer Twitter feeds or Discord channels, and look for audits of any particular project you’re interested in (some bigger auditors include Certik, Consensys, Chain Security, and Trail of Bits).
How do you interact with a DEX?
You can connect to a DEX like Uniswap using a crypto wallet such as Metamask (for your web browser) or Coinbase Wallet (for mobile).
While you can interact with DEXs directly from the browser built into Coinbase Wallet, an easier way is to pull up the website up on your computer’s web browser (in the case of Uniswap, the address is app.uniswap.org) and click “Connect to a Wallet.”
A QR code should pop up, which you can scan with your phone’s camera (tap the upper-right corner of the Coinbase Wallet app to access the camera). Once scanned, your wallet will be connected to the DEX.
You’ll also need a supply of Ethereum to start trading on most DEXs, which you can get from an exchange like Coinbase. The reason you need some ETH is for paying fees (known as gas) that are required for any transaction that happens on the Ethereum blockchain. These are separate from the fees the DEX itself charges.
How do DEX fees work?
Fees vary. Uniswap charges a 0.3% fee that is split between liquidity providers, and a protocol fee could be added in the future. But it’s important to note that the fees the DEX charges can be dwarfed by gas fees to use the Ethereum network. The ongoing ETH2 upgrade (as well as a number of “layer 2” solutions like Optimism and Polygon) are designed in part to lower fees and speed up transactions.