What is a DEX? In plain words

By Cleave Protocol

A DEX is a market run by a program, not a company. How a swap works from your own wallet, where the tokens come from, and what to check before you sign.

Watch on YouTube

Picture a market with no counter. Nobody asks your name, nobody opens an account for you, and nobody holds your money while the deal goes through. That is a DEX: a place where you trade straight from your own wallet.

A market run by a program

DEX is short for decentralized exchange. It is a place to swap, which just means trading one token for another. What sets it apart from the exchanges most people know is who sits in the middle.

On a regular crypto exchange, a company does. You sign up, often show ID, and send your tokens to the company. From then on it holds them for you, and you trust it to give them back.

On a DEX, the middle is a program that lives on the blockchain. It follows set rules and works the same way for everyone. It has no sign-up page, because all it needs is your wallet, the app that holds the key to your tokens. Your tokens stay with you until the moment you swap, and no company holds them in between.

The website you use to reach a DEX may well be built by a company. The swap itself is carried out by the program on the chain.

One swap, step by step

Say you hold 100 USDC on Arbitrum, one of many chains, and you want ETH. USDC is a token built to stay near one dollar. ETH is Ethereum's main coin, and Arbitrum also uses it for gas, the small fee every transaction pays.

  1. You open the DEX and connect your wallet. This shows the site your address. It moves nothing.
  2. You pick USDC and ETH and type 100. The screen shows about how much ETH you would get.
  3. You sign, which means your wallet uses your key to agree to the swap, and you pay a little gas.
  4. In one transaction, your USDC goes out and your ETH comes back.

The first time you swap a token, your wallet may also ask you to sign a permission, called an approval. That gets its own explainer.

Step 3 hides a small trap. You usually need a little ETH on Arbitrum to pay the gas, even though ETH is what you came to buy.

So where does the ETH come from? Not from the DEX's own stock. On most DEXs it comes from a pool: a shared pot of USDC and ETH that others filled. You put USDC in and take ETH out. Nobody on the other side has to agree to your trade, because the program does the deal by its own rules.

What people get wrong

No company does not mean no risk. It means there is no one in the middle to call. Once a swap is done, nobody can undo it. There is no help desk that can reverse it, and the program itself can have flaws.

A familiar name proves nothing. On most DEXs, anyone can create a token and a pool for it. Two tokens can share a name and a logo and still be different tokens.

The amount on screen is close, not exact. The price can move a little before your swap goes through. Your wallet gets what the pool pays at that moment, within limits you set.

What to check before you sign

Three things are worth a few seconds each:

  • The token: is it the one you meant, and not just one with the same name?
  • The chain: are you on the chain where your tokens are?
  • The amount: is it what you typed, with no extra digit?

In short

  • A DEX is a market run by a program, not a company.
  • You swap from your own wallet with no account, and no company holds your tokens in between.
  • On most DEXs, the tokens you get come from a pool that others filled.
  • A finished swap cannot be undone, so check the token, the chain and the amount first.

More one-minute DeFi explainers: cleave.fi/blog