What Is a Decentralized Exchange (DEX)?

What Is a Decentralized Exchange (DEX)?

แƒ’แƒแƒ›แƒแƒฅแƒ•แƒ”แƒงแƒœแƒ”แƒ‘แƒฃแƒšแƒ˜ Sep 28, 2020แƒ’แƒแƒœแƒแƒฎแƒšแƒ”แƒ‘แƒฃแƒšแƒ˜ Feb 1, 2023


You probably know the drill with cryptocurrency exchanges. Sign up with your email, come up with a strong password, verify your account, and start trading cryptocurrency.

Decentralized exchanges are like that, minus the hassle of sign-ups. In most cases, thereโ€™s no depositing or withdrawing crypto. The trade happens directly between two usersโ€™ wallets, with limited (if any!) input from a third-party.

Decentralized exchanges can be a bit trickier to get the hang of, and they might not always have the assets you want. But, as the tech and interest in it grow, these may very well become integral components in the cryptocurrency sphere.



From the early days ofย Bitcoin,ย exchanges have played a vital role in matchingย cryptocurrency buyers with sellers. Without these forums attracting a global user base, weโ€™d have much poorerย liquidity and no way to agree on the correct price of assets.

Traditionally, centralized players have dominated this field. However, with the rapidly-evolving stack of technologies available, a growing number of tools for decentralized trades have emerged.

In this article, weโ€™ll take a dive into decentralized exchanges (DEXs), trading venues where no intermediaries are required.

Defining decentralized exchanges

In theory, anyย peer-to-peer swapping could constitute a decentralized trade (see, for instance,ย Atomic Swaps Explained). But in this article, weโ€™re primarily interested in a platform that emulates the functions of centralized exchanges. The key difference is that their backend exists on aย blockchain. No one takes custody of your funds, and you donโ€™t need to trust the exchange to the extent that you do with centralized offerings, if at all.

How a centralized exchange works

With your typical centralized exchange, you deposit your money โ€“ eitherย fiat (via bank transfer or credit/debit card) orย cryptocurrency. When you deposit crypto, you give up control of it. Not from a usability standpoint, as you can still trade it or withdraw it, but from a technical standpoint: you cannot spend it on the blockchain.

You donโ€™t own theย private keys to the funds, which means that when you withdraw, you ask the exchange to sign a transaction on your behalf. When youโ€™re trading, transactions donโ€™t occur on-chain โ€“ instead, the exchange allocates balances to users in its own database.

The general workflow is incredibly streamlined because the slow speeds of blockchains donโ€™t impede trading, and everything occurs in a single entityโ€™s system. Cryptocurrencies are easier to buy and sell, and you have more tools available to you.

This does come at the cost of independence: you need to trust the exchange with your money. As a result, you expose yourself to some counterparty risk. What if the team runs off with your hard-earned BTC? What if a hacker cripples the system and drains the funds?

For many users, this is an acceptable level of risk. They simply stick to reputable exchanges with strong track records and precautions that mitigate data breaches.

How a decentralized exchange works

DEXs are similar to their centralized counterparts in some ways but significantly different in others. Letโ€™s first note that there are a few different types of decentralized exchanges available to users. The common theme among them is that orders are executed on-chain (withย smart contracts) and that users do not sacrificeย custody of their funds at any point.

Some work has been done on cross-chain DEXs, but the most popular ones revolve around assets on a single blockchain (such asย Ethereum orย Binance Chain).

On-chain order books

In some decentralized exchanges, everything is done on-chain (weโ€™ll talk about hybridized approaches shortly). Every order (as well as alteration and cancellation) is written to the blockchain. This is arguably the most transparent approach, as youโ€™re not trusting a third party to relay the orders to you, and thereโ€™s no way to obfuscate them.ย 

Unfortunately, itโ€™s also the most impractical. Since youโ€™re asking everyย node on the network to record the order forever, you end up paying a fee. You need to wait until a miner adds your message to the blockchain, meaning the experience can be cumbersome, too.ย 

Some identify front running as a flaw in this model. Front running occurs in markets when an insider is aware of a pending transaction and uses that information to place a trade before the transaction is processed. The front runner, therefore, benefits from information not known to the public. Generally speaking, this is illegal.ย 

Of course, if everything is published on a global ledger, thereโ€™s no opportunity to front run in the traditional sense. That said, a different kind of attack can be deployed: one where a miner sees the order before itโ€™s confirmed, and ensures that their own order gets added to the blockchain first.

Examples of on-chainย order book models include the Stellar and Bitshares DEXs.

โž ย Looking to get started with cryptocurrency? Buy Bitcoin (BTC) on Binance!

Off-chain order books

Off-chain order book DEXs are still decentralized in some regards, but theyโ€™re admittedly more centralized than the previous entry. Instead of every order being posted to the blockchain, theyโ€™re hosted somewhere.ย 

Where? That depends. You could have a centralized entity completely in charge of the order book. If that entity is malicious, then they could game the markets to an extent (i.e., by front running or misrepresenting orders). However, you would still benefit from non-custodial storage.

The 0x protocol forย ERC-20 and otherย tokens deployed on the Ethereum blockchain is a good example of this. Rather than act as a singular DEX, it provides a framework for parties known as โ€œrelayersโ€ to manage off-chain order books. Leveraging 0x smart contracts and some other tools, hosts can tap into a combined liquidity pool and relay orders between users. The trade is only executed on-chain once the parties are matched.

These approaches are superior from a usability perspective than those that rely on on-chain order books. They donโ€™t face the same constraints in terms of speed, as they donโ€™t use the blockchain as much. Still, the trade must be settled on it, so the off-chain order book model is still inferior to centralized exchanges in terms of speed.

Implementations of off-chain order books includeย Binance DEX, IDEX, and EtherDelta.

Automated Market Makers (AMM)

Fed up of reading the term โ€œorder book?โ€ Great, because the Automated Market Maker (AMM) model does away with the idea altogether. It doesnโ€™t requireย makers or takers, just users,ย game theory, and a bit of formulaic black magic.ย 

The specifics of AMMs depend on the implementation โ€“ generally, they string together a bunch of smart contracts and offer clever incentives to ensure user participation. We wonโ€™t detail these implementations, but check outย What Is Uniswap and How Does It Work? for an example of how the Uniswap DEX works.

The available AMM-based DEXs today tend to be relatively user-friendly, integrating withย wallets likeย MetaMask orย Trust Wallet. As with other forms of DEXs, though, an on-chain transaction must be made to settle trades.

Projects working on this front include the aforementioned Uniswap and Kyber Network (which taps into the Bancor protocol), both facilitating the trade of ERC-20 tokens.

Pros and cons of DEXs

Weโ€™ve touched on some of the advantages and drawbacks of DEXs in broad strokes in the previous sections. Letโ€™s delve into them a bit more.

Pros of DEXs


KYC/AML (Know Your Customer andย Anti-Money Laundering) compliance is the norm for many exchanges. For regulatory reasons, individuals must often submit identity documentation and proof of address.

This is a privacy concern for some and an accessibility concern for others. What if you donโ€™t have valid documents on hand? What if the information is somehow leaked? Since DEXs are permissionless, no one checks your identity. All you need is a cryptocurrency wallet.

However, there are some legal requirements when DEXs are partially run by a central authority. In some cases, if the order book is centralized, the host must remain compliant.

No counterparty risk

The primary appeal of decentralized cryptocurrency exchanges is that they donโ€™t hold customersโ€™ funds. As such, even catastrophic breaches like the 2014 Mt. Gox hack wonโ€™t put usersโ€™ funds at risk or expose any sensitive personal information.

Unlisted tokens

Tokens that arenโ€™t listed on centralized exchanges can still be traded freely on DEXs, provided thereโ€™s supply and demand.

Cons of DEXs


Realistically, DEXs arenโ€™t nearly as user-friendly as traditional exchanges. Centralized platforms offer real-time trades that are unaffected by block times. For newcomers unfamiliar with non-custodial cryptocurrency wallets, CEXs provide a more forgiving experience. If you forget your password, you can simply reset it. If you lose yourย seed phrase, however, your funds are irretrievably lost in cyberspace.

Trading volumes and liquidity

The volume traded on CEXs still dwarfs that of DEXs. Perhaps more importantly, CEXs tend to have greaterย liquidity, too. Liquidity is a measure of how easily you can buy or sell assets at a reasonable price. In a highly liquid market,ย bids andย asks have little difference in price, signifying high competition between buyers and sellers. In an illiquid market, youโ€™ll have a more difficult time finding someone that wants to trade the asset for a reasonable price.

DEXs are still relatively niche, so there isnโ€™t always supply or demand for the crypto assets you wish to trade. You may not be able to find the trading pairs you want to use, and if you do, assets might not trade at a fair price.ย 


Fees arenโ€™t always higher on DEXs, but they can be, particularly when the network is congested or if youโ€™re using an on-chain order book.

Closing thoughts

Many decentralized exchanges have emerged over the years, each iterating on previous attempts to streamline the user experience and build more powerful trading venues. Ultimately, the idea seems heavily aligned with the ethos of self-sovereignty: as with cryptocurrencies, users donโ€™t need to trust a third party.ย 

With the rise ofย DeFi, Ethereum-based DEXs have seen a massive uptick in usage. If the momentum continues, weโ€™ll likely witness increased innovation in the technology across the entire industry.

แƒžแƒแƒกแƒขแƒ”แƒ‘แƒ˜แƒก แƒ’แƒแƒ–แƒ˜แƒแƒ แƒ”แƒ‘แƒ
แƒ“แƒแƒ™แƒแƒ•แƒจแƒ˜แƒ แƒ”แƒ‘แƒฃแƒšแƒ˜ แƒกแƒขแƒแƒขแƒ˜แƒ”แƒ‘แƒ˜
Moving Averages Explained
What Is Margin Trading?
What Are Options Contracts?
แƒ“แƒแƒแƒ แƒ”แƒ’แƒ˜แƒกแƒขแƒ แƒ˜แƒ แƒ”แƒ— แƒแƒœแƒ’แƒแƒ แƒ˜แƒจแƒ˜
แƒ—แƒฅแƒ•แƒ”แƒœแƒ˜ แƒชแƒแƒ“แƒœแƒ˜แƒก แƒžแƒ แƒแƒฅแƒขแƒ˜แƒ™แƒแƒจแƒ˜ แƒ’แƒแƒ›แƒแƒกแƒแƒงแƒ”แƒœแƒ”แƒ‘แƒšแƒแƒ“ แƒ’แƒแƒฎแƒกแƒ”แƒœแƒ˜แƒ— Binance-แƒ˜แƒก แƒแƒœแƒ’แƒแƒ แƒ˜แƒจแƒ˜ แƒ“แƒฆแƒ”แƒกแƒ•แƒ”.