For a fixed-input swap, measure adverse slippage as the quoted output minus actual output, divided by quoted output. Use the final accepted quote for the same input and fee boundary. Keep gas outside this quantity comparison.
A transparent calculation
A hypothetical accepted quote promised an estimated 750 output tokens. The completed trade delivers 747.75. The adverse difference is 2.25 tokens, and the quote-relative deterioration is 2.25 / 750 = 0.30%, or 30 basis points.
If a separate gas payment is worth another 0.50 output tokens, total net economic value is lower by that amount. The token slippage remains 0.30%. Adding gas to the numerator would produce a different metric and should receive a different label.
Use the correct comparison point
Price impact and slippage are distinct. A quote may already reflect the pool-price movement caused by the requested size. Measuring actual output against an earlier spot-price calculation combines impact with subsequent execution changes.
Also check whether a displayed quote refreshed before approval. Comparing the receipt with the first screenshot can exaggerate slippage relative to the amount the user ultimately accepted.
Quantity loss does not identify its cause
A 30-basis-point difference does not by itself establish why execution changed. Market activity, altered routing, deductions omitted from the original quote or mismatched accounting boundaries can contribute.
Record the accepted quote, its time, the input amount, the final received amount and the fee treatment. If those fields cannot be matched, report an unexplained quote-to-receipt discrepancy instead of a precise slippage diagnosis.
For exact-output swaps, the natural comparison is the change in input required for the fixed received quantity. Reusing the output formula there can misleadingly show zero deterioration even when the user paid more input.
Sources & verification (1)
Source-check date is recorded in the article details. URLs are provided for manual verification. Use Copy to keep this page open.
- Price Impact vs Price Slippage
Own-trade impact differs from quote-to-fill slippage.
https://support.uniswap.org/hc/en-us/articles/8643794102669-Price-Impact-vs-Price-Slippage