Dodo

Dodo: Slippage Limits and Swap Execution

Dodo's swap slippage tolerance limits the adverse change that a selected route may accept from its quote. For an exact-input swap, the associated minimum output defines the execution boundary. A wider tolerance lowers that floor and can accommodate more price movement, while a tighter setting rejects more unfavorable fills. Neither setting improves the original quote or fixes an incompatible token route. The meaningful amount is the submitted minimum, interpreted through the router's fee deductions, output caps, and token-transfer behavior.

Bottom line: A successful swap clears the router's encoded output check; output caps and transfer deductions require separate attention to the recipient's actual balance.

Quoted Output and the Minimum Return

The quoted output estimates what the selected route could deliver for a specified input amount. The minimum return expresses the lower amount that its execution check will accept. A quote describes an expected exchange, while the minimum becomes a transaction constraint that expresses how much deterioration the request permits. It does not instruct the pools to deduct the entire allowance from every successful swap.

Where an exact-input interface defines tolerance as a fractional reduction from quoted output, the relationship is M = Q × (1 - s). Here, Q represents the quoted output, s the permitted fractional reduction, and M the minimum. The quote and minimum must use the same token units and fee basis. The actual transaction carries a token amount, rather than relying on the percentage label alone.

The DODO AMM V3 integration's exact-output methods fix the requested output and bound input spending with an amountInMaximum cap. Its exact-input methods instead use amountOutMinimum. Those limits belong to their respective methods; they do not establish that every routing interface exposes both modes.


Price Impact Already Inside the Quote

Price impact describes the effect that a trade's size has on the available liquidity's exchange rate. That effect can already appear in the quoted output. A large trade relative to pool depth may receive fewer output units per input unit. Slippage tolerance then governs additional adverse movement relative to the quote used to construct the request. Expanding that tolerance leaves the quoted price impact unchanged.

The Proactive Market Maker (PMM) algorithm adjusts prices as pool inventory changes. Its inventory-sensitive curve helps explain why different trade sizes can produce different average prices. The pool's pricing parameters control that curve, whereas the trader's slippage tolerance controls the execution minimum.

Does a Higher Tolerance Guarantee Execution?

A higher tolerance does not guarantee execution because price acceptance is only one condition of a valid swap. An allowance that covers too few input tokens can block spending. Insufficient native currency can prevent payment of the network fee. An unsupported token transfer, unavailable route, or expired deadline can also stop execution. Lowering the minimum addresses an output shortfall specifically. It does not repair those other conditions, and a transaction that succeeds under the wider allowance may deliver a less favorable exchange rate.

An error identifying insufficient output supports reviewing the floor. An approval, transfer, or deadline error points to the condition that actually failed.


Dynamic and Custom Slippage Settings

Dodo's Dynamic setting suggests slippage using historical transaction data, while Custom allows an explicit user-selected value. Historical data supplies an estimate of suitable headroom; it cannot reserve the pool state that execution will encounter. Custom expresses a chosen acceptance boundary and likewise cannot stabilize the exchange rate. Neither mode removes the need to understand the resulting minimum output. A displayed setting also belongs to the selected interface and action, so a liquidity-deposit preference should not automatically stand in for a swap setting.


One Network and Compatible Token Transfers

SmartTrade's same-network routing needs a usable path between the selected input and output tokens. Its liquidity aggregation can distribute a trade across supported pools. The route's token addresses, adapters, and network must describe a combination that its contracts can execute. Slippage headroom cannot supply a missing compatible path.

Token transfer behavior introduces another compatibility boundary. Some tokens deduct charges during transfers, so an amount leaving a contract can differ from the amount reaching a recipient. Other token rules can reject a transfer outright. The selected router must accommodate the relevant behavior for its output check to mean what the interface presents. Raising tolerance by an assumed token charge does not prove that the route supports that token.

The input balance and spending allowance also refer to the selected token on the selected network. A displayed balance elsewhere cannot fund this same-network call. Native-currency spending and token allowances follow different mechanics, so an approval requirement should match the asset that the route actually spends.


A Minimum Output and a Confirmed Receipt

A hypothetical same-network swap uses a compatible route and tokens without transfer deductions. Its exact input is 137.8 token units, and its quote is 62.4 output-token units after applicable fees. The chosen tolerance is 0.75% of that quoted output. The token's decimal precision can represent the resulting minimum exactly. A successful pre-execution simulation provides a readiness signal for this route, with sufficient input allowance and native currency for gas.

The permitted output reduction equals 62.4 × 0.0075, or 0.468 token units. Subtracting it gives a minimum of 61.932 output-token units. The transaction request encodes that minimum for the compatible route before signing and submission. Its subsequent receipt reports successful execution, and the output transfer to the wallet records 62.08 units. That amount clears the minimum by 0.148 units and falls 0.32 units short of the quote. A lower tolerance would raise this floor, reducing the gap that the same quote permits.

A follow-up balance check, without unrelated transfers in this interval, confirms the same 62.08-unit increase. The quote alone would not establish that receipt. At the compatibility boundary, a pair with no supported execution path never supplies this usable request. Increasing its tolerance cannot create the missing route, so the example stops before submission in that case.


Can a Swap Expire With an Unchanged Quote?

A swap can miss its contract deadline even when the displayed quote remains unchanged. Dodo's routing contracts compare the request's deadline with the execution block's timestamp. A request beyond that boundary fails independently of whether its output would meet the minimum. The deadline bounds permission to execute without promising inclusion before the cutoff or automatically removing a pending network transaction.

Dodo: Can a Swap Expire With an Unchanged Quote? - illustration
Illustrated: Can a Swap Expire With an Unchanged Quote?

Open full-size image

Pool state can also change while a request waits. A successful simulation reflects the state used for that simulation, and later transactions may change the available output. A fresh quote estimates against newer conditions, while the previously submitted request retains its own execution constraints. Quote freshness, the amount floor, and the deadline address related risks through separate checks.


Reverted Swaps and Network Fees

A reverted on-chain swap consumes gas even though the failed call rolls back its token exchanges. The minimum-return check can therefore prevent an unacceptable fill without making the attempt free. A separately completed approval also remains a separate transaction, with its own fee and resulting allowance. Gas expenditure changes the wallet's native-currency balance, which matters when interpreting a swap involving that currency. The native balance difference alone may combine exchange proceeds with execution costs. The transaction receipt and token movement record distinguish those amounts from the output that the router checked.

Router Fees and the Recipient's Balance

The fee-charging router and the earlier balance-measuring router apply their checks to different stages of settlement. DODOFeeRouteProxy checks output against the minimum after subtracting route and broker fees. It then caps output at expReturnAmount, the request's expected return amount, and sends any excess to the route-fee receiver. A cap below the minimum or a transfer deduction can leave the recipient's net receipt below that minimum.

The earlier DODORouteProxy implementation's token-output path measures the caller's balance increase before comparing it with minReturnAmount. The distinction concerns those implementations and their token-output paths, rather than every swap bearing the same product name. Native-currency handling also differs from an ordinary token transfer.

The quote's fee basis must align with the submitted minimum. Pool fees can already enter the liquidity source's quoted output; additional route or integration fees depend on the selected execution method. Subtracting a fee twice understates expected receipt, while omitting a separate deduction overstates it. The router's checked output, its settlement transfer, and the wallet's net receipt describe specific amounts. They coincide only when the applicable fees, output cap, and transfer behavior permit it.


Slippage Headroom and Transaction Ordering

Public transaction ordering can change the pool state that a pending swap encounters. A sandwich attack places trades before and after another swap, moving its execution price adversely. Extra headroom gives that adverse movement more space before the minimum-return check rejects the trade. A tighter floor narrows acceptable deterioration, although ordinary price changes can then cause more failures. Submission methods that limit public transaction exposure address a different part of this risk. They do not make the encoded amount floor redundant, and an ordinary minimum-output check does not itself guarantee protection against transaction-ordering attacks.


Trade Size and Indirect Routing

Trade size and routing choices change the liquidity available to produce the quote. SmartTrade supports linear routes and splitting across pools, so the quoted rate need not come from one direct pool. Restricting indirect routing removes paths that use intermediary tokens. That restriction can reduce contract interactions, while also excluding liquidity that could have supplied a better output. Different amounts can produce different routes and exchange rates. The slippage calculation should therefore use the quote for the exact input and routing conditions under consideration.

A route with higher token output can also require more gas. The minimum-output check applies to swap output, leaving that execution cost separate.

Dodo: questions and answers

Can I Change the Tolerance on a Pending Swap?

Changing the interface setting cannot edit the minimum already encoded in a submitted transaction. A replacement request would need new transaction data and must follow the wallet's and network's replacement rules. Until that happens, the pending request retains its original output floor, even if the browser displays a different tolerance.

Why Can a Rounded Minimum Differ From the Submitted Amount?

The interface may round the displayed minimum while the transaction encodes an integer amount in the token's smallest units. Token decimals determine how that raw amount converts to readable units. For a fill close to the boundary, the encoded minimum and the amount that the router actually checks determine the comparison, rather than a shortened display.

Does the Swap Slippage Setting Govern a Limit Order?

A limit order uses its signed token amounts to define an exchange ratio, with its own expiration and fill conditions. That order's parameters determine the applicable constraints. A tolerance selected for an ordinary swap does not establish the terms of a separate limit order, even when both involve the same tokens.

Is Zero Slippage Tolerance the Same as a Zero Minimum Return?

Zero slippage tolerance and a zero minimum-return amount express different constraints. Where an interface accepts zero tolerance, the floor matches the quote under an output-reduction convention. A zero minimum instead removes that positive amount floor. The DODORouteProxy mixSwap and split-swap methods reject a zero minimum-return amount.

Will My Custom Slippage Setting Follow Me to Another Device?

Dodo's cloud-sync option can share slippage preferences across browsers and devices when enabled. Synchronization updates the preference without changing an existing transaction's encoded minimum. The active value on the receiving device determines the setting for a newly constructed swap, so its displayed preference needs to match the intended tolerance.

Can a Swap Deliver More Than Its Quoted Output?

A minimum-output check permits an amount above the quote when the selected route produces and settles that amount. It imposes a lower boundary, with applicable fees still affecting receipt. DODOFeeRouteProxy caps the caller's transfer at expReturnAmount and sends any excess after fees to the route-fee receiver. The quote and tolerance do not promise a higher receipt.

Does Slippage Tolerance Limit a token's Value After the Swap?

Slippage tolerance limits the accepted exchange outcome during execution, not subsequent market movements. A completed swap fixes the amount received through that transaction. Later changes in the token's market value do not reopen its minimum-return check or reverse a fill that met the applicable execution conditions.

Updated ·