What Is a Decentralized Exchange?

Jun 4, 2021

For as long as we know, investors have bought and sold cryptocurrencies using traditional centralized exchanges. The process is always the same: find a good platform, register an account, complete the standard KYC process, and start investing in digital assets.

But something strange happened in 2020. Developers and users alike latched onto the idea of decentralized exchanges as oracles became a reliable source of on-chain and off-chain data. A billion dollars became two and after more than a year DeFi turned into almost a $100 billion idea, with decentralized exchanges accounting for a sizeable portion of that sum.

Leaderboard of the top 7 DEXs (~$9B in value)

With the rising adoption of DeFi, more and more users have migrated to decentralized exchanges (DEXs) that provide the complete opposite experience of what we usually encounter in a CEX. These exchanges enforce neither verifications nor signups, and at any given moment, the crypto you trade is entirely under your control

But how are decentralized exchanges decentralized, and in what kind of way does their method of operation differ from centralized trading platforms?

What is a decentralized exchange?

By definition, any transaction that happens in a peer-to-peer fashion can be thought of as being a decentralized trade. 

Centralized vs decentralized systems

If two crypto fans called Bob and Alice trade Ethereum for, let’s say Tether with each other, and the entire transaction takes place on a blockchain, the trade is decentralized. If that were to happen through a 3rd-party system like an exchange or a custodian the trade would be centralized.

Therefore, as long as we have peer-to-peer trading that stays at all times on the blockchain and interacts in no way with a centralized platform, the swap in question is decentralized.

Decentralized exchanges practice the same process, with the core difference being that they mimic centralized trading platforms. Their goal is to provide a blockchain-powered platform that offers trading services and liquidity to crypto investors, just like Binance or Coinbase do. 

Decentralized trading interface on Solana-based Bonfida
Centralized trading interface on Binance

The way that they achieve that is by relying on the use of smart contracts - a bundle of code that is automatically and autonomously executed once certain conditions are met. This means that DEX operators can automate withdrawals, deposits, and trades without having to personally authorize them or initiate any actions on their part.

Example of what a smart contract can do

Types of decentralized exchanges

Smart contracts have allowed developers to create three major formats of decentralized exchanges:

  • DEX with an on-chain order book
  • DEX with an off-chain order book
  • DEX with an Automated Market Maker (AMM)

Exchanges with on-chain order books are completely decentralized, considering that all events and actions are recorded on the blockchain, which ensures a completely transparent trading experience. However, such exchanges are impractical since users have to pay even more fees and can be front-run by other users who can view pending transactions on blockchain explorers.

Exchanges with off-chain order books take decentralization down a notch by using a centralized system to host their order books. Rather than being stored on blockchain networks, orders on this type of exchange are processed by an offline entity that is not decentralized. Nevertheless, the trades themselves are still executed on-chain. 

The newest and most popular option is an exchange with an automated market maker. AMMs outright reject order books and implement a radically different form of processing and distributing liquidity by using game theory, mathematical formulas, and wrapping them up in smart contracts.

Uniswap’s AMM schema

Nearly every decentralized exchange nowadays uses automated market makers. The most famous implementation is Uniswap, a trading platform that utilizes the constant product formula of x * y = k.

While X and Y represent a trading pair of two different tokens, K is an unchangeable constant that must be preserved at all times. Simply put, the formula dictates that all changes in the trading pair’s reserve balances should not change the constant product of K. This is made possible by charging fees for every trade and transferring it back to liquidity reserves, which creates a counterbalance by adding a positive pressure to the K constant.

Providing liquidity

Liquidity is the blood of every exchange. It is what keeps trading platforms alive and attracts new users. So, if DEXs are decentralized, how do they acquire liquidity in the first place?

Decentralized exchanges primarily rely on liquidity providers who engage in liquidity mining and yield farming. These users are financially incentivized to lend their crypto assets to a DEX in return for monetary rewards. The liquidity given to an exchange is then used to fuel a trader’s token swap who has to pay a fee for the transaction. A portion of this fee is given back to liquidity providers in return for providing the original liquidity in the first place.

Uniswap (DEX in general) ecosystem

This symbiotic relationship is what makes decentralized exchanges thrive in an ecosystem such as the crypto market. Each of the three parties (exchange operators, liquidity providers, and traders) provides something and takes another thing in return. 

Disadvantages of DEXs

From all this talk, we may have given you the impression that decentralized exchanges are perfect and that there is nothing wrong with them - but that couldn’t be farther from the truth!

There are three notable disadvantages that affect users of nearly all skills levels, and they include:

  • User experience
  • Fees
  • Trading volume

Decentralized exchanges aren’t known for offering a great user experience. They are clunky, difficult to use, and buggy. A crypto veteran might have an easier time trading on Uniswap or SushiSwap, but a beginner will most likely fail at the very first step. Newcomers tend to not understand how to perform a transaction, they can forget passwords, seed phrases, and lose access to their funds. 

Fees are another predominant issue that rarely goes away. Since trades are executed by smart contracts rather than the centralized systems employed by traditional exchanges, traders pay higher fees on average. Fees on decentralized exchanges are not that bad, but whenever a network is congested users can pay up to hundreds of dollars for a single trade.

Although decentralized exchanges have caught up with centralized ones in terms of liquidity, they are still dwarfed by industry giants like Coinbase and Binance. Liquidity is truly everything, and when a DEX does not have enough of it, it is better to stick with centralized trading platforms. Illiquid markets are chaotic to trade as they have high slippage rates and empty order books in between major price levels. 

Final Word

All-in-all, decentralized exchanges are revolutionary platforms that have changed the crypto market forever. Some believe that DEXs can turn crypto platforms totally independent from the real world by giving users a way to interact with each other solely through a blockchain.

We have yet to see whether the new wave of exchanges will achieve that goal as there are still many obstacles. Fees are unbelievably high, trading interfaces are still primitive, and decentralized exchanges are nowhere near reaching the level of liquidity that centralized platforms offer.

Once the DeFi sector matures and developers focus more on building rather than marketing products during a euphoric market, we will surely see a positive shift in tone. Until that moment, only trading experts and crypto whales will have fun using decentralized exchanges. 

More articles

All Articles

What Is THORChain (RUNE)?

Thorchain is a decentralized exchange specialized in cross-chain connectivity that allows traders to swap tokens between different networks.


How to Invest in Cryptocurrency

In this step-by-step guide, we will show you how to invest in cryptocurrency and prove that digital currencies are not as intimidating as they appear.

Bitcoin & Blockchain

The Types of Cryptocurrencies and Their Use Cases

Cryptocurrencies vary based on not only their design but use cases as well. The diverse market includes 4,000 cryptocurrencies with a majority of them being tokens.

Bitcoin & Blockchain