Skip to content

What are Decentralized Exchanges (DEXs)? A complete guide

Decentralized Exchanges (DEXs) have risen as an alternative that aligns with the core principles of cryptocurrencies: decentralization, security, and privacy. These exchanges allow users to trade directly, eliminating the need for intermediaries, which reduces costs and increases security. Their growing adoption is due to transparency and reduced likelihood of price manipulation, attracting both retail and institutional investors.

What are Decentralized Exchanges (DEXs)?

A DEX is a platform that allow the exchange of cryptocurrencies and tokens in a decentralized manner, without the need for an intermediary. Unlike centralized exchanges (CEX), where a broker controls funds and transactions, in a DEX, users have full control over their assets thanks to smart contracts that execute and verify transactions in a completely transparent environment.

This decentralized approach offers greater privacy, censorship resistance, and security, although it also presents unique challenges that will be discussed throughout this article.

How DEX got started and evolved

First generation: Based on Order Books (2014-2017)

The first DEXs were based on on-chain order books, where users placed buy and sell orders. While this model eliminated the need for intermediaries, it was plagued with issues such as lack of liquidity, slow order execution, and a user experience that left much to be desired.

Second generation: AMMs and DeFi (2018-2020)

The introduction of automated market makers (AMMs) revolutionized the DEX landscape. AMMs eliminated the need for order books by using liquidity pools where asset prices are algorithmically determined. This not only improved liquidity, but also facilitated mass adoption, especially during the 2020 DeFi boom.

Third generation: Hybrids and Cross-Chain (2020-present)

The latest DEXs combine features of AMMs and order books, and some allow cross-chain exchange between different DLTs. In addition, DEX aggregators have emerged that allow users to find the best prices across multiple platforms, further enhancing the user experience.

How they work and types

DEXs come in various designs, each with advantages and disadvantages in terms of features, scalability and decentralization. As mentioned above, the most common types of DEXs are order book-based DEXs, AMMs and DEX aggregators, which seek the best rate or lowest gas cost across multiple platforms.

In DEXs, fees are typically divided into two types: network fees, which are transaction fees on the underlying DLT, and trading fees, which are charged directly by the DEX or by liquidity providers, token holders, or a combination thereof.

The primary goal of many DEXs is to provide an accessible, permissionless infrastructure with no central points of failure, and with ownership distributed among a community of stakeholders. This approach implies that protocol administration is handled by a Decentralized Autonomous Organization (DAO), where key decisions are made by a community of users through voting. In addition, DEXs are often based on open source, allowing anyone to review their operation.

DEX based on Order Books

An order book is a real-time record of active buy and sell orders in a market. This system allows the exchange to match buy orders with sell orders.

DEXs using fully on-chain order books have been less common at DeFi due to the need to record each interaction in the DLT, which requires higher throughput than most current distributed ledger technologies can support. However, innovations such as optimistic rollups and ZK-rollups, along with the development of high-performance application-specific platforms, have made DEXs with on-chain order books more viable.

On the other hand, some DEXs have adopted a hybrid approach, where order book management and trade matching are performed off-chain, while trade settlement is performed on-chain. However, these DEXs often face liquidity issues as they compete directly with centralized exchanges, and traders must pay additional fees to trade on the main chain.

DEX based on Automated Market Makers (AMM)

To solve the liquidity problem, an automated market maker (AMM) system based on smart contracts has been developed.

AMMs are currently the most popular type of DEX as they offer instant liquidity, democratized access to liquidity provision and in many cases permissionless market making for any token.

An AMM acts as a financial robot that is always ready to offer an exchange price between two or more assets. Instead of an order book, an AMM uses a liquidity pool from which users can exchange tokens. In this way, the price of the assets is determined by an algorithm based on the proportion of tokens available in the pool.

These systems provide instant access to liquidity, which is beneficial in markets with low activity. Unlike an order book-based DEX, where a buyer must wait for its order to match a seller’s order, an AMM provides an immediate quote. Liquidity providers who contribute assets to the AMM fund can earn passive income through commissions generated by transactions.

However, liquidity providers face risks such as impermanent loss, which occurs when the price of one of the deposited assets fluctuates significantly. If the price of an asset increases and the amount of that asset in the fund decreases, the liquidity provider may experience a loss. This loss is “impermanent” because the price could recover and the accumulated fees could offset the losses over time.

DEX aggregators

DEX aggregators are platforms that solve liquidity problems by combining liquidity from multiple DEXs. They aim to minimize the impact of large orders, optimize transaction fees and offer users the best available price. They function similarly to a search engine, gathering data from multiple exchanges to provide users with more options.

In addition to improving pricing, DEX aggregators seek to protect users from price shock and reduce the likelihood of failed trades. Some aggregators also leverage the liquidity of centralized platforms to enhance the user experience, providing greater flexibility and choice to traders.

Does a fully decentralized exchange exist?

The idea of a fully decentralized DEX is more of a utopia than a practical reality, as no DEX currently exists that is fully decentralized in all aspects. Most decentralized exchanges operate on a semi-decentralized model, using in-house servers and off-chain order systems to manage data or relying on external entities to facilitate the exchange of assets.

Although some DEXs achieve high levels of decentralization in certain areas, there is always some degree of centralization in other aspects, such as development, governance, or infrastructure. The reasons for this are as follows:

  1. Development and governance: Even in the most decentralized DEXs, protocol development and updates are often under the control of a centralized team of developers. Although many DEXs implement decentralized governance mechanisms through Decentralized Autonomous Organizations (DAOs), founding teams or central entities still exert significant influence, especially in the early stages of the project.
  2. Infrastructure: Many DEXs rely on centralized infrastructure, such as web servers hosting user interfaces. While the underlying protocol may be fully decentralized and operating on-chain, access through a web interface is still vulnerable to centralization risks such as censorship or server outages.
  3. Order execution and matching: In DEXs using Automated Market Makers (AMM), order execution is fully on-chain, reflecting a high degree of decentralization. In other DEXs that continue to use order books, while execution is on-chain, the execution and matching of those orders may rely on a centralized server to improve efficiency.
  4. Custody: Most DEXs are non-custodial, meaning that users retain full control over their funds, a key aspect of decentralization. This control can be compromised if access to the network is disrupted, which can happen when the front-end interfaces or services that connect users to the protocol are centralized.

As can be seen, some DEXs are close to full decentralization in many respects, but none are in all cases. Full decentralization is difficult to achieve because of the need to balance efficiency, usability, and security, leading to compromises in certain areas of this trilemma that are so common in decentralized environments.

Nevertheless, the trend is toward greater decentralization over time as technologies and governance mechanisms evolve.

Methods and processes: How are external tokens replicated in a DEX?

While DEXs operate on a single infrastructure, replicating external cryptocurrencies or tokens is a challenge that is addressed through several mechanisms. These methods allow users to work with assets that are not native to a particular network, increasing interoperability and flexibility on DeFi platforms.

The following describes the most common methods for replicating external tokens in a DEX:

Wrapped tokens

One of the most common methods of replicating external tokens is through wrapped tokens. A wrapped token is a digital asset that represents another token in another network. Below is an example of the process at Ethereum:

  • Scrow: A smart contract or trusted entity holds an amount of actual BTC in escrow.
  • Issuance: An ERC-20 token (such as WBTC) is issued in Ethereum, backed 1:1 by the BTC in escrow.
  • Exchange: Users can exchange their WBTC on DEX on the Ethereum network.
  • Redemption: When a user wishes to redeem their WBTC for BTC, the WBTC is burned and the equivalent amount of BTC is released from escrow.

Synthetic assets

Synthetic assets replicate the value of an external asset without the need to hold physical inventory of the original asset. This is achieved through collateralization mechanisms and oracles. Below is an example of the process at Synthetix:

  • Collateralization: Users collateralize an amount of another asset (such as SNX, Synthetix’s native token) to mint a synth.
  • Oracles: Oracles provide real-time price data for Synths to reflect the value of the asset they represent.
  • Liquidity and trading: Synths can be traded on DEXs, allowing users to gain exposure to external assets without directly owning them.

Pegged tokens

Pegged tokens are tokens that hold an equivalent value to another asset, similar to how stablecoins are pegged to a fiat currency. Below is an example of the process at MakerDAO:

  • Pegging mechanism: Users deposit cryptocurrency as collateral and issue tokens that are pegged to a specific value (such as USD in the case of DAI).
  • Peg mainteance: Incentives and market mechanisms are used to ensure that the token maintains its value equal to that of the external asset.

Cross-chain bridges

Cross-chain bridges are another advanced solution for replicating external tokens on a DEX. These bridges allow assets to be transferred from one blockchain to another, creating a representation of the token on the new chain. Below is an example of the process at Polygon:

  • Lock in assets: User deposits assets (such as ETH) into a smart contract on the underlying chain (Ethereum).
  • A representative token is issued: A representative token is issued: The smart contract on the destination chain (Polygon) mints a token corresponding to the deposited asset. In this case, a representative token (such as MATIC-ETH) is issued on the Polygon blockchain.
  • Exchange and use of tokens: The representative token can be exchanged on a DEX and used in DeFi applications within the Polygon ecosystem.
  • Redemption: To redeem the representative token for the original asset, the user submits a redemption request that burns the token on Polygon and releases the blocked asset on the original blockchain, in this case Ethereum.

These mechanisms offer creative solutions for integrating external assets into a DEX, although they present challenges in terms of security, reliability, and technical complexity. However, they are fundamental to the expansion and evolution of the DeFi ecosystem, enabling greater interoperability between different platforms.

So, how do you choose the best DEX to trade on?

When looking for a decentralized exchange (DEX) to trade your cryptocurrencies and tokens, it is important to make an informed decision to ensure a trading experience that is safe, efficient and aligned with your investment goals. Unlike centralized exchanges, DEXs offer unique features and benefits, but also present their own challenges. To effectively navigate this environment, consider the following key factors when selecting the best DEX for your trading needs:

  1. Review the DEX’s security protocols: Evaluate the DEX’s security protocols. Review its history for potential vulnerabilities or security breaches, and verify that it has undergone approved smart contract audits. Security is crucial to protecting your assets.
  2. Choose a platform with high liquidity: High liquidity is essential for executing trades efficiently. A DEX with good liquidity allows you to buy and sell assets quickly and at prices close to the market, minimizing the “slippage risk” that occurs when the executed buy order ends up opening or closing at a different price than expected (slippage).
  3. Verify compatible assets and platforms: Make sure the DEX supports the cryptocurrencies or tokens you want to trade and that it is compatible with your asset network. Some DEXs only support assets on specific blockchains such as Ethereum or BNB Chain.
  4. Evaluate the interface and ease of use: A user-friendly interface is important, especially for beginners. The DEX should be easy to use and provide clear instructions for trading and other transactions. It is also important to check that the DEX and its underlying network do not experience frequent outages, as this could affect your trading activities and profits.
  5. Review transaction fees and associated costs: Consider the fee structure of the DEX, including trading fees and transaction fees of the underlying network. Lower commissions can make a big difference, especially if you trade frequently or in large volumes.

By considering these factors, you can choose a DEX that not only meets your trading needs, but also provides a secure and efficient experience.

The future of decentralized exchanges

The future of decentralized exchanges (DEX) is characterized by the integration of advanced technologies and the expansion of their capabilities beyond the simple exchange of cryptocurrencies and tokens. One of the most prominent innovations is the introduction of decentralized custody through Multiparty Computing (MPC). This technology significantly improves security by allowing users to maintain full control of their funds, eliminating the need to deposit them with the exchange and reducing the risks associated with centralized custody.

In addition to improved security, DEXs are beginning to offer innovative financial products that go beyond traditional cryptocurrency trading. For example, some DEXs now allow trading of bankruptcy claims, a financial product that until recently was reserved for traditional financial markets. This reflects a growing trend of DEXs broadening their horizons to include new asset classes and services, which could transform the digital financial landscape by making a wider range of products available on a decentralized platform.

Finally, with the continued evolution of distributed record keeping technologies and the demand for greater privacy, security and product diversity, DEXs are well positioned to play a key role in the future of global finance, driving innovation and financial inclusion worldwide.

Resources:
[1] Dydx.exchange – Dex
[2] Coinbureau – Digging into Decentralised Exchanges
[3] Cointelegraph – What are decentralized exchanges, and how do DEXs work?
[4] Cointelegraph – The evolution of decentralized exchanges: A comparative analysis
[5] Chainlink – What Is a DEX (Decentralized Exchange) 
[6] Kucoin – Top Decentralized Exchanges (DEXs) to Know in 2024


At Block&Capital, we strive to create an environment where growth and success are accessible to all. If you’re ready to take your career to the next level, we encourage you to join us.