1. Intention
An intention is the user’s raw desire to trade. To obtain a quote, you send this intention to the/quote API endpoint:
For more details see the Order Book API.
2. Quote
The/quote response provides the price information needed to build the order, including fee breakdowns.
Sell order response

Buy order response

sellAmount is after the protocol fee, and the feeAmount (network costs) is not yet included in the sell amount — it must be added separately.
3. Amount Stages
The quote response and order construction use a shared vocabulary of amount stages — each representing the token amount at a specific point in the fee pipeline. Understanding these terms is essential for interpreting quote values and building orders correctly.Flow for sell orders

The code below is simplified, see the full working code in CoW SDK getQuoteAmountsAndCosts.
The /quote response maps directly to afterNetworkCosts. beforeAllFees is reconstructed from it for partner fee calculations:
Flow for buy orders
The code below is simplified, see the full working code in CoW SDK getQuoteAmountsAndCosts.

/quote sell amount maps to afterProtocolFees. The buy amount is fixed and maps to beforeAllFees:
4. Fees & Slippage
Several layers of fees transform the raw spot price into the final amounts signed in the order.Fee types
Spot Price (beforeAllFees)
The spot price is the exchange rate before any fees are applied. It serves as the reference for partner fee and slippage calculations.Sell order
Buy order
Protocol Fee
The protocol fee is expressed as basis points (protocolFeeBps) in the quote response.
Sell orders (buy token units)
For sell orders,quote.buyAmount is already after the protocol fee has been deducted:
Buy orders (sell token units)
For buy orders, the protocol fee is applied to the sum of sell amount and network costs:Partner Fee
The partner (integrator) fee is calculated as a percentage of the spot price (beforeAllFees), not the post-fee amounts.
Sell orders (buy token units)
Buy orders (sell token units)
The same formula applies, but the result is in sell token units.Slippage
Slippage tolerance uses the same calculation as the partner fee, but it is applied to theafterPartnerFees amount rather than the spot price:
All Formulas at a Glance
Below is every stage computation in one place. All values are in token atoms (integers).protocolFeeBps is in basis points (e.g. "2" = 2 bps = 0.02%).
Sell order — full computation
Buy order — full computation
Forming the Final Order
The signed order combines the quote API response with UI/integrator settings:
The resulting order contains the
afterSlippage buy amount (for sell orders) or sell amount (for buy orders), which the protocol guarantees as the minimum the user will receive (or maximum they’ll pay). The fixed amount (sellAmount for SELL order, buyAmount for BUY order) corresponds to the spot price amount.