feat(v4-sdk): add max hop slippage support for multi-hop swaps#499
Open
feat(v4-sdk): add max hop slippage support for multi-hop swaps#499
Conversation
This reverts commit 62c98f4.
Contributor
🤖 Claude Code Review
SummaryThis PR re-introduces the Changes:
Technical Notes:
The implementation is clean and follows existing patterns in the codebase. 💡 Want a fresh review? Add a comment containing |
Contributor
There was a problem hiding this comment.
📋 Review verdict: APPROVE
👆 The main review comment above is the source of truth for this PR review. It is automatically updated on each review cycle, so always refer to it for the most current feedback.
This formal review submission is for the verdict only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
[Summary of the change, motivation, and context]
How Has This Been Tested?
[e.g. Manually, E2E tests, unit tests, Storybook]
Are there any breaking changes?
[e.g. Type definitions, API definitions]
If there are breaking changes, please ensure you bump the major version Bump the major version (by using the title
feat(breaking): ...), post a notice in #eng-sdks, and explicitly notify all Uniswap Labs consumers of the SDK.(Optional) Feedback Focus
[Specific parts of this PR you'd like feedback on, or that reviewers should pay closer attention to]
(Optional) Follow Ups
[Things that weren't addressed in this PR, ways you plan to build on this work, or other ways this work could be extended]
✨ Claude-Generated Content
Description
Re-adds the max hop slippage feature to the v4-sdk. This allows specifying per-hop slippage limits for multi-hop swaps, enabling finer-grained slippage control on each step of a swap route.
This PR reverts the previous revert (#470) to restore the max hop slippage functionality.
Changes
maxHopSlippageoptional parameter toV4Planner.addTrade()method acceptingBigNumber[]maxHopSlippage: readonly string[]field toSwapExactInandSwapExactOuttypes inv4BaseActionsParser.tsSWAP_EXACT_IN_STRUCTandSWAP_EXACT_OUT_STRUCTABI definitions to includeuint256[] maxHopSlippageparseV4ExactIn()andparseV4ExactOut()parser functions to decode the new fieldmaxHopSlippage: []in expected outputsHow Has This Been Tested?
Unit tests added covering:
Are there any breaking changes?
No -
maxHopSlippageis an optional parameter that defaults to an empty array when not provided, maintaining backward compatibility.