fix: a split swap's Min. received is the sum of its steps' minimums (closes #647)
The step that sets the output side gives the minimum. When that step and earlier swap steps each pay the output token to the sender, the minimum is now the sum of their minimums. There is no figure when the decoder reads none from one of them, or when one of them pays part of that token elsewhere. There is also none when the decoder did not read one of them, or a step between them, in full. These steps drop earlier steps from the sum, so a multi-hop route reads as before: - a V2 or V3 swap step that spends the output token; - a V4 step with a swap action that spends that token, or with a SETTLE or SETTLE_ALL of that token; - a PERMIT2_TRANSFER_FROM of that token. Model: opus-5-5
This commit is contained in:
@@ -1266,7 +1266,8 @@ see Transaction Decoding), do not always read as a number. They can read:
|
||||
the same words. `Unlimited`, `All available (V4 open delta)` and
|
||||
`Whatever an earlier step sent to the pair (V2 already paid)` keep their
|
||||
wording. When a V2 or V3 exact-out step sets `Min. received`, that line shows
|
||||
its `amountOut`, the exact amount it buys.
|
||||
its `amountOut`, the exact amount it buys. When earlier swap steps also pay
|
||||
that token to the user, the line shows the sum (see Transaction Decoding).
|
||||
- `All available (V4 open delta)`: the swap's `Amount` line, when the amount it
|
||||
shows is a V4 exact-in `amountIn` of zero. V4 reads that zero as "use the
|
||||
whole open delta", so the calldata states no quantity. Transaction Decoding
|
||||
@@ -3459,7 +3460,16 @@ Currently supported:
|
||||
name); and one more reads `Unknown (could not be decoded)` when a step that
|
||||
may pay an address went unread. When no step pays anyone, a single line reads
|
||||
`Unknown (not named in the calldata)`. Wherever there is a `Paid to` line, the
|
||||
minimum reads `Min. paid out`. The `Amount` line gives the total the steps
|
||||
minimum reads `Min. paid out`. The step that sets the output side gives the
|
||||
minimum. When that step and earlier swap steps each pay the output token to
|
||||
the transaction's sender, the minimum is the sum of their minimums. There is
|
||||
no minimum when the decoder reads none from one of them, or when one of them
|
||||
pays part of that token elsewhere. There is also no minimum when the decoder
|
||||
did not read one of them, or a step between them, in full. A swap step that
|
||||
spends the output token drops earlier steps from the sum. A V4 step spends
|
||||
each token that its swap actions spend. A V4 `SETTLE` or `SETTLE_ALL` of the
|
||||
output token also drops earlier steps. A `PERMIT2_TRANSFER_FROM` of the output
|
||||
token drops earlier steps too. The `Amount` line gives the total the steps
|
||||
take of `Token In`, from the step that sets the input side on: the first V2 or
|
||||
V3 exact-in or exact-out, `WRAP_ETH` or V4 swap step that names an input token
|
||||
or amount. A V4 step with a swap action sets the input side when no earlier
|
||||
|
||||
Reference in New Issue
Block a user