Exchanges: CEX vs DEX
How centralized and decentralized crypto exchanges work, who holds your funds, and the main trade-offs between the two models.
A crypto exchange is a place where people swap one asset for another: bitcoin for dollars, ether for a stablecoin, one token for a different token. There are two broad families of exchanges. A CEX (centralized exchange) is run by a company. A DEX (decentralized exchange) is a set of smart contracts on a blockchain that anyone can use directly from a wallet. Both let you trade, but they work very differently under the hood.
What is a centralized exchange (CEX)
A centralized exchange looks and feels like an online brokerage. You create an account, usually pass identity checks, deposit money or crypto, and trade through a website or app. The company keeps an internal ledger of who owns what.
How trading works on a CEX
Most centralized exchanges use an order book. Buyers post bids, sellers post asks, and the exchange's matching engine pairs them. Because matching happens on the company's servers rather than on a blockchain, trades are fast and do not require a network fee for each order. Only deposits and withdrawals touch the blockchain.
Custody on a CEX
When your coins sit on a centralized exchange, the exchange holds the private keys. You have a claim on the company, not direct control of the coins. This is often summarized as "not your keys, not your coins". If the exchange is hacked, freezes withdrawals, or goes bankrupt, users can lose access to their funds. History has several examples of exchanges that failed in exactly this way.
Typical strengths of a CEX
- Familiar interface and customer support
- Ways to deposit and withdraw regular currency through banks or cards
- Fast order matching and usually deep liquidity on popular pairs
- Account recovery if you forget a password
Typical weaknesses of a CEX
- You trust a company with your assets
- Identity verification and the possibility of account restrictions
- The exchange decides which assets are listed and can delist them
What is a decentralized exchange (DEX)
A decentralized exchange has no company account to open. You connect a self-custody wallet and interact with smart contracts. Trades settle on the blockchain, and the tokens go straight back to your wallet.
How trading works on a DEX
Many DEXs use an automated market maker (AMM) instead of an order book. Users called liquidity providers deposit pairs of tokens into a pool. When you trade, you swap against that pool, and a formula sets the price based on how much of each token is inside. Bigger trades move the price more, an effect called price impact or slippage. Some DEXs also use on-chain order books or combine several pools to find a better route.
Custody on a DEX
You keep your own keys the whole time. The DEX never holds your funds between trades. That removes the risk of an exchange freezing your account, but shifts responsibility onto you. If you lose your seed phrase or sign a malicious transaction, nobody can reverse it.
Typical strengths of a DEX
- Self-custody: funds stay in your wallet
- No account registration on the protocol itself
- Access to new tokens as soon as someone creates a pool
- Transparent: trades and pool balances are visible on the blockchain
Typical weaknesses of a DEX
- Every trade is a blockchain transaction and costs a network fee
- Smart contracts can contain bugs that attackers exploit
- Anyone can create a token and a pool, so fake or worthless tokens are common
- No support desk to undo mistakes
- Converting to regular currency usually still requires a centralized service
Key differences at a glance
- Who holds the keys: the exchange on a CEX, you on a DEX
- Matching: order book on company servers versus smart contracts on a blockchain
- Fees: trading fees set by the company versus pool fees plus network gas
- Access: registration and verification versus a wallet connection
- Failure risks: company insolvency or hacks versus contract bugs and user error
Common risks on both
Neither model is risk-free. Phishing sites imitate both popular exchanges and popular DEX interfaces. Always check the address you are visiting and the token contract you are trading. On a DEX, be careful with token approvals: granting a contract unlimited permission to spend a token can be abused if that contract is malicious or later compromised. On a CEX, enable two-factor authentication and be wary of anyone asking for login codes.
Which one is used for what
In practice, many people use both. Centralized exchanges are a common entry point for converting regular money into crypto. Decentralized exchanges are popular among users who already hold crypto in a self-custody wallet and want to swap tokens without handing them to a third party. Understanding where your keys are at any moment is the single most important thing to know about either type.