A centralized exchange (CEX) is a company: you deposit your funds, it holds them and matches buyers and sellers in an order book. Benefits: liquidity, many order types, conversion to euros. Main risk: counterparty (bankruptcy, frozen withdrawals, hacking).
A decentralized exchange (DEX) is a program on a blockchain (a smart contract). You swap directly from your wallet, without depositing. Most use an AMM: a pool of two tokens whose price follows the rule x × y = k.
On an AMM, the larger your order relative to the pool, the more the price moves against you: that is price impact. Example: pool of 100 ETH and 300,000 USDC (price 3,000). Buying 10 ETH costs about 33,333 USDC, an average price of 3,333: +11%.
On a DEX, the risks change: contract bugs, fake tokens (check the address), network fees, slippage, and no support if you make a mistake. Pro rule: regulated CEX to get in and out in euros, withdraw to your wallet to hold, DEX only when you know what you are doing.
Examples
ETH-X on a CEX (fictional market) : Here is a fictional CEX order book. To buy 3 ETH-X, you take 1.2 at 3,001 then 1.8 at 3,002: average price ≈ 3,001.6. On a small AMM pool, the same purchase could have cost several percent more.
November 2022: the FTX collapse : In early November 2022, the centralized exchange FTX halted withdrawals, then filed for bankruptcy on 11 November 2022. Customers who left their crypto there were stuck. DEXs kept working. Lesson: a CEX is handy for trading, but funds you do not use should be withdrawn to a wallet you control.
Key terms
CEX
Exchange run by a company that holds your funds
DEX
Exchange run by a smart contract, from your own wallet
AMM
Automated market maker: a token pool that sets the price by formula
Slippage
Gap between the expected price and the price actually obtained