Encyclopedia DeFi · Entry 316
Exact-input and exact-output swaps: which amount is fixed?
In this article
At a glance
Key facts
Choose which side matters
A person spending a fixed 100 units of token A generally cares about the token B amount received. A person who needs exactly 50 B generally cares about how much A must be supplied. Those are different transaction instructions even when an interface initially quotes the same exchange rate.
Read the actual bounds
Suppose spending 100 A is quoted to receive 50 B. A 1% reduction from that quote gives a minimum of 49.5 B. A different instruction might request exactly 50 B while allowing at most 101 A. Neither instruction requires execution at the original quote.
The arithmetic is hypothetical and states the percentage convention explicitly. Interfaces can calculate tolerances differently. Inspect the minimum-output or maximum-input amount that will actually be enforced, along with the recipient and deadline.
Account for the integration
In Uniswap’s example, the exact-output helper temporarily takes the maximum input and refunds the unused portion. A custom integration needs to implement that refund correctly. A nonzero price limit can also cause an exact-input flow to use less than the requested amount, requiring careful refund handling.
These are v3 router examples. Fee-on-transfer tokens, custom hooks and other routers can have different supported behavior; a familiar swap label does not establish compatibility.
Direct answers
Questions people ask
Does exact output guarantee that I will receive the target?
In the documented router example with sqrtPriceLimitX96 set to zero, a successful exact-output swap delivers the requested output. Liquidity, input limits or expiry can still prevent settlement. Custom nonzero price-limit paths need their own output-completeness checks.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
An exact-input swap fixes the amount offered and enforces a minimum received. An exact-output swap targets a receiving amount and enforces a maximum spent. In the documented Uniswap v3 router flows, a trade that cannot satisfy its bound fails; the displayed quote is not a promise of execution.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.
Link to this claimExact input: The usual protection is amountOutMinimum.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.
Link to this claimExact output: The input is limited by amountInMaximum.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.
Link to this claimUnused input: A prefunded exact-output integration must return any unspent input.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T19:18:00.092Z.
Link to this claimRevision history
- — First publication after primary-source research and separate automated verification.
Source register
Sources and references
Retrieval dates and locators are recorded individually.- Single SwapsUniswap
Version-specific router constraints and worked integration examples.
Locator: exactInputSingle; exactOutputSingle; deadline; amountOutMinimum; amountInMaximum · Version / scope: Documentation retrieved for the 2026-10-02 editorial scope; content hash recorded · Retrieved: 2026-10-02T18:53:19.662ZOpen 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. “Exact-input and exact-output swaps: which amount is fixed?.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/exact-input-vs-exact-output-swaps/