-
Notifications
You must be signed in to change notification settings - Fork 160
fix(v4-sdk): update to use pathInput #476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🤖 Claude Code Review
SummaryThis PR fixes a bug in the The bug: In the The fix: Change the comparison from This is consistent with how the rest of the Verification
💡 Want a fresh review? Add a comment containing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 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.
Superseded by new review after PR update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 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.
Graphite Automations"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (01/06/26)2 reviewers were added and 1 assignee was added to this PR based on Siyu Jiang (See-You John)'s automation. |
Superseded by new review after PR update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 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.
PR Scope
Please title your PR according to the following types and scopes following conventional commits:
fix(SDK name):will trigger a patch versionchore(<type>):will not trigger any release and should be used for internal repo changes<type>(public):will trigger a patch version for non-code changes (e.g. README changes)feat(SDK name):will trigger a minor versionfeat(breaking):will trigger a major version for a breaking changeDescription
Uses pathInput for v4-sdk's midPrice() function, in the initial value of the reduce() call
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
Fixes a bug in the
Route.midPricegetter wherethis.inputwas incorrectly used instead ofthis.pathInputwhen determining the initial price direction in the reduce function.The
pathInputproperty contains the normalized currency that matches the pool's currencies (e.g., WETH), whileinputmay be a native currency (e.g., ETH) that doesn't match the pool'scurrency0orcurrency1. This caused incorrect price calculations when swapping native currencies through WETH pools.Changes
midPricegetter insdks/v4-sdk/src/entities/route.tsto usethis.pathInputinstead ofthis.inputwhen comparing againstthis.pools[0].currency0(line 80)How Has This Been Tested?
Unit tests added to verify midPrice calculations when using native currency (ETH) as input with WETH pools.
Are there any breaking changes?
No - this is a bug fix that corrects the price calculation behavior.