Decentralized Exchange (DEX)
A decentralized exchange (DEX) is a platform that lets people trade crypto tokens directly from their own wallets. It uses smart contracts on a blockchain instead of a company that holds customer funds.
A user does not deposit funds with an operator. Instead, they connect a self-custody wallet and sign each trade. Smart contracts carry out the swap and settle it on-chain, so the user keeps control of their private keys and assets throughout. Most DEXs use an automated market maker (AMM). Traders swap against liquidity pools funded by liquidity providers, and a formula based on each pool's balances sets the price. Some DEXs use on-chain or hybrid order books instead.
This matters because a DEX can be used at any hour without opening an account, and every trade is publicly recorded on the blockchain. Many DEX protocols do not require KYC checks, though the websites that front them may restrict access. For example, someone on Ethereum might swap ETH for an ERC-20 stablecoin. They approve the trade in their wallet, pay a gas fee to the network, and receive the new tokens in the same wallet once the transaction confirms.
Keeping custody also means carrying the risk. Attackers can exploit bugs in smart contracts. Anyone can usually list a token, so scam tokens and rug pulls are common. Mistaken or malicious transactions generally cannot be reversed. Traders can also lose value to slippage in pools with little liquidity, and to front-running tactics such as sandwich attacks. A common misconception is that "decentralized" means "safe." A DEX removes the risk of an exchange mishandling customer funds, but not the risk of the user's own mistakes.