Decentralized Exchange Definition

A decentralized exchange, or DEX, is a peer-to-peer marketplace where people trade crypto directly from their own wallets. There is no central company holding customer funds or brokering the swap. Smart contracts on a blockchain handle the trade from start to finish.

Core idea: non-custodial trading

DEXs are non-custodial, which means you keep control of your private keys and assets the whole time. Orders are executed by code rather than a human operator. Trades settle on the blockchain rather than on an exchange’s internal database. This setup cuts out counterparty risk that comes from trusting a custodian.

How a DEX works

Most DEXs run as a set of smart contracts. Instead of a traditional order book, many use automated market makers, or AMMs, that rely on pools of tokens to quote prices and fulfill swaps. The code determines the price based on the pool’s balances, then completes the trade atomically if the conditions fit. Some DEXs still use order books, but AMMs are the common pattern.

Liquidity pools and providers

Liquidity pools are shared reserves of two tokens. Users known as liquidity providers deposit an equal value of each token to seed a market. In return, they get a cut of trading fees. On many AMM DEXs, a typical swap fee is around 0.30 percent, paid by traders and distributed to liquidity providers, although exact fees vary by protocol.

What you can trade

DEXs focus on crypto-to-crypto swaps. They do not handle fiat on-ramps themselves, so you trade one token for another rather than moving between cash and crypto. Because anyone can create a token and a pool on a supported network, DEXs often list assets long before centralized exchanges. That openness also brings more unvetted tokens.

Fees and other costs

Two costs apply when you trade on a DEX. First is the protocol’s swap fee that goes to liquidity providers. Second is the network’s gas fee to execute the transaction on-chain. On networks like Ethereum, gas can dominate the total cost during busy periods. Scaling solutions reduces typical gas costs and speeds up confirmation times.

Benefits

  • You keep custody. Trades happen from your wallet, so there is no centralized hot wallet holding user balances
  • Broad token access. New or niche tokens often appear via a pool before they reach centralized venues.
  • Minimal sign-up. Most popular DEXs do not require personal information to start swapping.
  • Global reach. Anyone with a wallet and an internet connection can connect and trade.

Risks and trade-offs

  • Smart contract risk. Bugs or exploits in the code can lead to loss of funds. Even audited contracts can have edge cases.
  • Market and liquidity risk. Thin pools can mean high slippage. DEX volumes are often lower than on centralized exchanges, which can affect pricing for large orders.
  • Impermanent loss for LPs. Providing liquidity to a volatile pair can leave LPs with fewer high-value tokens relative to holding.
  • Frontrunning and MEV. Public mempools allow bots to reorder or sandwich transactions around your swap.
  • Unvetted tokens and scams. Open listings increase the chance of low-quality or malicious projects, including rug pulls where liquidity is drained.
  • User experience gaps. Interfaces can be technical, and mistakes like sending to the wrong address are hard to reverse.

Getting started

To use a DEX, you connect a compatible crypto wallet to the app’s website, pick the token pair, and approve the swap. You also need the network’s native token for gas, such as ETH for many Ethereum-based DEXs. Always check the pool you are using, the quoted price, and the expected gas before you confirm.

DEXs versus centralized exchanges

Centralized exchanges match orders and custody assets. DEXs rely on smart contracts and usually AMMs, with users retaining custody at all times. Centralized platforms tend to vet listings and can offer advanced order types and fiat rails. DEXs favor permissionless access and composability but shift more responsibility to the user.