top of page
< Back

What Is a Decentralized Exchange (DEX)?

You probably know how it works when it comes to cryptocurrency exchanges. Creating a strong password, logging into the site with your email address, and verifying your account will allow you to start trading cryptocurrencies immediately. decentralized exchanges work like that, but without the signup hassle. Most of the time, depositing and withdrawing cryptocurrency aren't required. There is no third party involved in the trade, in that it happens directly between two users' wallets, with no input (if any!) from third parties.

A decentralized exchange can seem like a bit of a challenge at first, and they may not have all the assets that you are looking for. This may very well turn out to be integral parts of the cryptocurrency world as the cryptocurrency industry and the interest in it grows.

Introduction

 Exchanges have played a crucial role in connecting cryptocurrency buyers and sellers starting from the early days of Bitcoin. The forums are the first line of defense against a lack of liquidity, and if they did not attract a global user base, there would be no way to agree on the correct price of assets. In traditional markets, centralized players dominated this market.

However, a growing number of tools aimed at decentralizing trades have emerged largely due to the rapidly-evolving stack of technologies available. we're going to take a closer look at decentralized exchanges (DEXs), trading venues for which no third-party intermediaries are necessary.

Defining decentralized exchanges

A peer-to-peer exchange could theoretically constitute a decentralized transaction (see, for example, Atomic Swaps Explained). In this article, we are most interested in a platform that emulates the function of centralized exchanges and aims to emulate it as closely as possible. The main difference is that the platform's back-end is based on blockchain technology. The exchange takes no responsibility for your funds, and you do not have to rely on it to the extent that you rely on centralized firms.

How a centralized exchange works

You can deposit your money on your typical centralized exchange either in fiat money (via a bank transfer or a credit/debit card) or in cryptocurrency. When you deposit cryptocurrency, you give up your control over it. Not from a usability perspective, since you can still trade it and withdraw it, but rather from a technical perspective: it cannot be spent on the blockchain.  Whenever you withdraw funds, the exchange signs a transaction on your behalf since you do not possess the private keys. Trading takes place off-chain instead of on-chain - instead, the exchange allocates balances to users in its own database, rather than trading takes place on-chain.

 

In general, the workflow is extremely streamlined as the slow speeds of blockchains do not limit trading, and everything happens within the system of a single entity. The use of cryptocurrencies makes it easier to buy and sell, and there are more tools available.

Nevertheless, it comes at the expense of your independence as you are in the position of entrusting your money to the exchange. Therefore, you may be exposed to some counterparty risk. What if the team absconds with your hard-earned coins? What happens if a hacker breaks into the system and drains all the funds?

 

That level of risk may be considered acceptable for some users. Instead, they rely on trusted exchanges with strong performance records and precautions that prevent data breaches.

How a decentralized exchange works

There are some aspects that DEXs have in common with their centralized counterparts, but there are others where they differ significantly. As a first point of clarification, there are several types of decentralized exchanges that users may choose from. It is a common theme that all of them have in common that their orders are executed on-chain (through smart contracts), and that consumers do not surrender any of their funds for any reason. While cross-chain DEXs have been developed, the most popular ones are based on a single blockchain

On-chain order books

Several decentralized exchanges operate entirely on-chain. The blockchain records every order (including alterations and cancellations). The approach described above is arguably the most transparent, since you are not relying on a third party to relay orders, and no way of concealing them can be employed.

 

This is unfortunately also one of the most impractical methods. It is therefore not surprising that you end up paying a fee, since you are asking every node on the network to record the order forever. As a result, the experience can be a bit cumbersome, as you must wait for a miner to enter your message into the blockchain.

 

This model has been criticized for front running. An insider may use information related to a pending transaction to place a trade before that transaction has been processed, a practice known as front running. Thus, the front runner has access to information that the public is unaware of. It is generally illegal to do so.

 

There are no opportunities for front running in the traditional sense of the term if everything is published on a global ledger. As a result, a completely different kind of adversity can occur. That is, a miner can see an order before it's confirmed, and ensure that their own order is added first to the blockchain.

Off-chain order books

While off-chain order book DEXs still contain some decentralization in some respects, they are admittedly becoming more centralized as seen in the previous entry. Rather than posting all orders to the blockchain every time, every order is actually stored somewhere else.

But where? Well, it depends. It is possible to have a centralized entity handle the order book. In the case of malicious intent, this entity makes it possible to game the markets to an extent (e.g., by front running or misrepresenting orders). However The advantage of non-custodial storage would remain.

 

A good example of this can be seen in the 0x protocol which is a protocol that used to manage ERC-20 tokens and related tokens on the Ethereum blockchain. Rather than acting as a standalone DEX, it provides a framework that allows a third party, known as a relayer, to manage off chain orders. Hosting platforms can tap into a combined liquidity pool and relay orders between users using 0x smart contracts and some other tools. Trades are only executed once the parties involved have agreed on terms.

 

In terms of usability, this approach offers a better solution than those that rely on on-chain order books. As they do not rely on the blockchain as frequently, they do not face the same challenges in terms of speed. In terms of speed, however, an off-chain order book is still inferior to a centralized exchange due to the fact that trades must be settled there.

Automated Market Makers (AMM)

The Automated Market Maker (AMM) model does away with it completely. There is no need for makers or takers, just users, game theory, and a little bit of formulaic black magic. The specifics of AMMs depend on how they are implemented - usually, they implement a bunch of smart contracts stringed together and offer clever incentives to ensure user participation. We won't go into depth on these implementations, but check how does Uniswap work?

 

The AMM-based DEXs that are currently available tend to be relatively user-friendly, with wallets such as MetaMask or Trust Wallet seamlessly integrated into the DEX. In order to settle trades, a transaction on-chain must be made as with all other forms of DEXs. Projects facilitating the exchange of ERC-20 tokens include the Uniswap service and the Kyber Network (which uses Bancor's protocol).

Pros and cons of DEXs

In the previous sections, we discussed some of the advantages and disadvantages of DEXs in broad strokes.  Now let’s explore them in greater depth.

Pros of DEXs

No KYC

Most exchanges have adopted KYC/AML (Know Your Customer and Anti-Money Laundering) compliance as the norm. People are usually required to provide proof of their identity and address in order to participate in an exchange.

 

In some cases, this may cause privacy concerns for some, while in others, it may cause accessibility concerns. However, what if you don't have the proper documentation on hand? What if it turns out that the information has been leaked somehow? In DEXs, there is no verification of your identity since they are permissionless. You just need to have a cryptocurrency wallet.

 

When DEXs are partially run by a central authority, however, there are some legal requirements that apply. Generally, if an order book is centralized, then the host must remain compliant in some cases.

No counterparty risk

Decentralized cryptocurrency exchanges are primarily appealing to users because they do not hold client funds. Therefore, even catastrophic breaches like the 2014 Mt. Gox hack will not lead to users' money being at risk or personal information being exposed to unauthorized parties.

Cons of DEXs

Usability

Decentralized exchanges do not offer nearly as much user-friendliness as traditional exchanges. Trades are made in real-time on centralized platforms without being affected by block times. CEXs provides a more straightforward experience for those who are unfamiliar with non-custodial cryptocurrency wallets. The system will allow you to reset your password if you have forgotten it. In the event you lose your seed phrase, though, your funds are irretrievable lost in cyberspace.

bottom of page