Zimbuck – Your Market. Your Community.

What Is a Decentralised Exchange (DEX)? How DEXs and AMMs Work — Explained

5 min read
0
Comments
113
Views

On a normal exchange, a company holds your money, runs the order book and decides who can trade. A decentralised exchange — a DEX — replaces that company with code. This guide explains, in plain language, what a DEX is, how its prices are set without an order book, who supplies the tokens you trade against, and the risks that come with handing the job to a smart contract. It is one of the core DeFi building blocks we explain step by step on Zimbuck News.

What is a decentralised exchange?

A DEX is a set of smart contracts on a blockchain that lets you swap one token for another directly from your own wallet. There is no account to open, no deposit to make and no company taking custody: your tokens stay in your wallet until the moment of the trade, and the swap settles in a single on-chain transaction — it either completes fully or fails completely. A report prepared for the CFTC's Technology Advisory Committee describes DEXs in exactly these terms: software protocols that facilitate the automated exchange of digital assets.

The problem a DEX has to solve: the price

A traditional exchange sets prices by matching buyers and sellers in an order book. A smart contract cannot wait around for a counterparty, so most DEXs use an automated market maker (AMM) instead. You do not trade against another person — you trade against a liquidity pool, a reserve of two tokens locked in the contract, which is always ready to quote a price.

The classic formula is disarmingly simple: x × y = k. The amount of token A in the pool (x) multiplied by the amount of token B (y) must stay equal to a constant (k) after every trade, before fees. The quoted price is just the ratio of the two balances. Buy token A and the pool ends up with less A and more B — so A automatically becomes more expensive. No human sets the price; the balances do.

Who fills the pool? Liquidity providers

Pools are funded by ordinary users called liquidity providers (LPs). An LP deposits both tokens in equal value and receives pool tokens representing a proportional share of the reserves, redeemable at any time. In return, LPs earn a share of the trading fees — on Uniswap v2, for example, a 0.30% fee on every trade is added to the reserves for LPs. The trade-off is that an LP's holdings can underperform simply holding the two tokens when prices move apart, a cost worth understanding before providing liquidity. The size of these pools is measured as total value locked — our explainer on what TVL means in DeFi walks through that number in plain terms — and the Zimbuck Market News group regularly hosts exactly this beginner discussion.

Price impact: why size changes your price

  • Every trade moves the price, because every trade changes the pool's balances.
  • The bigger your order relative to the pool, the worse your average price — this gap is called price impact.
  • Bigger pools absorb bigger trades with less movement, which is why the same swap can price very differently on two DEXs.
  • Slippage settings and front-running bots (MEV) can add further cost, so limits should be set before you sign a transaction.
  • Every swap pays the underlying blockchain's network fee, because every swap is an on-chain transaction.

DEX vs centralised exchange, honestly

A DEX gives you custody, permissionless access and transparent, auditable rules. A centralised exchange typically gives you deeper liquidity, faster execution, customer support and a company to complain to. A DEX also carries risks a company-run venue does not: a bug in the smart contract is a bug in the bank vault, and there is no help desk when you sign the wrong transaction. Uniswap's own documentation describes its pairs as automated market makers standing ready to accept one token for the other — the AMM mechanics walkthrough at Protocol Insights is a solid next read for the worked maths.

FAQ

What does DEX stand for?
Decentralised exchange — a trading venue that runs on blockchain smart contracts instead of a company's servers.

Do I need an account to use a DEX?
No. You connect a wallet, and trades settle directly from it. There is no sign-up and no deposit.

What is an automated market maker?
A smart contract that holds a pool of two tokens and quotes prices from a formula — most commonly x × y = k — instead of matching buyers and sellers.

Why did my swap execute at a worse price than quoted?
Price impact: your trade changed the pool's balances as it executed. Larger trades in smaller pools move the price more.

Is a DEX safer than a centralised exchange?
It removes custody risk — no company can lose or freeze your deposit — but adds smart-contract risk. Neither is simply "safer"; the risks are different.

This article is general educational information only, not financial advice. If you are learning DeFi one concept at a time, join the conversation on Zimbuck, the finance social platform for traders and investors.