What Is a DEX? How Decentralized Exchanges Work
Back to Blog

What Is a DEX? How Decentralized Exchanges Work

Daniele Montemale
August 20, 2025
4 min read
🤖

Explore this content with AI

Ask questions about this article using your favorite AI assistant. We copy the prompt for you and open a new tab.

What Is a Decentralised Exchange, DEX, and How Does It Work?

TL,DR: A DEX is a crypto exchange that runs on smart contracts. You trade peer to peer from your wallet. Prices come from algorithms called automated market makers, AMMs, that use liquidity pools funded by users. Liquidity providers, LPs, earn a share of each trade. Uniswap and Raydium are well known examples, while Peridot helps users who borrow or repay to route the right swaps cleanly across chains.

DEX, the basic idea

A DEX replaces a company operated order book with code. Instead of matching buyers and sellers at a single price, an AMM holds two assets in a pool and quotes prices based on a formula. Trades move the pool’s ratio, the formula updates the price, and fees from each swap are shared with LPs. This allows continuous, permissionless markets without an intermediary.

What is an AMM, and why liquidity pools matter

An automated market maker is the pricing engine inside most DEXs. Users deposit token pairs into liquidity pools. The AMM sets prices from the pool’s balances and executes swaps against that pool. Because pools are always available, you can trade at any time, and LPs earn fees that compensate them for providing inventory.

Uniswap and Raydium in one minute

  • Uniswap on Ethereum popularised AMMs and later introduced concentrated liquidity, which lets LPs choose price ranges for their capital, plus predefined fee tiers, for example 0.05%, 0.3%, 1%. Recent versions allow flexible fees.

  • Raydium on Solana is a high speed AMM with permissionless pool creation. Swaps settle quickly, and standard pools charge 0.25%, with the majority of fees paid to LPs according to the docs.

How fees are earned

Every swap pays a small trading fee into the pool. On Uniswap, fee tiers are set per pool. On Raydium standard AMM pools, the fee is 0.25%, of which most goes to LPs, with small portions allocated to protocol uses. Fees accumulate in the pool’s assets, so LPs earn pro rata when they withdraw.

How trading actually flows

  1. You connect a wallet and choose tokens to swap.

  2. The DEX reads pool prices from smart contracts.

  3. The AMM quotes a rate, includes the fee, and shows slippage.

  4. You approve the transaction, then the contract updates pool balances and sends you the output token.
    Everything is transparent on chain.

How DEXs differ from centralised exchanges

  • Custody: You keep your assets in your own wallet. There is no deposit account that a company controls.

  • Transparency: Prices, balances, and fees are visible on chain.

  • User control: You decide when to transact, you approve each transaction from your wallet.
    These are core design traits documented in leading AMM references.

Benefits today, why DEXs are “now good”

Early AMMs were simple and often capital inefficient. Modern designs improved on three fronts:

  • Capital efficiency, Uniswap v3’s concentrated liquidity focuses capital where trades happen, improving depth.

  • Flexible fees and multiple tiers help tune pools for volatile or stable pairs, improving execution quality.

  • High throughput chains, Raydium on Solana delivers fast, low cost settlement, which improves user experience for frequent swaps.

Where Peridot fits

  • Peridot: When you borrow, repay, or rebalance a position, you often need to swap assets. Peridot focuses on making those cross chain steps simpler, so you can route the right trade with fewer clicks and clearer risk checks.

Key risks to understand

  • Price impact and slippage: Large trades can move the pool price.

  • Impermanent loss for LPs: If prices diverge, withdrawing later can be worth less than simply holding, even after fees. Mitigation includes stablecoin pairs and concentrated ranges that match actual trading.

  • Smart contract and governance risk: Bugs or parameter changes can affect pools. Prefer audited, battle tested protocols.

  • Network and wallet errors: Wrong addresses or wrong networks can cause loss. Double check before signing.

Quick glossary

  • DEX: On chain exchange using smart contracts.

  • AMM: Algorithm that prices trades from pool balances.

  • Liquidity pool: Smart contract that holds a token pair for trading.

  • LP token: Receipt that represents your share of a pool.

  • Concentrated liquidity: Liquidity placed within a chosen price range.

Getting started safely

  1. Start with a small swap on a major DEX.

  2. If providing liquidity, choose a pool you understand, for example a stablecoin pair. Read fee tiers and risks.

  3. For lending journeys, consider using Peridot to simplify the swap steps around borrowing and repayment.

Education only, not financial advice.


Daniele Montemale

Daniele Montemale is a senior marketing leader with two decades of experience driving growth and performance. At Peridot, he advises on strategy and contributes thought leadership on cross-chain DeFi, onchain UX, and bridging Web2 simplicity into Web3.

Frequently Asked Questions

What makes Uniswap different from Raydium
Both are AMM based DEXs. Uniswap popularised concentrated liquidity and fee tiers on Ethereum, while Raydium runs on Solana with fast settlement and a standard 0.25% fee on many pools.
How do liquidity providers earn
LPs deposit token pairs, receive LP tokens, and earn a share of trading fees collected by the pool. Fees compound in pool assets until withdrawal.
What is impermanent loss
It is the potential underperformance of an LP position versus simply holding the assets, due to price divergence inside the AMM.

Share this article

What Is a DEX? How Decentralized Exchanges Work | Peridot Blog