When it comes to buying and selling digital currencies, which is better? A centralized exchange (CEX)? Or a decentralized exchange (DEX)? Frame the question this way, and it's tricky to answer. But there is a correct answer, and it's going to annoy the crap out of you:
It depends.
Yeah, yeah. You're rolling your eyes. I get it. But hear me out because this isn't a copout. There really are tradeoffs with cryptocurrency exchanges. It even depends on the type of exchange. If you're a crypto maximalist, then you might think that decentralization is the panacea for all ailments. You might even start to gag when someone whispers the words "centralized exchange" in your ear.
But let's not be quick to rush to judgment here. Instead, let's put on our little analytical caps and reading glasses, and take a closer look, shall we?
CEX vs DEX: How do they Work?
© Vadim Artyukhin | Flickr
CEXs operate like traditional stock markets based on an order book. Think of them like an open market with a central authority matching buyers and sellers. On a CEX, it’s standard for all users to be able to see the full order book (i.e., all the buy and sell orders occurring on the exchange). These two features facilitate what is known as “price discovery”, where any user can identify the “last done price” or “market price”, as well as the depth of the order book. In exchange for facilitating the marketplace, the exchange takes a small cut from every trade.
Centralized crypto exchanges such as Binance and Coinbase use an order book as well, and retain many of the features offered by traditional CEXs.
So how does a DEX differ from a CEX? Well, since it doesn't have a central authority to keep track of an order book and match orders, DEXs had to devise a different approach to facilitate price discovery. A novel and innovative mechanism widely known today as the automated market maker (AMM) model made this possible. Uniswap was the first DEX to use the AMM model.
AMM DEXs can function thanks to an underlying liquidity pool that’s made available for each trading pair. For example, an ETH–USDC trading pair on a DEX would have an underlying liquidity pool with both ETH and USDC tokens in it. The total amount of tokens within the liquidity pool represents, as the name suggests, the total amount of liquidity for the trading pair, similar to how you would consider the depth of the order book on a CEX.
But how are the prices determined? Well, it’s pretty simple, actually. The current market price of a trading pair is the ratio between the amount of tokens in its liquidity pool. For example, if the current market price for ETH is $3,000, then within the ETH–USDC liquidity pool, the current ETH:USDC ratio must be 1:3000 (i..e., for every 1 ETH, there must be 3,000 USDC in the pool.)
What are the Differences between a CEX and a DEX?
We’ve got a lot of ground to cover, since the differences between CEXs and DEXs are numerous. But here we’ll stick to the main ones, starting with the core differences below.
1. Core Exchange Features
As you can imagine, CEXs have a long history, one that boasts many innovative features over the years. For example, they offer a range of order types to cater to the different types of traders, from the most basic market and limit orders to the more complex variety such as the iceberg order.
A good CEX also has the ability to provide deep liquidity by collaborating with market makers, and are typically built to support very high throughput (i.e., transactions per second).
In contrast, AMM DEXs are currently only able to support swaps that are instant... for now. However, newer DEXs such as Serum and IDEX are starting to incorporate order books, so that they can provide the best financial products from both worlds.
2. Trading Volume
Trading volume is a critical measure of financial activity on a platform. Not to mention that tracking trading volume helps measure greater DeFi adoption as well. The chart below shows the monthly DEX trading volume over the years.
© CoinGecko | The Block Crypto
However impressive the data may look, when you think about it, we're still early. (Yeah. I got sick of hearing it too, but in this case, it is true.) See, Uniswap has been operational for only a few years compared to traditional exchanges. And yet, thanks mainly to Uniswap, DEXs have been eating away at their market share like termites.
Certainly, the lack of a fiat on-ramp for DEXs hurts their ability to access fiat capital directly. But again, further innovations in the space (as well as clearer regulations) should help make significant headways in that regard.
3. Transaction Fees
The transaction fees of a DEX depend on the chain it resides on. For instance, Uniswap, which runs on Ethereum, can cost you $60 depending on network congestion (and traffic on Ethereum can make you wish you never left the house. Since Ethereum runs on an auction model, users have to bid for their transactions to get included in the next block. That's why greater congestion leads to increasingly costly bidding wars, ergo the high fees).
Compare this to Cardano, which charges pennies for every transaction. Or how about Solana? Solana also costs peanuts, and it offers a seamless user experience to boot. This is where DEXs have a clear advantage over CEXs, by the way. CEXs collect trading fees, whereas DEXs aim to minimize economic rents. By offering a competitive alternative, DEXs should force CEXs to innovate faster over time as well.
4. Other Features
© Brian Matangelo | Unsplash
Beyond just trading, many established CEXs have branched out to offer more products and offerings in response to the increased competition not just from other CEXs, but from DEXs as well. For example, many exchanges now offer some form of margin trading. CEXs are also beginning to offer “Earn” products, where investors can temporarily lock up their crypto with a CEX in exchange for a fixed return. Finally, some CEXs have also established “Launchpad” offerings to help new projects launch their own tokens directly on their exchanges.
We’ve already established that liquidity pools are crucial for AMM DEXs, so it should come as no surprise that DEXs are willing to reward liquidity providers handsomely (sometimes up to two- to three-digit APYs) for providing liquidity in their trading pairs. If you have some extra crypto lying around, have a think about providing liquidity to a DEX trading pair. By locking in tokens into the smart contract that represents the liquidity pool, you’ll be rewarded with a percentage of the transaction fees.
5. Risks
© Tezos | Unsplash
While providing liquidity may seem like a good deal, generally, the better the deal, the higher the risk. And in this case, the main risk that comes with these handsome yield rates is one of the scariest things that's ever happened to me. And this financial beast has a name: Impermanent loss. That's when the liquidity you provided has less value when you exit. See, AMMs rely on a mathematical formula to ensure that they always have liquidity for a token pair. This formula is expressed as x * y = k, where x and y represent the individually paired tokens. To ensure that k remains a fixed constant, when someone buys an amount of x, its price rises accordingly, thereby sustaining the fixed value of k.
Here's a quick example.
Let's say we have an ETH–DAI pair, with $1000 in ETH and an equivalent amount in DAI (i.e., your DAI, a stablecoin, is also worth $1000.) But let’s say that the price of ETH doubles to $2000. So technically, you should have $3000. But to maintain the k constant, your LP value remains at $2000 (i.e., $1000 in DAI and $1000 in ETH). Why?
This condition creates an arbitrage opportunity, where buyers are incentivized to start buying up your ETH for cheap (with DAI) until your whole LP returns to its original value, thus ensuring that the k constant is maintained. In this scenario, you end up with a lot more DAI—and a lot less ETH—than you put in at the start. In other words, you miscalculated your opportunity cost of capital. Had you simply held onto your ETH and your DAI, without providing liquidity, you would've had $3000, thus pocketing an extra $1000.
You can try to wait for the price to come back down before you pull out. If you don't, you may miss out on this price action. And that is how your impermanent loss becomes permanent, kids.
Not your keys, not your coins. One thing you will want to consider when using a DEX versus a CEX is how comfortable you are leaving your crypto assets on an exchange. See, when you lock in your crypto assets on a CEX, you’re essentially locking them into a hot wallet owned by the exchange. In other words, you no longer have custody over your own assets. By the way, even when you trade on an exchange and keep your assets on “your” exchange wallet, keep in mind, you do NOT own this wallet, so make sure to move your crypto assets from your exchange wallet to your actual wallet at your earliest convenience.
We can compare this with a DEX, where to engage with the protocol, all you need to do is to connect your crypto wallet. In other words, the DEX does not have custody over your assets when you’re trading. You do.
Hacks, bugs, and smart contracts. Real quick: Can CEXs get hacked? Sure. So can DEXs. Smart contracts aren't immune from bugs, after all. At least CEXs can provide some form of insurance. DEXs can't, but certain hacked protocols have been successful in returning funds to their users. For financial services that don't need a central authority, you've gotta admit: That's pretty nifty, eh?
Other Considerations in Choosing a CEX vs. a DEX
Centralization affords us many amazing benefits like speed and convenience. But so does decentralization (e.g., reduced vulnerability to centralized attacks). DEXs are no exception.
Another major benefit afforded by decentralized crypto exchanges? They don't require you to undergo any security measures. Specifically, no Know Your Customer and Anti-Money Laundering procedures. So don't hold up your passport and today's date like you're in some hostage video. What do you do instead? Simply connect your wallet containing your digital assets, and off you go!
Finally, you should consider the types of tokens you’re trading. CEXs sometimes take time to list certain less popular coins, or coins that may not have significant liquidity available. With DEXs, though, there’s no gatekeeper, and literally anyone can create a new liquidity pool as long as they deposit a desired token pair. So if you’re aping into an obscure coin you can’t find on your CEX, chances are, you may find it on a DEX instead.
The Road Ahead is Decentralized (Sort of)
© Lucrezia Carnelos | Unsplash
The future will look DEX-terous. Will we still have CEXs? Probably. But they most likely won't play such a central role in our lives anymore. Once we can figure out the tooling to enable fiat on-ramps for DEXs—as well as other cool instruments only CEXs can currently provide—CEXs will be relegated to secondary status. (They’ll still exist, but to serve specific use cases).
See, if you still read recent articles about DEXs, many of them will point out that margin trades are not possible. But this is old news. And who can blame the writers? The crypto space moves fast. (Faster than you can click "Publish" sometimes). Today we’ve got margin protocols like Mirror and Perpetual Protocol. We’ve got awesome lending protocols like Aave and Bancor too, and we’re only scratching the surface.
The future will look like individual empowerment. DEXs are just one type of DeFi protocol that grants us the ability to squeeze more juice out of our capital. Other DeFi instruments that we haven’t thought of yet will allow us to do even more. But for now, for today, if you're a traditional investor who's new to DeFi, DEXs are a great place to start. I firmly believe they’ll act as a gateway for greater mass adoption of more advanced DeFi protocols. And the crypto space will form the financial hub where all the colorful characters from all walks of life emerge as crypto enthusiasts to hang out.
Whether they be DeFi degens, NFT collectors, sh*tposting meme lords, or normies... DEXs will bring us all together, acting as an onboarding ramp and the road to DeFi.
Subscribe to the CoinGecko Daily Newsletter!