Awarded once after a correct answer.
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
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
- 01Inspect quote
- 02Review allowance
- 03Set execution limit
- 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.
Put the mechanism into context
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.
Apply it in the workshop →What this mechanism does not guarantee
Tolerance is not a guarantee of a fair market price. A small percentage applied to a bad quote remains a bad reference.
The distinction that changes the analysis
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.
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.
197.5 is below 198, so the minimum-output condition fails. The condition limits accepted execution; it does not guarantee inclusion or reimburse gas.
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.