← All articles

Decentralized Exchange: How a DEX Works and Its Risks

Crypto Industry

John Bax and Crypto Go Team · Published · 12 min read

A decentralized exchange (DEX) is a marketplace where people swap one crypto asset for another straight from their own wallet, using a smart contract (a program that runs by itself on a blockchain) instead of a company that holds the money. The price of that freedom is responsibility: there is usually no support desk to reverse a mistake, and every approval you sign is yours. Neither type of exchange is "better" in every case; they trade convenience against control in different ways.

In brief

  • A DEX lets you trade tokens from your own wallet through a smart contract, so you do not deposit your funds with a company first.
  • Most DEXs price trades with a pool of tokens and a formula rather than an order book, so the size of your trade changes the price you get.
  • A centralized exchange (CEX) is a company that holds your assets and matches orders, which is easier to use but means trusting that company.
  • The main risks on a DEX are fake tokens, bugs in smart contracts, risky approvals, high price impact and the lack of anyone to call when something goes wrong.
  • "Decentralized" is a spectrum: supervisors say many DeFi services are less decentralized than advertised, so it pays to ask who can change the rules.
Decentralized Exchange: How a DEX Works and Its Risks
In this article · 12 min read
  1. Decentralized exchange: what it is, in one sentence
  2. How a decentralized exchange works
  3. A swap on a DEX, step by step
  4. Decentralized exchange or centralized exchange: the differences
  5. How much trading happens on DEXs
  6. The risks of a decentralized exchange
  7. Advantages and limits
  8. Where a DEX fits in a crypto plan
  9. How to start safely, step by step
  10. Who it is for
  11. Key terms
  12. Frequently asked questions
  13. Sources

Decentralized exchange: what it is, in one sentence

A DEX is a trading venue made of smart contracts on a blockchain, where users swap tokens from their own wallet without handing custody to an intermediary. ethereum.org puts it simply: DEXs let you trade different tokens whenever you want, and you never give up control of your assets, while on a centralized exchange you have to deposit your assets before the trade and trust the platform to look after them. The Congressional Research Service (CRS), in its overview of decentralized finance of 16 March 2026, adds a note of caution: DEXs "purport to allow users to self-custody" their assets, which is the promise, not a guarantee of safety.

A few words you will meet again below. A wallet is the app or device that holds the keys to your crypto. A smart contract is code that executes the rules of the trade on its own. Decentralized finance (DeFi) is the family of services, such as lending and trading, built from such contracts. A liquidity pool is a stock of two tokens that traders swap against.

Decentralized exchange (DEX) vs centralized exchange (CEX): who holds the funds and who runs the trade
Comparison of a decentralized exchange and a centralized exchange: where the funds are held, who runs the trade, what support exists

How a decentralized exchange works

On a traditional exchange, and on a centralized crypto exchange, trades are matched in an order book: a list of what people are willing to buy and sell, at which prices. Most DEXs work differently. According to the CRS, they use automated market makers (AMMs), smart contracts that manage the trading pair and whose algorithm sets the relative price of the two assets. Liquidity providers deposit both tokens into a pool, and traders swap against that pool. As one token becomes scarcer, the CRS explains, a user must deposit greater amounts of the other. Not every DEX is built this way, since some mirror traditional exchanges with order books, but the pool model is the one most beginners meet.

In the best-known design, Uniswap's documentation describes a swap as selling the tokens you hold for a proportional amount of the token you want, minus a swap fee that goes to the liquidity providers. The rule behind the price in its second version is the "constant product" rule: the pool must keep the product of the two token quantities the same after fees. You do not need the mathematics. You need the consequence: the more you buy relative to the size of the pool, the worse the average price becomes.

The Bank for International Settlements (BIS), in its working paper "The Technology of Decentralized Finance (DeFi)" of 19 January 2023, lists decentralized exchanges among the most relevant DeFi categories, next to lending protocols, derivatives protocols and aggregators.

A swap on a DEX, step by step

  1. Connect your wallet to the exchange's website. Most users reach a DEX through a web interface that adds routing, warnings and default safety settings on top of the contract, as Uniswap's documentation notes.
  2. Choose the two tokens: the one you hold and the one you want. Check that the second is the real token, not a copy with the same name.
  3. Read the numbers before you confirm: the price impact, the swap fee, the network fee (the "gas" paid to the blockchain) and the minimum amount you will accept.
  4. Approve and sign. The first time you use a token, you usually approve the contract to spend it, then sign the swap itself. These are two separate permissions.
  5. Wait for confirmation. The trade is recorded on the blockchain and the new tokens appear in your wallet.

Decentralized exchange: the steps of a swap, from connecting the wallet to signing
The steps of a swap on a decentralized exchange: connect, choose, check, sign

Price impact is how much your own trade moves the price in the pool, and slippage is the difference between the price you expected and the one you obtained. Uniswap's documentation says the greater the liquidity available at a given price, the lower the price impact for a given swap size, and that the interface shows an estimate before you confirm. In our experience, this is the number newcomers skip, and it is the one that costs them the most on thin pools.

Decentralized exchange or centralized exchange: the differences

Decentralized exchange (DEX)Centralized exchange (CEX)
Who holds your assetsYou, in your own walletThe company, in your account
How you get inA wallet and a connectionUsually an account and identity checks
How trades are pricedMostly by pool formulasMostly by an order book
Typical costsSwap fee, plus a network feeA trading fee set by the company
If you make a mistakeUsually irreversibleSupport may help, but not always
What you trustThe code and the interface you useThe company and its security
Main riskFake tokens, contract bugs, bad approvalsHacks, failure or freezing of the platform

Either type can fail, which is why John Bax says there is no such thing as a completely safe exchange. In Cryptocurrency Investing he points out that even very large exchanges can fail, as large banks can. On a DEX you remove one risk (a company holding your coins) and take on others (code, tokens and your own signatures).

How much trading happens on DEXs

DEXs are not a niche. According to DefiLlama, which tracks trading volume across decentralized exchanges, they processed about 203 billion US dollars in April 2026, 204 billion in May, 231 billion in June, 209 billion in July, 241 billion in August and 318 billion in September. The CRS reported that the total value locked in all DeFi protocols was about 98 billion dollars as of March 2026, and that Uniswap was the largest DEX by volume.

Decentralized exchange: monthly trading volume on DEXs from April to September 2026
Bar chart of monthly DEX trading volume from April to September 2026, from about 203 billion dollars to 318 billion

Treat such figures as an order of magnitude. Trackers count volume in different ways, automated trading can inflate it, and volume says nothing about whether a given token is safe or liquid.

The risks of a decentralized exchange

  • Fake and copied tokens. Anyone can create a token and give it a famous name. Scammers use this on DEXs because there is usually no one reviewing what gets listed. Our guide to crypto scams shows the usual tricks, including "rug pulls", where creators drain a pool and disappear.
  • Smart contract bugs. Code can contain errors, and an exploited contract can lose user funds. Audits help, but they are not a guarantee.
  • Risky approvals. When you approve a contract to spend your tokens, you give it a permission. A fraudulent site can ask for one that drains your wallet.
  • High price impact. In a pool with little liquidity, a medium trade can move the price a lot, and you start the trade at a loss.
  • No safety net. A confirmed transaction usually cannot be reversed and there is no account to recover.
  • Less decentralized than it looks. The Financial Stability Board (FSB), in its report of 16 February 2023, notes that DeFi inherits and may amplify the vulnerabilities of traditional finance, and describes it as only "seemingly" disintermediating its services and decentralising their governance. A DEX may still depend on a team that controls its website, its upgrades or most of its governance tokens.

Risks are not only for those who swap. Liquidity providers, who deposit tokens into pools to earn fees, take on additional ones, such as losing value compared with simply holding the tokens. A discussion paper from the market authority AMF of 19 June 2023 lists, among the risks of DeFi, liquidity, valuation, price manipulation, slippage and leverage, and a DEX can offer leveraged products too. Leverage multiplies losses as well as gains.

John Bax's view

In Cryptocurrency Investing, John Bax notes that the industry treats "permissionless" and "decentralized" as the same thing, but they are not. The smart contracts of a DEX may be impossible to censor, yet ordinary users reach them through websites and domains run by private companies, and those can be taken down. That is why he prefers to call DEXs and DApps permissionless rather than decentralized. He also gives a practical rule of thumb for swaps: check the price impact before confirming, treat under 3% as good and under 1% as ideal, and above 3% look for a more liquid DEX or a reliable centralized exchange, reduce the size, or split the order. And he calls the moment you first sign the approval for a platform "delicate": use only platforms you know and have studied, double-check what you authorize, and "if you see any danger, don't sign".

Advantages and limits

Advantages. You keep custody of your funds while trading. Markets are open at any hour, in ethereum.org's words, and you can often trade tokens that centralized exchanges do not list. You do not need to deposit anything with a company first.

Limits. You carry the responsibility: the wallet, the approvals, the token check. The interfaces can be harder for beginners, fees vary with network demand, and when something goes wrong the options are few. A centralized exchange is often the easier place to start, especially for a first purchase; our guide to buying cryptocurrency safely covers that route.

Where a DEX fits in a crypto plan

Many people use both kinds of exchange: a centralized one to move from regular money into crypto, and a DEX for tokens a centralized one does not offer, with a small part of their funds. Whatever you choose, keep what you do not plan to trade out of any exchange account or hot wallet. A hardware wallet keeps your keys offline, and your seed phrase must never be typed into a website.

Crypto Go Bot is different from a DEX on purpose: it trades your own account on Kraken, a centralized exchange, so your funds stay in your Kraken account, the bot cannot withdraw them, and take profit and stop loss are real orders on Kraken. You can read more on the Crypto Go Bot page or in our overview of how a crypto trading bot works. Trading carries risk and the bot also closes trades at a loss.

How do LIQUIDITY POOLS work? (Uniswap, Curve, Balancer) (in English)

How to start safely, step by step

  1. Set up a wallet and write down the seed phrase offline, never in a photo or a chat.
  2. Start with an amount you can afford to lose, as a test.
  3. Open the DEX from a saved bookmark rather than from an advert or a link in a message.
  4. Check the token's contract address in an official source before swapping. Over our years of trading and investing, this one habit has avoided more trouble than any price chart.
  5. Check the price impact and the minimum amount received.
  6. Read what you sign. If a request asks for more than the swap needs, stop.
  7. Review your approvals from time to time and remove the ones you no longer use.

Checklist before your first swap

  • I know whether the exchange is a DEX or a CEX and who can change its rules.
  • I checked the token's contract address.
  • The price impact is low enough for me.
  • I understand every permission I sign.
  • The amount is one I can afford to lose.

Who it is for

A DEX suits those who want to hold their own keys and accept that this brings both control and duties.

  • Curious beginner with a small test amount: can learn how a wallet, a swap and a network fee work with a small trial, as long as the first purchase of crypto is done on a platform with support.
  • Holder who values self-custody: can swap between tokens without sending them to a company, provided they protect the seed phrase and the wallet carefully.
  • Trader interested in tokens not on large platforms: gets access to a wider choice, as long as they accept thin liquidity, fake tokens and higher price impact.
  • Reader who prefers a simple route: may find that a centralized exchange fits better for now, and can move to a DEX later, once the basics feel comfortable.

Key terms

  • DEX: a decentralized exchange, where smart contracts let users swap tokens from their own wallet.
  • CEX: a centralized exchange, a company that holds users' assets and matches orders.
  • Automated market maker (AMM): a smart contract that prices trades from the balance of two tokens in a pool.
  • Liquidity pool: tokens deposited by liquidity providers that traders swap against.
  • Price impact: how much your own trade moves the price in the pool.
  • Slippage: the gap between the expected price and the price actually obtained.

Frequently asked questions

What is a decentralized exchange?

It is a trading venue run by smart contracts on a blockchain. You swap tokens from your own wallet instead of depositing them with a company.

Is a DEX safer than a centralized exchange?

Not automatically. A DEX removes the risk of a company holding your coins, but adds risks such as fake tokens, contract bugs and risky approvals. Neither type is completely safe.

What is a liquidity pool?

It is a stock of two tokens deposited by users, called liquidity providers. Traders swap against it, and the providers earn a share of the fees, while taking on risks of their own.

What is price impact on a DEX?

It is how much your trade moves the price in the pool. It grows with the size of the trade and shrinks when the pool is larger, so check it before you confirm.

Can I get my money back after a wrong swap?

Usually not. Confirmed transactions on a blockchain cannot normally be reversed, so double-check the token, the amount and the permissions before you sign.

Does Crypto Go Bot use a DEX?

No. It trades your own Kraken account, a centralized exchange, and your funds stay there. Trading carries risk and results are never guaranteed.

Sources