Skip to content

Conversation

@dinesh11515
Copy link

@dinesh11515 dinesh11515 commented Dec 12, 2025

Description

added support to ZeroBuyAmount error in get order quote
there is ZeroAmount error in validation of quote during post order , but it's causing this issue in FE, to avoid this on first step, added this new Error.

rarely we are seeing quotes with zero buy amount , here is the example quote i got this mrng

{
"quote": {
"sellToken": "0xe91d153e0b41518a2ce8dd3d7944fa863463a97d",
"buyToken": "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0",
"receiver": "0xb66b7dca1d4d08a6b89134a68888f50210cfe13e",
"sellAmount": "962693300000",
"buyAmount": "0",
"validTo": 1765519165,
"appData": "{\"appCode\":\"CoW Swap\",\"environment\":\"local\",\"metadata\":{\"orderClass\":{\"orderClass\":\"market\"},\"quote\":{\"slippageBips\":5000,\"smartSlippage\":false}},\"version\":\"1.10.0\"}",
"appDataHash": "0xdbfd0b8d8081e4aa56db255c2697d480f36fa42b625fdb165991eacf49604bde",
"feeAmount": "37306700000",
"kind": "sell",
"partiallyFillable": false,
"sellTokenBalance": "erc20",
"buyTokenBalance": "erc20",
"signingScheme": "eip712"
},
"from": "0xb66b7dca1d4d08a6b89134a68888f50210cfe13e",
"expiration": "1970-01-01T00:00:00Z",
"id": null,
"verified": false,
"protocolFeeBps": "2"
}

@dinesh11515 dinesh11515 requested a review from a team as a code owner December 12, 2025 07:59
@github-actions
Copy link

github-actions bot commented Dec 12, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@dinesh11515
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 16, 2025
@squadgazzz
Copy link
Contributor

@cowprotocol/frontend does it require any support from your side before merging this PR?

@dinesh11515
Copy link
Author

just want to share here that Once this PR is merged, I’ll open a follow-up PR on the frontend to address this error and resolve the specific issue.

btw already updated the code , just need to test it
here is commit

@jmg-duarte
Copy link
Contributor

@dinesh11515 while we wait for the frontend team reply, could you make sure the checks are green?

@dinesh11515
Copy link
Author

@dinesh11515 while we wait for the frontend team reply, could you make sure the checks are green?

@jmg-duarte fixed lint issue, can we run checks again

@shoom3301
Copy link
Contributor

Hi!
Yes, we will need to handle the validation error on the frontend side, as @dinesh11515 said, but it can be done after this PR is merged.
My only concern is that we could have DCA orders, where buyAmount is supposed to be zero by design. In that case this change will prevent creation of such orders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants