Back
Back

What Is a DEX?

What Is a DEX?

The term “DEX” stands for Decentralized peer-to-peer Exchange. Therefore, DEXs are blockchain-based apps that coordinate large-scale crypto asset trading between multiple users. Instead of acting as a financial intermediary between buyers and sellers, DEXs operate using automated algorithms.

Smart contracts are examples of such algorithms, which represent code built on top of blockchain networks. After receiving certain inputs, these algorithms trigger different outputs. 

Disintermediation” is the idea behind a DEX, which refers to the removal of middlemen so that regular people can do business directly with one another. It is essential to keep in mind that a DEX does not offer custody of crypto assets. Instead, all assets stay in the users’ own wallets.

However, to fully understand how DEXs work, it is necessary to first observe traditional crypto exchanges.

How Do Traditional Crypto Exchanges Work?

You deposit funds on a traditional cryptocurrency exchange in either cryptocurrency or fiat. 

If you’re depositing cryptos, you can still withdraw them,  however, it requires asking the exchange to sign the transaction instead of doing it by yourself.

Since everything happens within the exchange’s system, performing transactions is straightforward. You can use numerous trading analysis tools to decide when, how, and what to sell or buy.

However, this approach requires a trade-off: you are essentially handing over your money to someone else. Therefore, you may be at risk of the funds disappearing.

Regardless, most users typically accept this risk. It is the same risk that you take when you deposit money to any online exchange, crypto or otherwise. On the other hand, just as many users deem this risk too high and lean toward a more decentralized approach.

NOTE: When deciding whether to go with a centralized or decentralized exchange, it is wise to keep a critical consideration in mind. Most reputable exchanges — like CEX.IO — are highly secure. CEX.IO is regulated, which means it is responsible for the security of clients’ funds and provides it at the highest possible level. 

How Do DEXs Work?

Remember: DEXs are more complex than traditional exchanges!

You’ll come across several DEX types. Nevertheless, the first thing they all have in common is executing orders on-chain with the help of smart contracts. The second thing is that users do not need to give custody of their funds to any centralized exchange. We’ll observe three of the most common types below:

  • On-chain order books
  • Off-chain DEXs
  • Automated market makers

On-Chain Order Books

On-chain order books are the most popular type of DEX. Their name implies that everything happens on-chain, in that all orders become coded onto the underlying blockchain that the DEX uses. Consequently, all transactions are transparent, and there is no need for an intermediary to act as a broker between you, and the other party. 

However, this approach is resource-intensive and cumbersome. To incentivize users to contribute their processing power to the blockchain, fees are often necessary. The reason they’re deemed resource-intensive is that every node on the network needs to record every transaction.

Off-Chain DEXs

There are also so-called off-chain DEXs. These DEXs have a more centralized operation than an on-chain DEX. In essence, an off-chain transaction moves the value outside of the blockchain through one of several methods:

  • The transacting parties may enter into a transfer agreement
  • The parties may also decide to use a third party that guarantees to honor the transaction (guarantor)
  • The most straightforward way to conduct such a transaction is that two parties exchange their private keys involving a fixed amount of crypto tokens. The advantage of this method is that the coins do not leave the wallet/address, but they receive a new owner off-chain

Automated Market Makers

The third type is Automated Market Makers. These algorithms are complex, and reduce the need to use intermediaries in online exchanges. They result in making the front-end user experience very smooth, even though the back-end math remains quite complicated.

The Benefits of Using a DEX

  • Utility in the developing world. Anonymity, quick transactions, and peer-to-peer lending have made DEXs popular in developing parts of the world. DEXs have become particularly sought-after in regions that lack a solid banking infrastructure.
  • Anonymity. Using the most popular DEXs does not require personal information.
  • Minimizing hacking risks. Hackers are theoretically less likely to access DEX trade funds.
  • Variety. DeFi is the place to be if you are looking for a hot token in its infancy. A DEX offers a nearly limitless number of tokens, including well-known, obscure, and completely random ones.

The Downsides of Using a DEX

  • Unvetted coins. There are more scams and schemes due to the large number of unvetted tokens that are available on most DEXs. If a token is on a hot streak, and its creator mints many new tokens, they run the risk of overwhelming the liquidity pool and reducing the coin’s value. Such a token is then said to be “rug pulled.” 
  • Vulnerability of smart contracts. A DeFi protocol is only as safe as the smart contracts on which it runs. Despite lengthy testing, code can contain exploitable bugs, which can lead to losing your tokens.
  • More challenging user interfaces. It can be tricky to navigate decentralized exchanges, since they may require specialized knowledge. In most cases, you will need to go offsite to find a walk-through.

Essence of Crypto. Nothing else.

Latest lessons in your inbox every week.

logo-subsc

Don’t miss the new CEX.IO University content.

Subscribe to CEX.IO University updates, and receive our newsletter packed with useful guides and tips every week.