DeFi
Learning Center
img
Waves Labs
Feb 7,2023
8 minute read

What Is a Decentralized Exchange (DEX)?

What is a decentralized exchange? How does it differ from a centralized one? Do they have any limitations? And why would you want to use one? This short guide covers those questions—and more.

 

What Is a Decentralized Exchange?

A decentralized exchange, or DEX, is a peer-to-peer marketplace that allows buyers and sellers to trade cryptocurrency without a central authority. 

Instead, trading happens via smart contracts: programs that execute automatically when they meet the conditions written into the computer code.

While all DEXs rely on smart contracts, they don’t all use the same infrastructure. Some follow the order book model of centralized exchanges, while others are automated market makers (AMMs), pooling liquidity from users.

There are also those that use a hybrid model by, for example, combining the two (more on this later)!

Decentralized Exchange vs. Centralized Exchange (CEX)

Users can better understand a DEX through comparison against a CEX, which acts as an intermediary for clearing transactions. There are core differences between the two:

Trade settlement

DEX: Buyers and sellers trade with one another, and smart contracts settle the trades directly on the blockchain.

CEX: Buyers and sellers place orders, and the exchange records the list of orders in an order book. Buyers try to buy low. Sellers try to sell high. As the intermediary, the CEX settles all trades which are recorded on the exchange’s internal database.

The verification process

DEX: Users don’t need to create an account or follow any verification process.

CEX: The exchange follows the Anti-Money Laundering (AML) and Know Your Customer (KYC) guidelines. AML is the laws and procedures for uncovering any activities that try to conceal illegal funds.  KYC is the process of identifying and verifying someone’s identity. Traders need to submit their ID as part of this process.

Control of funds

DEX: Users are the custodian of their cryptocurrency, as they have access to and control of their private keys. Private keys are the password—the combination of letters and numbers—for accessing, securing, and managing cryptocurrency.

CEX: The exchange is the custodian of users’ funds, as they can control access to user accounts and private keys.

Buying cryptocurrency

DEX: Users can only trade cryptocurrency for cryptocurrency. It’s not possible to trade fiat for cryptocurrency and vice versa.

CEX: Users can trade fiat for cryptocurrency and cryptocurrency for cryptocurrency

Summary

2000x1125.png

The Types of Decentralized Exchanges and How they Work

While smart contracts facilitate trading on a DEX, not all DEXs use the same infrastructure and operate slightly differently. Here are the four types of DEXs and a summary of how they work.

1. Order Book DEXs

Order book DEXs are simply an online list of buy and sell orders. They allow traders to provide their best bid (buy) or ask (sell) prices. The exchange then matches those willing to sell and buy at a specific price without an intermediary and executes these trades automatically. Examples of order book DEXs include Loopring DEX and Serum.

Loopring DEX is an Ethereum-based DEX that uses a scaling solution known as zkRollup. zkRollup allows for more transactions per second at a lower cost. Serum, in turn, is a  Solana-based DEX offering cross-chain support so users can trade tokens built on other blockchains like Ethereum.

There are two types of order books DEXs:

On-chain order books: transaction information is stored on the blockchain

Off-chain order books: transaction information is stored off the blockchain, but transaction settlement happens on the blockchain

The big problem with order books is that traders often have to wait for order fulfillment if there are no market makers to cover the spread. This can cause liquidity issues when traders are unable to trade assets at the precise moment they want to.

The spread is the difference between traders’ asks (the lowest price traders will sell cryptocurrency for) and bids (the highest price traders will buy cryptocurrency for). Market makers are institutions that inject sufficient liquidity into the market by covering the spread to ensure trades execute even if there isn’t an exact ask-bid match. In traditional markets, these market makers are central banks. In the cryptocurrency space, they are liquidity providers (discussed next).

2. Automated Market Maker (AMM)

An AMM is a smart contract system and the most common type of DEX. It solves the problems faced by order book DEXs that have insufficient liquidity to make a market for buyers and sellers.

Users can trade or “swap” tokens at any time with other users directly against liquidity pools: crowdsourced tokens locked in a smart contract to allow traders to swap one token for another.  

So, when traders buy cryptocurrency from an AMM decentralized exchange, they buy from a liquidity pool. An algorithm controls the prices of tokens in these pools, and anyone can add cryptocurrency to a pool to become a liquidity provider. People receive a portion of the trading fees generated as an incentive. 
 

Examples of AMMs include Uniswap and Sushi. Uniswap is an Ethereum-based DEX that has its own token, UNI. Sushi, formerly SushiSwap, is also an Ethereum-based DEX powered by the native SUSHI token.
 

3. DEX Aggregators

DEX aggregators are a type of AMM. They let traders trade tokens from multiple DEXs in one streamlined interface, giving traders more options, better prices, and greater access to liquidity to facilitate trades. Examples of DEX aggregators include 1Inch and ParaSwap.
 

4. Hybrid DEX

In addition to the common exchanges, there are hybrids. For example, an exchange may decide to be an AMM that uses smart contracts while using the user interface (UI) of a traditional exchange. 
 

WX Network, for instance, is a DEX that does this. They recognize that while following only the order book model can lead to liquidity issues, the UI is familiar and often more user-friendly than only using AMM. So they use the traditional UI used by most centralized exchanges and combine it with AMM to solve the liquidity issues.

Pros and Cons of Decentralized Exchanges

The prior sections touched on some benefits and drawbacks of DEXs but let’s look at these in more detail. 

Benefits of DEXs

Non-custodial. Users have complete control of their private keys and cryptocurrency. This control means they’re their own bank and don’t need a third party’s (e.g., a bank’s) permission to access and move funds. Users also don’t have to worry about someone else taking it away.

Trustless transactions. Smart contracts ensure transactions execute automatically once hard-coded conditions for a transaction between two parties are met.  Counterparties don’t need to know – or trust each other, nor do they need to rely on a third-party intermediary to guarantee the finality of transactions. This process makes these transactions more secure.

Low fees. Without an intermediary who takes a fee for executing transactions, DEXs provide users with lower transaction costs.

No KYC process. Users don’t have to go through a lengthy verification process to join a DEX, making them uncensorable, and more accessible to most people.

Limitations of DEXs

Scalability is hard. DEXs use smart contracts, which rely on underlying blockchain infrastructure. This infrastructure can sometimes be limiting. For instance, most DEXs run on the Ethereum blockchain, which has historically struggled with scalability. It can only process 15 transactions per second. However, there are Layer 2 solutions that address this problem.

Lack of liquidity. Order books DEXs can experience liquidity issues. There may not be a big enough market of buyers and sellers to close trades, or market makers to cover the spread. While AMMs address this problem, the proliferation of cryptocurrency token trading pairs can still cause market segregation and poor liquidity.

Complex user experience. DEXs are still relatively new. As a result, their user interface designs sometimes need work. There’s a steep learning curve to get started, with many users unwilling to go through this curve. Users must familiarize themselves with getting their fiat onto a CEX to buy cryptocurrency, sending tokens from a CEX to a cryptocurrency wallet, and then connecting the wallet to a DEX to trade. This process can be daunting even for those who understand trading on a centralized exchange.

Trading fiat for cryptocurrency isn’t possible. Some may say this isn’t a drawback but an advantage. The truth is that the inability to trade fiat for cryptocurrency limits the adoption of DEXs. DEXs cannot quickly onboard new users who may only feel comfortable with fiat to start or only have the means to enter the market with fiat.

DEXs: The Exchanges of the Future

Centralized exchanges remain popular in the cryptocurrency space. But more and more DEXs are entering the market, providing an alternative way for traders to trade cryptocurrency. 
 

Their proliferation will likely only continue thanks to their appeal—non-custodial, trustless, low fees, and accessibility—and how for many these benefits outweigh the pitfalls. In the end, it depends what traders value the most.
 

If anything, the current pitfalls present an exciting opportunity for entrepreneurial-minded builders and developers to solve all these problems and be part of the next evolution of finance, and the internet.  
 

WX Network is one exchange that’s solving some of these problems to be part of this next evolution. By combining the traditional UI of most centralized exchanges with an AMM, WX Network can simultaneously provide a user-friendly platform while solving liquidity issues.
 

Learn more about WX Network here.