Back to articles

What are decentralized exchanges?

Explainer Series
Explainer Series

What are decentralized exchanges?


What is a decentralized exchange?


Decentralized exchanges, also called DEXs, are cryptocurrency marketplaces that allow traders to make autonomous peer-to-peer transactions without the need for a third party. Instead, self-executing smart contracts are used to facilitate transactions - giving users full control over their funds. 



Key Takeaways :


  • Decentralized exchanges are autonomous trading venues operating on blockchain networks that allow individuals to trade assets in a trustless manner;
  • Decentralized exchanges are a critical component of the DeFi ecosystem, serving as the backbone of economic activity conducted on blockchain networks;
  • The Automated Market Model allows for trades to be efficiently executed without the need for a trading counterparty or a centralized orderbook.


What Is An Exchange? 


Exchanges are venues for trading activity. These are not limited to crypto - exchanges exist for virtually every asset in existence. Stocks, bonds, equities, foreign currencies, and more are all traded on various exchanges. For many market types, such as stock markets, exchanges are heavily regulated and monitored, and only trade during certain hours on certain days of the week. Well-known examples of exchanges include the New York Stock Exchange, the Chicago Mercantile Exchange, and Euronext. 


Types of Exchanges 


While exchanges can be classified by the type of asset traded, exchanges can also be classified by the manner in which trades are conducted. There are auction market exchanges, over-the-counter exchanges, ECN’s, and more each with their own characteristics. 


The New York Stock Exchange is an example of an “auction market” exchange. The exchange aggregates orders placed by traders into an orderbook, and automatically pairs buyers and sellers in order to execute transactions - avoiding any direct communication between participating parties. 


Over-the-counter exchanges operate slightly differently. They require the traders themselves to find a counterparty to their buy or sell orders in order for a trade to occur. Negotiations between parties are common between parties transacting in OTC markets, and in many cases it can be difficult to find a counterparty to fill orders. This being the case, trading volume (a metric that tracks the total number of shares traded in a given day) tends to be much lower on over-the-counter (OTC) exchanges than on auction-based exchanges. 


Cryptocurrency Exchanges


Cryptocurrency exchanges operate similarly to exchanges of other asset types but with a few distinct differences. Unlike traditional exchanges - which are all centralized - Crypto exchanges can be either centralized or decentralized and can employ a variety of methods to facilitate trading activity. 



If an exchange is centralized it operates as a company with an owner, residing on a single server or set of servers that power a website or app interface. The company’s apps can experience downtime and/or the website can be overloaded during periods of high trading volume. Centralized exchanges typically offer more competitive fee structures than their decentralized counterparts but are less secure - several exchanges have been hacked in recent years resulting in billions of dollars of losses for users. 


Centralized exchanges are also custodial, which means they hold your funds for you and have ultimate control over the funds that you deposit. Typically, centralized exchanges require users to open an account and agree to terms - much like a bank account - and in some cases, provide personal information and identity verification. For these reasons, many crypto users do not like using centralized exchanges as the user experience is very similar to that of traditional finance. 


Crypto exchanges can also be decentralized. Instead of operating under the ownership of a company, decentralized exchanges are often managed by a community and exist on a blockchain network (rather than a central server).  Often referred to as “DEXs” or a “DEX”, these exchanges inherit the traits that make blockchains valuable, such as immutability, security, and zero downtime. Decentralized exchanges are also non-custodial, meaning they do not take control of your funds and do not require you to deposit funds in order to make a trade.



How Do Decentralized Cryptocurrency Exchanges Work?


Decentralized exchanges function by pairing buyers and sellers together to execute trades at a given price. The way that orders are matched can be done in a few different ways, using order books or by taking an “automated market maker” (AMM) approach. 



Order books are how most traditional exchanges fulfill orders. When a person decides they want to buy or sell an asset, that person specifies the price at which they are willing to complete the transaction. This price and quantity is then entered into a queue of orders and once a match is found, the trade is executed. Most centralized crypto exchanges utilize order books as it is a highly efficient way to pair buyers and sellers together in an active trading market. 


In contrast to traditional exchanges, there are relatively few decentralized exchanges which utilize order books to fulfill orders. For a DEX to use order books, the orderbook itself would have to be stored on the blockchain which is cost prohibitive given the amount of data required. This type of data storage, referred to as “on-chain” data, has become increasingly expensive as fees have risen over the past two years, leading many DEXs to opt for an Automated Market Making (AMM) approach. 


In DEXs that utilize an Automated Market Making model, liquidity pools act as the counterparty for every trade. If someone is selling coins, the liquidity pool acts as the buyer. Likewise when someone buys coins, the liquidity pool acts as the seller. Liquidity providers (LPs) are the individuals who deposit their assets into the liquidity pools, and in exchange for the service they provide, LPs are compensated by earning trading fees collected by the pool. Now that we have an understanding of the actors involved in a dex trade, let's dive deeper into these concepts with the following example.


Let’s say there are two crypto tokens, A and B. A user of a decentralized exchange wishes to become a liquidity provider, and deposits 100 “A” tokens and 100 “B” tokens into a liquidity pool. The pool algorithmically determines the price of the tokens by looking at the ratio of tokens in the pool. With a balance of 100 A and 100 B, the pool would value tokens as 1 “A” token = 1 “B” token. 


When a trader interacts with a liquidity pool, they are effectively changing the balance of tokens in the pool - and thus the price ratio between the tokens. To see how this mechanism impacts prices, let’s move forward with the current example.


A trader decides to exchange 10 A tokens for 10 B tokens through the pool. When the trader places their order with the DEX, they are effectively adding 10 A tokens to the pool and removing 10 B tokens. The new balances of the pool are 110 “A” and 90 “B”. Since the DEX uses the ratio of tokens to determine the price of each respective token, the price is no longer 1:1 (since the ratio is no longer 1:1). The ratio is now something like 1.22 “A” for every 1 “B”.


Automated Market Makers are beneficial because of the transparency, executional efficiency, and liquidity they are able to offer traders, however also suffer from drawbacks such as poor executions for large trade sizes, lack of trading pairs, and poor user experience.



In Summary


Automated Market Making is a powerful new invention that revolutionizes the way trades are executed. While order books work well for centralized exchanges, they are not always practical for blockchain-based applications, especially when there is high demand for block space. Dexes that use AMM’s are superior to their centralized counterparts, offering a more secure and reliable service. While both centralized and decentralized exchanges provide traders with a venue to transact, DEXs do so in a manner more in line with the principles of the larger crypto market.


Next Article

Next Article

Related Articles

No items found.