You already know how a centralized exchange works, even if you have never thought about it. You open an account, send funds, and a company takes it from there.
It holds your deposit, matches your order against someone else's, and keeps the official record of who owns what. Every time you click buy, you trust that company's systems with all three jobs.
If you have searched for what is a DEX, the short version is this: a decentralized exchange hands those jobs to code.
This guide covers the two basic designs, the liquidity pool and the on-chain order book, explains who supplies the liquidity, and separates what "decentralized" guarantees from what it does not. It stays with mechanics. No venue rankings. No tokens. No market numbers.
Key Takeaways
- A DEX, or decentralized exchange, replaces the company in the middle with code on a blockchain that holds funds, matches trades and keeps the record.
- An AMM prices your trade against a shared liquidity pool with a formula; an on-chain order book matches your order against other traders' orders.
- Decentralized means public rules and wallet signatures, not zero risk: contract bugs, lost keys and price impact stay with you.
- Hyperliquid is an example of the order-book build: its documentation describes on-chain order books that match orders in price-time priority.
The Short Answer: What Is a DEX?
A DEX, short for decentralized exchange, is a trading venue where the core jobs of an exchange run as code on a blockchain instead of inside a company.
In the usual design, you connect a wallet instead of opening an account, your own signature authorizes each action, and the record of every trade lives on a public ledger anyone can read.
On a centralized exchange, often called a CEX, the same jobs sit with one operator. It holds the deposits, runs the matching engine and keeps the books in its own systems. On a DEX, the operator becomes public code.
That shift decides very practical things: who can move your funds, who can stop a trade, and whether you can check what happened afterward.
DEX vs. Centralized Exchange: What Actually Changes
The cleanest way to compare the two is job by job, starting with custody. On a centralized exchange, your deposit becomes a balance in the company's internal ledger, and a withdrawal works only when the company processes it. On a DEX, your wallet signs each action, so in the usual design no company signs for you.
Who holds the keys, and what each setup asks you to rely on, deserves its own read: our guide to custodial vs non-custodial setups covers the whole spectrum.
Matching is the second job. A centralized exchange runs its matching engine on its own servers, and you see only the result. A DEX runs that logic in public code. The rule that filled your order can be read, and the fill itself can be checked on the chain.
Access is the third. A centralized exchange decides who may open an account, and it can freeze one. A DEX usually asks only for a wallet that can sign.
That does not mean nobody can ever restrict anything. A website often sits in front of the contracts, and a contract can include admin controls. It means a restriction, if there is one, sits in code you can inspect rather than in a policy you cannot.
| Job | Centralized exchange | DEX |
|---|---|---|
| Holding your funds | The company, in its own ledger | Code, acting on your wallet's signature |
| Matching orders | A private engine | Public code on a blockchain |
| Keeping the record | The company's internal books | A public ledger anyone can read |
| Granting access | An account the company approves | A wallet that can sign |
Two Ways to Build a DEX
Every exchange has to answer the same question for every trade: who is on the other side, and at what price. A DEX can answer it in two basic ways, and the answer shapes how your order fills.
Other designs exist, such as venues that take their price from an external feed. Our guide to the central limit order book compares all three models side by side.
The Liquidity Pool (AMM)
An automated market maker, or AMM, does away with the other trader. Instead, a pool of two assets sits in a smart contract, and a formula sets the price from the ratio between them. You do not wait for someone to take the other side of your trade. You trade against the pool itself, and the pool is always there.
Every trade changes the ratio, and with it the price for the next trade. Buy an asset out of the pool, and it gets scarcer there, so the formula quotes it higher. Your size moves the price.
A small trade against a deep pool barely shifts it. A large trade against a shallow pool shifts it a lot. That gap between the quote and your average fill is closely related to slippage, which has its own guide.
The trade-off is plain. A pool can quote you a price at any moment, even in a quiet market. In the basic design, it does not let you rest an order at a price of your choosing. You take whatever the formula says when your transaction executes. Because each trade moves the price for the next one, the order in which waiting trades run is worth money, as our guide to what MEV is explains.
The On-Chain Order Book
The second build keeps the model you know from a centralized exchange: a book of bids and asks. Buyers post the price they will pay, sellers post the price they will accept, and the book matches them.
What changes is where the book lives. On an on-chain order book, the orders and the matching are part of the blockchain's state instead of a private process.
Hyperliquid is an example of this build, and its documentation describes it directly. It keeps an order book for each asset, that order book works similarly to that of centralized exchanges, and orders are matched in price-time priority.
Price-time priority means the best price fills first, and at the same price, the earlier order fills first. The same documentation says that every order, cancel, trade and liquidation happens transparently.
On a book, you can rest a limit order at your own price and wait. What you trade against is the depth other traders have posted, so a thin book moves against a large order much as a shallow pool does. For how the venue behaves at the order panel, read what Hyperliquid is in our guide to the venue.
Who Provides the Liquidity?
A market is only as good as the size waiting on the other side. On a DEX, that size comes from participants, not from the exchange itself, and who they are depends on the build.
On an AMM, liquidity providers deposit pairs of assets into the pool. In the usual design, they receive a share of the trading fees the pool charges, in proportion to what they supplied.
Anyone with the assets and a wallet can usually join. That openness is what lets a pool exist without a dedicated market maker behind it.
On an order book, liquidity comes from traders who rest limit orders. A market maker who keeps quoting both sides earns the spread between bid and ask when both sides get filled. Those quotes are your depth. When market makers pull back, the book thins, and your fills get worse.
Supplying liquidity carries its own risk on either build. A pool provider holds whatever mix the formula leaves behind.
When prices move sharply, traders buy the rising asset out of the pool and leave the falling one, so the provider can end up worse off than if they had simply held both assets. That effect is usually called impermanent loss.
A market maker on a book faces a related problem: their resting orders get filled exactly when the price runs through them.
What "Decentralized" Means, and What It Does Not
Decentralized describes where the rules run. It is not a promise about outcomes, so it pays to be exact about both sides.
Here is what it does mean. The rules are code that anyone can read, your wallet's signature authorizes your actions, and the record of trades sits on a public ledger rather than in one company's database.
In the usual design, no single company can quietly change a fill after the fact. You verify instead of trusting. That is the real gain, and it is narrower than it sounds.
First, decentralized does not mean bug-free. Code that holds funds can contain mistakes, and anyone who finds a mistake can try to exploit it.
An audit reduces that risk without removing it. Our explainer on smart contract audits covers what an audit checks and what it does not prove.
It does not mean operator-free, either. A website or app usually sits in front of the contracts, and a team often maintains both. Some contracts keep upgrade or admin keys. Finding out who controls those keys is part of reading a venue.
It does not mean anonymous. Every trade is tied to a wallet address, and that address, along with its history, is public for anyone to read.
And it does not mean safe. A DEX swaps the risk of relying on a company for the risks of code, keys and prices. Whether that swap suits you depends on which of those risks you would rather carry.
What You Carry Yourself
On a centralized exchange, the company carries much of the plumbing for you, along with the power that comes with it. On a DEX, more of that weight lands on you. Here is the list:
- Your keys. Lose your seed phrase, and no support desk can restore access. Hyperliquid's own setup guide puts the other side plainly: anyone with access to your private key or seed phrase can access your funds.
- Network fees. Settling on a blockchain usually costs a fee paid to the network, called gas. Our guide to gas fees explains how that fee is calculated.
- Price impact and fill quality. On a pool, your own size moves the price. On a book, your fill depends on the depth others have posted. Check the expected price before you sign.
- Contract risk. Funds in a contract are only as safe as its code and whoever can upgrade it.
- Price feeds, where used. A design that relies on an external price feed inherits how that feed is built and how often it updates.
- Your own checks. A DEX lets you verify a trade. Nobody does it for you.
From Spot DEXs to Perp DEXs
Everything above applies to swapping one asset for another, which is spot trading. A perp DEX uses the same building blocks to trade perpetual futures, which add margin, funding and liquidation on top. Perp is not spot, and our comparison of perps vs. spot shows what the contract adds.
Where CarrotFunding Fits
CarrotFunding runs its own trading platform, with Hyperliquid as the native execution venue. Prices and fills on your account follow Hyperliquid's fully on-chain central limit order book. Your account itself is simulated. The venue details, from leverage limits to trading hours, are on our Hyperliquid venue documentation page.
Conclusion
A DEX does not remove the work an exchange does. It moves that work into public code and hands part of it back to you. Choosing between a pool and a book is not choosing between good and bad design. It is choosing who sits on the other side of your trade and how your size moves your price. Before you trade on any DEX, settle three things: which build prices your order, who can change the contracts, and whether you are ready to keep your own keys. If those answers are clear, decentralized gives you something a company's word cannot: a trade you can check yourself.
FAQ
Is a DEX the same as a wallet?
No. A wallet holds the keys that control your assets and signs your transactions. A DEX is the venue where those signed transactions become trades. You connect your wallet to the DEX, and the DEX asks it to sign each action. It should never ask for your seed phrase, and a site that does is not behaving like an exchange.
Do I need a crypto wallet to use a DEX?
Usually, because your wallet is what signs your trades and holds your keys. Some venues add other ways in. Hyperliquid's documentation, for example, says you can trade there with a normal DeFi wallet or by logging in with your email address. Either way, find out who controls the keys behind your login before you deposit.
Is a DEX safer than a centralized exchange?
Not automatically. A DEX removes the risk of a company mishandling or freezing your funds, and replaces it with contract bugs, admin keys, lost seed phrases and price feeds. Which set of risks is smaller for you depends on the venue's design and on how carefully you handle your own keys.
Can anyone list a token on a DEX?
On a permissionless pool design, anyone can create a pool for a pair by depositing both assets. That is why a listing on a DEX is no evidence of quality or legitimacy. Before you trade an asset there, check its contract address against a source you trust, not just its name or ticker.
What happens if a DEX's website goes down?
The website is only a front end. The code behind it keeps running on the blockchain as long as the chain does. In principle, you can still reach it through another interface or by calling the contracts directly. In practice, that takes more skill, so it helps to know before you deposit whether another way in exists.