Skip to content

Decentralized Exchange (DEX)

A decentralized exchange, or DEX, is a software protocol that swaps digital assets automatically. Most price trades against a pooled reserve of the two assets rather than by matching buyers with sellers, which is why the price you get depends on how big your order is relative to the pool.

Last reviewed by Steven Fox, CFP®, EA on

Quick Summary

  • A subcommittee report to the CFTC's Technology Advisory Committee describes DEXs as software protocols that facilitate the automated exchange of digital assets.
  • The common design is an automated market maker, in which a smart contract holds reserves of both assets and a trade executes against the pool rather than against another trader.
  • Price comes from a formula that reads the pool's balances, so a large order relative to the pool gets a worse rate. Bigger pools absorb bigger trades.
  • Anyone can list an asset. Where satisfying the protocol's technical conditions is the only precondition, there is no listing standard, no disclosure, and no review of what the asset is.
  • The contracts do not necessarily incorporate regulatory compliance, and each swap is a transaction on the underlying blockchain that carries that chain's fee.

Definition

A decentralized exchange, usually shortened to DEX, is a set of smart contracts that lets one digital asset be swapped for another without an operator taking the assets in. A subcommittee report to the CFTC's Technology Advisory Committee describes DEXs as software protocols that facilitate the automated exchange of digital assets, and identifies two services they can provide: an automated order book that matches buyers and sellers of a given pair, and a smart-contract-based automated market-making mechanism that pools reserves of each asset and executes trades against those reserves. The second design is the one most users meet, and it is what makes a DEX behave differently from any venue in traditional markets. The reports are advisory-committee subcommittee products and state that they do not necessarily reflect the views of the advisory committee, of the CFTC or its staff, or of the United States government.

How a DEX differs from a company-run crypto exchange in who holds the assets, and what that means for the risk of the venue failing, is covered on the crypto exchange page. This page is about how the venue itself prices and executes a trade.

Advanced Explanation

The automated market maker replaces the counterparty. An earlier subcommittee presentation to the same committee put the mechanism plainly: DEXs rely on automated market maker smart contracts, which enable users to trade digital assets without using an order book, and a purchaser receives the requested asset nearly instantaneously from an underlying liquidity pool, so the trade is pool-to-peer rather than peer-to-peer, with the exchange contract acting in a manner akin to a counterparty. There is nobody on the other side who decided to sell to you. There is a reserve, and a formula.

Two contracts do the work in the design that presentation describes. An exchange contract holds the pool of assets that users swap between. A factory contract creates new exchange contracts and registers asset addresses to them, and because the factory is open and permissionless, anyone can list an asset for exchange. The 2024 report describes the same openness from the asset's side: a newly created digital asset can be listed for trading on any DEX built on the same platform provided it satisfies the conditions that protocol sets, and where those technical conditions are the only precondition, the venue exhibits what the report calls a high degree of decentralized access. The practical translation is that a listing is not an endorsement, a screen or a disclosure. It is a deployment.

Pricing follows from the pool rather than from supply and demand meeting in an order book. The 2020 presentation states that the amount of an asset returned from a swap is based on the AMM formula, which often factors in the number of assets in the pool at any given time, and that at least today, the larger an order is relative to the size of a liquidity pool, the worse the rate the trader receives. Larger pools therefore allow bigger trades with less effect on the price. This is a structural property of the design, not a fee and not a failure: the pool's own arithmetic moves the price against the trader as the trade consumes the reserve. The gap between the price quoted when an order is submitted and the price it actually executes at is what traders call slippage, and on an AMM a large part of it is this effect rather than a delay.

Two participants keep the arrangement working, and both are paid. Liquidity providers deposit assets into the reserve pools, and the 2024 report describes their compensation as often taking the form of tokens representing a fractional interest in the pool's assets, while the 2020 presentation adds that the contracts also award liquidity providers governance tokens carrying the right to weigh in on decisions about the protocol. Arbitrageurs are the second: the 2020 presentation states that pricing stability is achieved through third-party arbitrageurs who profit on any price disparities that surface for a given pool. A DEX's quoted price tracks the wider market because it is profitable for somebody to correct it, not because the protocol looks anything up.

What the venue does not supply is worth listing, because a reader arriving from a brokerage will assume otherwise. The 2020 presentation observes that the smart contracts underlying these venues are, in its word, alegal: they do not necessarily incorporate regulatory compliance. There is no listing committee, no suitability review, no trade-cancellation process and no support desk. A trade sent to the wrong contract address, or against a pool holding an asset that merely shares a name with the one intended, executes exactly as instructed.

Used in a Sentence

“Because the pool for the smaller asset held only a few hundred thousand dollars of each side, Marisol split her order across three days rather than pushing it through the decentralized exchange at once.”

How It Works

A swap on an AMM has four steps. The trader connects a wallet to the protocol's interface. The trader authorizes the exchange contract to move the specific asset being sold out of the wallet, an approval that generally persists until it is revoked. The trader submits the swap, and the contract computes what comes back from the pool's current balances. The underlying blockchain records the transaction, and the trader pays that chain's network fee in the chain's own asset.

The pricing arithmetic is worth doing once, because it explains why an identical order can be cheap or expensive on the same venue on the same day. The commonest AMM design keeps the product of the pool's two balances constant across a trade, so the reserve that is being drawn down gets scarcer and therefore dearer as the trade proceeds.

A hypothetical, ignoring the pool's own trading fee. A pool holds 1,000 units of asset X and 100,000 units of a dollar-pegged asset, so the product of the balances is 100,000,000 and the quoted starting price is $100 per unit of X.

Selling 10 units of X into the pool takes the X balance to 1,010. Holding the product constant, the dollar-pegged balance becomes 100,000,000 divided by 1,010, which is 99,009.90, so the trader receives 100,000 minus 99,009.90, or $990.10. At the starting price of $100, ten units looked like $1,000. The shortfall is $9.90, about 1 percent.

Selling 100 units instead takes the X balance to 1,100. The dollar-pegged balance becomes 100,000,000 divided by 1,100, which is 90,909.09, so the trader receives $9,090.91 rather than the $10,000 the starting price implied. The shortfall is $909.09, about 9 percent, on an order ten times the size. Nothing went wrong and no fee was charged in this example; the pool simply ran out of favorable price as the order consumed it.

Two working conclusions follow. The size that matters is the order relative to the pool, not the order in dollars, so the same trade can be trivial in one pool and punishing in another. And a small trade can be uneconomic for the opposite reason: the network fee is charged per transaction regardless of size, so a $40 swap paying a $6 network fee has lost 15 percent before the pool's arithmetic is even considered.

Pros and Cons

What the design gets right

  • Execution is automatic and continuous. There is always a price, because the pool always has balances, without needing a counterparty to be present.
  • The contracts and the pool balances are public, so the price a trade will receive can be computed in advance rather than taken on trust.
  • Access is open. Any asset that satisfies the protocol's technical conditions can be traded, and any holder with a wallet can trade it.
  • The trader keeps the assets until the moment of the swap, so there is no balance sitting with an operator between trades.

What it costs the trader

  • Price impact is built in. A large order relative to the pool receives a materially worse rate, and thin pools make ordinary-sized orders large.
  • There is no listing standard. An asset with a live price on a DEX has been reviewed by nobody, which is the same mechanism that lets a worthless asset quote a price.
  • Every swap is a blockchain transaction carrying that chain's fee, which makes small trades disproportionately expensive.
  • The token approval given to an exchange contract generally persists until it is revoked, so a flawed or malicious contract can retain permission over that asset after the trade is done.
  • There is no recourse. No trade is canceled, no error is reversed, and the contracts do not necessarily incorporate regulatory compliance.

People Also Asked

Answers to the most frequently asked questions.

How does a decentralized exchange set its price?
From the balances in its own pool rather than from an order book. A subcommittee presentation to the CFTC's Technology Advisory Committee states that the amount returned from a swap is based on the automated market maker formula, which often factors in the number of assets in the pool at that moment, and that the larger an order is relative to the pool, the worse the rate. Third-party arbitrageurs profiting from price gaps are what keeps the pool's price near the wider market.
Why did my swap execute at a worse price than the one quoted?
On an automated market maker, the price moves as the order consumes the pool, so the quoted price is the price of the first unit rather than of the whole order. A larger order relative to the pool produces a larger gap. Traders call the gap slippage, and on this venue type most of it is the pool's arithmetic rather than a delay in execution.
Can any token be listed on a decentralized exchange?
Broadly yes, and that is a design choice rather than an oversight. A subcommittee report to the CFTC's Technology Advisory Committee describes a newly created digital asset being listed on any protocol built on the same platform provided it satisfies that protocol's technical conditions, and calls a venue where those conditions are the only precondition one with a high degree of decentralized access. Nobody reviews what the asset is.
What is a liquidity pool?
It is the reserve of two assets that a smart contract holds so trades between them can execute. Participants called liquidity providers deposit the assets and are compensated, commonly with tokens representing a fractional interest in the pool and sometimes with governance tokens carrying voting rights over the protocol. The pool's size is what determines how large a trade it can absorb without the price moving sharply.
Is a decentralized exchange regulated?
The protocols themselves are code, and the 2020 subcommittee presentation describes the smart contracts underlying them as alegal, meaning they do not necessarily incorporate regulatory compliance. That is a statement about what the software does, not a conclusion that the law does not reach the activity. The CFTC's smart contract primer states that existing law and regulation apply equally regardless of what form a contract takes.

Sources

AdviceOnly maintains high editorial standards to improve the quality and accuracy of our educational content. Content is written with the assistance of artificial intelligence tools following a rigorous quality assurance process, and periodically reviewed by credentialed and experienced human financial advisors. References used include government data, academic papers, interviews with industry experts, and reputable primary sources. You can learn more about our efforts to produce accurate content in our editorial policy.

  1. Commodity Futures Trading Commission, Technology Advisory Committee, Subcommittee on Digital Assets and Blockchain Technology. "Decentralized Finance." (January 8, 2024).
  2. Commodity Futures Trading Commission, Technology Advisory Committee, Virtual Currency Subcommittee. "The Growth and Regulatory Challenges of Decentralized Finance." (December 14, 2020).
  3. Commodity Futures Trading Commission, LabCFTC. "A Primer on Smart Contracts." (November 27, 2018).

Have a question a definition can't answer?

Advice-only advisors answer questions like this for a transparent flat fee — no products, no commissions, no asset management.

Find an Advisor