<p>A <strong>decentralized exchange (DEX)</strong> is a peer‑to‑peer platform that allows users to trade cryptocurrencies directly from their wallets without relying on a central authority or intermediary. Built on blockchain technology, a DEX executes trades through self‑executing smart contracts, enabling trustless transactions while users retain custody of their assets.</p>

<h2>How It Works</h2>
<p>When a user connects a digital wallet to a DEX, the platform’s smart contract interacts with the wallet to read token balances and authorize swaps. Most modern DEXes use an automated market maker (AMM) model: liquidity providers deposit pairs of tokens into a liquidity pool, and the AMM algorithm determines prices based on the ratio of assets in the pool. A trade occurs when the contract updates the pool’s balances, instantly reflecting the new price. Some DEXes also support traditional order‑book designs, where buy and sell orders are matched on‑chain. Throughout the process, the user’s private keys remain in their wallet; the DEX never holds funds, reducing custodial risk.</p>
<ul>
<li>Wallet connection – user signs a transaction to approve token spend.</li>
<li>Swap execution – smart contract calculates output amount using pool reserves or order book.</li>
<li>Liquidity provision – users earn fees by supplying tokens to pools.</li>
<li>Settlement – trade is recorded on the blockchain, final and immutable.</li>
</ul>

<h2>Why It Matters</h2>
<p>DEXes promote financial inclusion by removing gatekeepers; anyone with an internet connection and a wallet can trade, irrespective of geography or identity. They enhance security because funds stay under user control, mitigating exchange‑level hacks. Censorship resistance ensures trades cannot be blocked by a single entity, supporting the ethos of open finance. For example, Uniswap, a leading AMM‑based DEX, facilitated over $1 billion in daily volume in 2023, enabling users to swap newly launched tokens instantly without needing a listing on a centralized exchange. This accessibility accelerates innovation in the broader decentralized finance (<a href="/NewSite/encyclopedia/defi/" class="ency-link">DeFi</a>) ecosystem.</p>