/quote endpoint is the starting point for every trade on CoW Protocol. Before a user can sign an intent, the protocol needs to determine what price is available and what fees apply. This page explains how quoting works, the different quoting strategies available, and best practices for keeping quotes fresh.
How Quoting Works
When you callPOST /api/v1/quote, the protocol:
- Evaluates available liquidity across on-chain sources (AMMs, aggregators) and off-chain sources (CoW Protocol solvers)
- Estimates network costs (gas) for settlement
- Returns a price estimate including fee breakdowns
Quotes are not guaranteed. They represent the best estimate at the time of the request. Market conditions, gas prices, and available liquidity can all change between when a quote is fetched and when the order is executed.
validTo timestamp. The signed order must be submitted before this time expires, or it will be rejected.
Quote Types
CoW Protocol supports different quoting strategies via thepriceQuality parameter, allowing you to trade off between response speed and price accuracy.
Fast Quotes
- Returns quickly (typically under 1 second)
- Uses cached or approximate pricing data
- Best for UI display, price previews, and showing users an estimate before they commit
- Trade-off: price may be less accurate, especially for large orders or illiquid token pairs
Optimal Quotes
- This is the default when
priceQualityis not specified - Takes longer (typically 1-5 seconds)
- Queries multiple liquidity sources and solvers for the best available price
- Best for order signing and final price confirmation in production order flows
- Trade-off: slower response time
Verified Quotes
- Most thorough price discovery process
- Verifies that the proposed settlement is feasible on-chain
- Best for large orders where accuracy is critical
- Trade-off: longest response time (3-10 seconds)
Comparison
| Property | Fast | Optimal | Verified |
|---|---|---|---|
| Response time | Under 1s | 1–5s | 3–10s |
| Price accuracy | Approximate | Good | Best |
| Use case | UI preview | Order signing | Large/critical orders |
| Recommended for | Price display | Most integrations | DAOs, large trades |
Timing Between Quote and Order
The time gap between fetching a quote and submitting the signed order is one of the most common sources of integration bugs.The validTo field
Every quote response includes a validTo timestamp (Unix epoch seconds). This defines the latest point at which the order can still be considered valid by the protocol. If you submit an order after validTo has passed, it will be rejected.
Recommended pattern
Re-quote if stale
If more than 30 seconds have elapsed since the quote was fetched, fetch a new quote before proceeding.
Sign with quote amounts
Build the order using the quote’s
sellAmount, buyAmount, and feeAmount values, apply slippage, and have the user sign it.Anti-patterns to avoid
- Caching quotes for minutes. A quote fetched 5 minutes ago is almost certainly stale. Prices, gas costs, and liquidity can all shift in that time.
- Quoting once on page load. If your UI fetches a quote when the page loads and uses it when the user clicks “Swap” minutes later, the order is unlikely to fill at the quoted price.
- Ignoring
validTo. Even if you submit beforevalidTo, a very old quote means the signed amounts may not match current market conditions, leading to unfilled orders.
Slippage and Quote Freshness
Slippage tolerance and quote freshness are closely related. Slippage defines how much worse than the quoted price a user is willing to accept:- Tight slippage + stale quote = high chance the order expires without filling, because the market has already moved beyond the narrow tolerance window.
- Wide slippage + stale quote = order may fill, but the user could receive a significantly worse price than expected.
- Fresh quote + reasonable slippage = the ideal combination. The quoted price is close to the current market, and the slippage buffer handles normal short-term volatility.
As a general rule, re-quote if more than 30 seconds have elapsed since the last quote. For volatile markets or large orders, consider re-quoting even more frequently.
Best Practices for Integrators
For frontend/UI integrations
- Use
priceQuality: "fast"for initial price previews and display - Switch to
priceQuality: "optimal"when the user is ready to sign - Implement a quote refresh mechanism: periodically re-fetch the quote while the user is on the confirmation screen
- Show a visual indicator when the quote is being refreshed so users understand why amounts may change
For bots and automated systems
- Always use fresh quotes immediately before signing — never cache
- Use
priceQuality: "optimal"as the baseline - For large orders, use
priceQuality: "verified"or consider splitting into a TWAP order to reduce market impact
For large or DAO trades
- Use
priceQuality: "verified"to confirm settlement feasibility before signing - Consider TWAP orders to spread execution over time and reduce slippage
- Set slippage tolerance carefully — too tight and the order will not fill; too loose and you may lose value
General guidelines
Further Reading
- How Intents Are Formed — detailed breakdown of quote responses and fee calculations
- Flow of an Order — end-to-end order lifecycle
- Rate Limits & Quotas — per-endpoint limits, backoff strategies, and Cloudflare troubleshooting
- API Integration — endpoint reference and quick start
- Order Book API Reference — complete API documentation