Skip to content
Solana Journal
DeFi

What Is a Decentralized Exchange?

Decentralized exchanges let you trade crypto directly from your own wallet, without handing your funds to a company. Here is how they work, the main designs, what you pay, and the risks to understand first.

Published
Published
Reading time
5 min read

A decentralized exchange, or DEX, is a marketplace for crypto assets that runs on a blockchain rather than inside a company. Instead of depositing money with an exchange operator, you trade directly from a wallet you control, and the rules of the market are enforced by code that anyone can inspect.

This guide explains how a decentralized exchange works, how it differs from the exchanges most people start with, and what you should understand before using one.

Centralised vs decentralized exchanges

Most people buy their first crypto on a centralised exchange (CEX): a company that holds customers' funds, keeps an internal record of who owns what, and matches buyers with sellers on its own servers. You trust that company to safeguard your assets, process withdrawals and follow the law.

A decentralized exchange removes that custodian:

Centralised exchange

Decentralized exchange

Who holds your funds

The exchange

You, in your own wallet

Account required

Yes, usually with identity checks

No; you connect a wallet

Where trades settle

The exchange's internal database

On the blockchain

Listing decisions

Made by the company

Usually anyone can create a market

Recourse if things go wrong

Customer support, regulators

Very limited; transactions are final

Neither model is automatically better. A DEX gives you control and transparency; a well-regulated CEX offers support, fiat on-ramps and some consumer protections. Many people use both.

How a DEX works: the two main designs

Automated market makers (AMMs)

Most decentralized exchanges are automated market makers. Instead of matching individual buyers and sellers, an AMM holds a liquidity pool: a reserve of two (or more) tokens supplied by users called liquidity providers. When you trade, you swap against the pool, and a formula sets the price.

The classic formula, popularised by Uniswap on Ethereum, is the constant product rule: the pool keeps the product of its two token reserves constant. When you buy one token from the pool, its reserve shrinks and its price rises. Larger trades move the price more, which is called price impact.

Liquidity providers earn a share of the trading fees in return for supplying tokens. We explain the mechanics, including the risk known as impermanent loss, in Understanding Liquidity Pools.

On Solana, AMM-style venues include Raydium, Orca and Meteora, each with its own pool designs.

On-chain order books

Some DEXs keep a traditional order book: a list of buy and sell orders at different prices, matched by a program on the blockchain. This is how most professional trading venues work, and it suits markets with active market makers. Order books need fast, cheap transactions to be practical on-chain, which is one reason they exist on Solana (for example, Phoenix) more than on slower networks.

Aggregators: shopping around for you

Because liquidity for the same token pair can be spread across many venues, aggregators search them all and route your trade through the best combination of pools, sometimes splitting it across several. On Solana, the best-known aggregator is Jupiter; see What Is Jupiter Exchange?.

What happens when you trade on a DEX

  1. You connect a wallet. The site can now see your public address and balances, and can ask you to sign transactions. It cannot move funds without your signature.

  2. You request a quote. The interface calculates how many tokens you should receive, based on current pool prices.

  3. You set a slippage tolerance. Prices can move between quoting and execution. Slippage tolerance is the maximum worse price you will accept; if the market moves further, the trade fails instead of filling at a bad price.

  4. You sign and submit the transaction. Your wallet shows what will happen; you approve it.

  5. The blockchain settles it. If successful, the new tokens arrive in your wallet within seconds.

For a step-by-step look at Solana specifically, read How Solana Token Swaps Work.

What does it cost?

Expect to pay some combination of:

  • Network fees, paid to the blockchain's validators. On Solana these are usually tiny, though optional priority fees can rise when the network is busy.

  • Liquidity provider fees, a percentage of each trade that goes to the pool's liquidity providers, typically built into the quote.

  • Interface or platform fees, which some front ends or wallets add on top.

  • Price impact and slippage, which are not fees as such but can cost more than all of the above on large trades or in thin markets.

Always look at the final amount you will receive, not just the headline fee.

The risks

Trading without a middleman also means nobody is there to catch your mistakes.

  • Fake and malicious tokens. Anyone can create a token with any name or symbol, including copies of well-known assets. Always verify a token's contract (mint) address from an official source. Our guide How to Analyse a Solana Token Before Investing covers the checks.

  • Phishing sites. Scammers copy popular DEX interfaces and buy search adverts to lure users into signing malicious transactions. Bookmark official sites and type addresses carefully.

  • Smart-contract risk. Bugs or exploits in a protocol's code can lead to losses, even in established projects.

  • MEV and sandwich attacks. Some actors watch for pending trades and try to profit by trading just before and after them. Sensible slippage settings and protected transaction routing reduce, but do not eliminate, this risk.

  • Irreversibility. A blockchain transaction cannot be undone. Sending to the wrong address or approving a malicious transaction is usually permanent.

  • Regulation. The legal treatment of DEXs and the tokens traded on them varies by country and is still developing.

Who should use a DEX?

A DEX makes sense if you want to keep custody of your assets, trade tokens not listed on centralised exchanges, or use other on-chain applications. It is less suitable if you are uncomfortable managing your own wallet security or if you need customer support. A sensible approach is to start with small amounts, learn how your wallet presents transactions, and build up from there.

Conclusion

A decentralized exchange replaces the company in the middle with transparent, on-chain code. Automated market makers trade against pools of liquidity; order-book DEXs match orders on-chain; aggregators search across both. The benefits are self-custody, openness and transparency. The costs are personal responsibility and a different set of risks. Understanding both is the first step to using DEXs safely.

Sources and further reading

Educational content, not financial advice. This article explains how things work; it is not a recommendation to buy, sell or hold any asset. Crypto assets are volatile and high-risk, smart contracts can fail, and you can lose all of the money you put in. Do your own research, check official sources, and never share your seed phrase. See our full disclaimer.

Keep reading

More in DeFi
DeFi

What Is Jupiter Exchange?

An independent explainer on Jupiter, the Solana swap aggregator: what it does, how routing works, its limit and DCA order tools, what you pay, and how to avoid the imitation sites that target its users.

Solana Journal Editorial Team5 min read

DeFi

Understanding Liquidity Pools

Liquidity pools are the engine behind most decentralized exchanges. Learn how they price trades, what liquidity providers earn, how impermanent loss works with worked examples, and how concentrated liquidity changes the picture.

Solana Journal Editorial Team5 min read

Guides

How to Track and Manage a Cryptocurrency Portfolio

A practical system for tracking crypto across wallets and exchanges, keeping records you can rely on at tax time, sizing positions sensibly and protecting your holdings, without handing anyone your keys.

Solana Journal Editorial Team4 min read

Newsletter

The Solana Journal briefing

A considered email with the most useful explainers, what changed in the ecosystem, and what it means. No hype, no spam, unsubscribe any time.

Free, no spam, and you can unsubscribe in one click. See our privacy policy.