Encyclopedia DeFi · Entry 48
Decentralized exchanges: how a token trade reaches settlement
In this article
At a glance
Key facts
A quote describes state before the execution happens
A pool quote uses current reserves and fees; an order quote follows its signed conditions and available execution route. Other trades or state changes can occur before the user’s transaction is included.
The contract accepts or rejects the actual execution according to its limits. Compare the received amount with the quote at its recorded time, and separate the trade’s own price impact from intervening changes. A wallet signature or a submitted hash alone is not a completed swap.
Read the limits in a sample trade
Suppose a quote offers 100 B for 10 A and the submitted minimum is 99 B. A result of 99.4 B meets that minimum; 98.9 B does not. This boundary does not promise a particular market price, and an included Ethereum transaction that reverts still consumes gas used before failure. Who pays depends on the submission design; the UniswapX announcement of July 17, 2023 describes fillers paying to submit signed orders.
A displayed rate also needs a denominator. Output per input, output after pool fees, gas paid in the network asset and any separate interface fee are different quantities. Comparing a headline quote without those distinctions can compare unlike costs.
A DEX name is not a token endorsement
A permissionless pool can contain a token with unusual transfer rules, an issuer freeze mechanism or no credible backing. Pool existence is evidence of a contract and balances, not evidence that the asset is useful or redeemable.
Identify the actual chain, token contract, pool version and route. This article’s invariant example is Uniswap v2, not a claim that every exchange uses the same pricing, custody or administrative design.
Direct answers
Questions people ask
Can a swap fail after I approve it?
Yes. State can change before execution, or the trade can violate a minimum output or another contract condition. Approval to spend tokens does not guarantee that a later swap succeeds.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
A decentralized exchange uses blockchain contracts to settle trades. In an automated-market-maker design, a trader exchanges assets against pool inventory; other designs use signed orders filled by competing third parties. A quote is an estimate until execution, and the submitted limits determine which outcomes the contract may accept.
Scope: DeFi. Verification: verified · 2026-10-02T18:17:57.897Z.
Link to this claimPool design: Uniswap v2 checks a fee-adjusted reserve invariant.
Scope: DeFi. Verification: verified · 2026-10-02T18:17:57.897Z.
Link to this claimQuote: Input, reserves and fees determine an estimated output.
Scope: DeFi. Verification: verified · 2026-10-02T18:17:57.897Z.
Link to this claimTrade bound: A minimum output can reject an unfavorable execution.
Scope: DeFi. Verification: verified · 2026-10-02T18:17:57.897Z.
Link to this claimRevision history
- — First publication after primary-source research and independent automated verification.
- — Before first publication, independent review checked and revised: quickAnswer, quickAnswerSourceIds, sections, sources. Compared the v2 pair invariant and pricing guide with the July 17, 2023 UniswapX announcement. Added primary support for signed-order settlement by competing fillers; no claim that all DEXs use one design. Checked the 100/99 output-bound example. Added EIP-140 support and distinguished included-failure gas from who pays under a filler submission design.
- — Expanded explanation: A quote describes state before the execution happens. Worked examples are illustrative; source checks and independent verification are recorded separately.
On the Understand a swap path · Learn next: Automated market makers: trading against a programmed inventory
Source register
Sources and references
Retrieval dates and locators are recorded individually.- Ethereum DeFi overviewethereum.org contributors
Financial applications and the distinction between blockchain, assets, protocols and interfaces.
Locator: What is DeFi?; How does DeFi work? · Retrieved: 2026-10-02Open source - Uniswap v2 pricingUniswap
Reserve-dependent quotes, trade bounds and external price observations.
Locator: Pricing Trades; Exact Input; Exact Output · Version / scope: Uniswap v2 · Retrieved: 2026-10-02Open source - Uniswap v2 pair sourceUniswap
Reserve accounting, LP shares, fee-adjusted invariant and optional protocol fee.
Locator: mint; burn; swap; _mintFee · Version / scope: v2-core v1.0.1 · Retrieved: 2026-10-02Open source - Introducing the UniswapX ProtocolUniswap Labs
Dated example of signed orders filled and submitted by competing third parties.
Locator: Next-level aggregation; Gas-free swapping — and no cost for failed swaps · Version / scope: 2023-07-17 announcement · Retrieved: 2026-10-02Open source - EIP-140: REVERT instructionEthereum Improvement Proposals
Reverting rolls back state but does not refund work already executed; unused gas is not all consumed.
Locator: Specification; Test Cases · Version / scope: EIP-140 final · Retrieved: 2026-10-02Open source - Uniswap v2 whitepaperUniswap
Full-range constant-product inventory and cumulative-price oracle design.
Locator: Price oracle; Liquidity; Fees · Version / scope: Uniswap v2 whitepaper, March 2020 · Retrieved: 2026-10-02T17:03:45.008ZOpen source - UniswapX overviewUniswap
Signed order execution through fillers; execution conditions are mechanism-specific.
Locator: Signed orders; Fillers; Dutch auctions · Retrieved: 2026-10-02T17:21:47.712ZOpen source
Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.
Editorial method and correctionsDegrees of Satoshi editorial project. “Decentralized exchanges: how a token trade reaches settlement.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/decentralized-exchanges/