Decentralized Exchange

A decentralized exchange (DEX) is a trading venue where smart contracts on a blockchain execute and settle trades, and users trade directly from wallets they control instead of depositing assets with an intermediary.

Share
Decentralized Exchange

A decentralized exchange (DEX) is a trading venue where smart contracts on a blockchain execute and settle trades, and users trade directly from wallets they control instead of depositing assets with an intermediary. Each trade is recorded as a public onchain transaction, and settlement completes in the same transaction as execution.

How it works

Many DEXs use an automated market maker (AMM), where traders swap against a pool of tokens supplied by liquidity providers, and a formula sets the price. Uniswap v2 uses a constant product rule, x × y = k. In a pool holding 10 ETH and 20,000 USDC, k = 200,000. Buying 1 ETH leaves 9 ETH, so the pool must hold 200,000 / 9 ≈ 22,222 USDC. The buyer pays about 2,222 USDC against a starting price of 2,000, before Uniswap v2's 0.3% fee. That gap is price impact, and it shrinks as pool depth grows. Other AMMs use different formulas. Uniswap v3 lets providers concentrate liquidity within chosen price ranges, and Curve uses its StableSwap curve to reduce slippage between assets expected to trade near parity.

Other DEXs use order books. Hyperliquid runs a central limit order book for perpetual futures and spot markets on its own layer 1 blockchain, with order placement, matching and cancellation handled onchain. dYdX v4, built as a Cosmos appchain, keeps its order book in validator memory and settles matched trades onchain. DEX aggregators such as 1inch split a single order across several venues to find the best execution price.

Why it matters

For an institutional reader, DEXs offer self-custodied execution and a complete public record of every trade, quote change and liquidity movement. This makes onchain volume, depth and counterparty flow directly auditable, which differs from the self-reported figures of centralized venues, as covered in Exchange vs Onchain Crypto Market Data Providers. DEXs are also the primary venue for price discovery on many long-tail tokens that centralized exchanges do not list. The risks are specific. Smart contract bugs and exploits can drain pooled funds. Public transaction ordering exposes traders to maximal extractable value (MEV), including sandwich attacks that worsen execution prices. AMM liquidity providers face impermanent loss when pool prices diverge from external markets. Many DEXs perform no identity checks, which raises compliance questions for regulated participants.

Frequently asked questions

How is a DEX different from a centralized exchange?

A centralized exchange holds customer deposits and matches trades on its own servers. A DEX executes and settles trades through smart contracts, so users keep custody of their assets until the trade settles onchain.

Do all decentralized exchanges use liquidity pools?

No. AMMs such as Uniswap and Curve price trades from liquidity pools. Order book DEXs such as Hyperliquid and dYdX v4 match bids and asks from traders.

Who provides liquidity on a DEX?

On AMMs, anyone can deposit token pairs into a pool and earn a share of trading fees. On order book DEXs, market makers post limit orders. In both cases, liquidity providers carry price and smart contract risk.


See the data behind this post. Browse the decoded DEX trade tables, or read Top DEXs by Volume for how the records are put together.


Allium provides onchain data infrastructure. Companies named in this article may be Allium customers, prospects or commercial counterparties. The authors and other Allium personnel may hold positions in the assets discussed. This article is informational only and is not investment, legal or tax advice. Data and information last reviewed: November 27, 2026.