B.BlockAxis⌕ Search
Menu

Understand a DEX swap

A decentralised exchange can execute a trade through smart contracts and liquidity pools.

IntermediateContent revised · 14.09.20264 min reading · allow 5–10 more minutes for the workshopBlockAxis
← Read the mechanics
Workshop · 20 XP

Awarded once after a correct answer.

The question we will work through

Connect quote, allowance and minimum output

Useful first : Liquidity pools and automated market makers · Token approvals and wallet security

Read the mechanics · Step 4 / 6

Key takeaway

A decentralised exchange can execute a trade through smart contracts and liquidity pools.

The essentials

A decentralised exchange can execute a trade through smart contracts and liquidity pools. A quote describes an expected output at a moment in time. The submitted transaction must still execute against the state it encounters, subject to its limits.

How it works

Price impact is the effect of the trade on available liquidity. Slippage is the difference between expected and executed terms; slippage tolerance bounds what a particular transaction accepts. These are related but different concepts. A generous tolerance can expose the user to a substantially worse execution.

What to watch

For many tokens, an allowance is a separate permission for a spender contract. Check the spender, token, amount and duration if applicable. Router addresses and routes matter. A successful allowance transaction is not itself a completed swap, and unused permissions can remain afterwards.

Understand the details

If the quote is 100 units and the interface sets a minimum of 99, an execution below 99 should fail under that minimum-output condition. Network fees may still be charged for a reverted transaction that is included in a block. Review token behaviour, route fees and the chain separately: a displayed output does not necessarily capture every cost. Use a simulation to understand intent, while recognising that state can change before inclusion.

Boundaries and common mistakes

Tolerance is not a guarantee of a fair market price. A small percentage applied to a bad quote remains a bad reference.

The mechanism at a glance

SEE THE CONNECTIONS
Connect quote, allowance and minimum outputFour connected ideas
  1. 01Inspect quote
  2. 02Review allowance
  3. 03Set execution limit
  4. 04Check received assets

Read these as connected concepts, not necessarily consecutive steps.

Read the explanation

If the quote is 100 units and the interface sets a minimum of 99, an execution below 99 should fail under that minimum-output condition. Network fees may still be charged for a reverted transaction that is included in a block. Review token behaviour, route fees and the chain separately: a displayed output does not necessarily capture every cost. Use a simulation to understand intent, while recognising that state can change before inclusion.

The distinction that changes the analysis

01Price quote
02Minimum received

A quote describes an expected outcome under observed conditions. A minimum-output condition bounds what execution may accept. Check both the token approval and the swap terms: approving a router does not itself perform the quoted exchange.

Explain it yourself

Revisit the case above. Name what is established, what remains to be checked and the evidence needed to conclude. A strong answer addresses both sides of the diagram.

Applied workshop · work at your own pace

Apply the lesson to a case

A fictional swap quotes 200 units and sets a minimum output of 198. The execution would return 197.5. Assume the contract correctly enforces that minimum.

What should happen?

Choose one answer.

Terms in this lesson
Liquidity pool
Assets held under shared contract rules to support activities such as exchange or lending.
Prepare a correction note

Describe the passage and the proposed correction. This creates a local note for you to share; it sends nothing. Do not include personal or confidential information.

Sources and references

References for the mechanisms described. Numerical examples are hypothetical unless stated otherwise. Check the applicable version, network and jurisdiction.

References reviewed on 21 September 2026. All sources →