A DEX is a decentralized exchange where users trade directly from their own wallets via smart contracts, without a centralized custodian.
DEXs come in two main models:
AMMs (Automated Market Makers): trades happen against liquidity pools (“peer-to-contract”), with prices set by formulas; anyone can supply liquidity.
Order-book DEXs: users place buy/sell orders (“peer-to-peer”), matched on-chain or by decentralized matchers.
What all DEXs share: self-custody, transparent on-chain settlement, and typically permissionless access.