fix: swap beforeNetworkCosts/afterNetworkCosts for cow-sdk v7.3.8 upgrade#2886
Open
fix: swap beforeNetworkCosts/afterNetworkCosts for cow-sdk v7.3.8 upgrade#2886
Conversation
…rade cow-sdk v7.3.5+ (sdk-order-book v1.0.0, PR #800) fixed a naming bug where beforeNetworkCosts and afterNetworkCosts had inverted semantics for SELL orders. The API returns sellAmount already after network costs for SELL orders, but the old SDK labeled it as "before". Swaps all beforeNetworkCosts/afterNetworkCosts references to match the corrected semantics and bumps cow-sdk from 7.3.4 to 7.3.8. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07ba620075
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The naming bug in cow-sdk only affected SELL order semantics — BUY orders had correct field mapping in both old and new SDK. After correcting only SELL, both order kinds resolve to the same fields (beforeNetworkCosts for src, afterNetworkCosts for dest), so the ternaries are removed. Also regenerates yarn.lock for cow-sdk 7.3.8. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
grothem
approved these changes
Feb 27, 2026
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.
Summary
@cowprotocol/cow-sdkfrom7.3.4to7.3.8beforeNetworkCosts/afterNetworkCostsreferences inrates.helpers.tsto match corrected semanticsContext
cow-sdk PR #800 (shipped in
sdk-order-book@1.0.0, bundled incow-sdk@7.3.5+) fixed a naming bug wherebeforeNetworkCostsandafterNetworkCostshad inverted semantics for SELL orders.The CoW
/quoteAPI returnssellAmountalready after network costs for SELL orders. The old SDK incorrectly labeled this asbeforeNetworkCosts, andsellAmount + feeAmount(the pre-fee value) asafterNetworkCosts.The new SDK fixes the labels to match their actual meaning:
beforeNetworkCosts.sellAmountafterNetworkCosts.sellAmountOur code relied on the old (inverted) naming to get the user's input amount via
afterNetworkCosts.sellAmount. With the fix, we swap the references so the same values are retrieved under the now-correct field names.See migration guide for full details.
Test plan
srcSpotAmountmatches user's input amount (e.g., 1.0 ETH)destSpotAmountmatches user's requested buy amountyarn installto pull updated lockfile for cow-sdk 7.3.8🤖 Generated with Claude Code