Skip to content

Document streaming quote API with per-network timeout guidance#638

Open
squadgazzz wants to merge 3 commits into
mainfrom
streaming-quote-api
Open

Document streaming quote API with per-network timeout guidance#638
squadgazzz wants to merge 3 commits into
mainfrom
streaming-quote-api

Conversation

@squadgazzz

@squadgazzz squadgazzz commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Description

The new streaming quote endpoint (POST /api/v1/quote/stream) needs to be covered with docs. Integrators need to know it streams per-solver quotes over SSE, that they control the timeout, and that it is not simply a faster /quote: on a thin pair that only a slow solver can price, a short timeout drops that quote.

Changes

  • Added POST /api/v1/quote/stream to the Key Endpoints list
  • Added a "Streaming Quotes" section covering SSE behavior, event shape, a curl example, and timeout guidance with per-network suggestions

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Added guidance for streaming quotes through the API, including the new POST /api/v1/quote/stream endpoint.
    • Documented the SSE response model and how quote events (or absence of events) are delivered.
    • Included timeout recommendations to help control how long the stream stays open and how many solver quotes may arrive.
    • Updated the resources section with an Order Signing Guide link and made minor formatting improvements.

@squadgazzz squadgazzz requested a review from a team as a code owner June 29, 2026 15:14
@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jun 30, 2026 8:46am

Request Review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@squadgazzz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ebd68567-7f0d-4211-8fb1-0a1b7104a707

📥 Commits

Reviewing files that changed from the base of the PR and between 12ff40f and 85bd38b.

📒 Files selected for processing (1)
  • docs/cow-protocol/integrate/api.mdx
📝 Walkthrough

Walkthrough

Documentation for the CoW Protocol API integration page adds the POST /api/v1/quote/stream SSE endpoint, a new “Streaming Quotes” section with event semantics and timeout guidance, and an Order Signing Guide link in Resources.

Changes

API Integration Docs

Layer / File(s) Summary
Streaming quotes docs update
docs/cow-protocol/integrate/api.mdx
Adds POST /api/v1/quote/stream to Key Endpoints, documents SSE event semantics and timeout guidance, updates Resources with Order Signing Guide, and includes a minor formatting change.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐇 Hop hop, the docs now stream,
Quotes arrive in an SSE beam.
Timeouts, links, and notes set bright,
Rabbit-approved and tidy tonight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the streaming quote API docs update and the per-network timeout guidance.
Description check ✅ Passed The description includes the required purpose and changes sections and sufficiently explains the new streaming quote docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch streaming-quote-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fleupold fleupold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally, for markdown PRs it's suggested to use a single line per sentence, so that updates later create cleaner diffs.

Comment thread docs/cow-protocol/integrate/api.mdx Outdated

The client side owns this decision. The stream stays open until the request `timeout` elapses, or every solver has responded, so the value you set determines both how long you wait and which quotes you see. Set `timeout` (milliseconds) on the request, or close the connection yourself once you have a good-enough quote.

Streaming delivers quotes as they arrive, but it doesn't make any solver respond faster, so it isn't simply a quicker `/quote`. How much a short timeout helps depends on the pair: fast solvers cover liquid pairs in a few hundred milliseconds, while a thinner pair might rely on a single slower solver that a tight timeout would miss. It's worth tuning the value to the pairs you serve.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first sentence is weird. We are marketing it as a faster quote precisely because before the request takes as long as the slowest solver would take, whereas now you can show quotes as soon as the fastest solver responds. So it is a faster version of /quote

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rephrased a bit.

Comment thread docs/cow-protocol/integrate/api.mdx Outdated

`POST /api/v1/quote/stream` takes the same request body as `POST /api/v1/quote` but returns a [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) stream instead of one response. Each solver's quote arrives as its own event, so you can show prices as they come in instead of waiting for the slowest solver.

Each event's `data` is an `OrderQuoteResponse`, the same shape `POST /api/v1/quote` returns, with `id` set to `null`. Solvers without a quote send nothing, so you may receive fewer events than there are solvers. If no solver returns a usable quote, the server sends a final `error` event with a `NoLiquidity` body, then closes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird that we don't return a quote id. How are integrators supposed to use these quotes when placing orders if they don't have an ID?

"buyToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"sellAmountBeforeFee": "1000000000000000000",
"kind": "sell",
"from": "0xYourWalletAddress"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be useful to add the timeout in the example, as otherwise this behaves like a regular quote, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't behave as a regular quote in any case. The events are coming as solvers respond.

@pretf00d pretf00d left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

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