Overview
This guide walks you through testing a CoW Protocol integration end-to-end. You’ll place a real order on the Sepolia testnet, verify it settles, and then move to production.Step 1: Set Up Your Test Environment
Contract addresses
CoW Protocol is deployed on Sepolia with the same addresses as mainnet:API endpoint
Sepolia API base URL:SDK configuration
Step 2: Get Test Tokens
You need Sepolia ETH and ERC-20 tokens to test with.Get Sepolia ETH
Use a faucet:Get test ERC-20s
- Wrap ETH to WETH: Send ETH to the WETH contract (
0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14) or use CoW Swap on Sepolia - Swap for test tokens: Use CoW Swap (Sepolia) or Uniswap (Sepolia) to swap WETH for COW or USDC
Example token addresses
These are the Sepolia token addresses used in the examples below:Step 3: Approve the Vault Relayer
Before placing orders, approve the GPv2VaultRelayer to spend your sell token. This is a one-time step per token. With Foundry:Step 4: Place a Test Order
Using the API
quote.appDataandquote.appDataHash— sign the hash, submit the JSONappDataid— pass it later asquoteIdexpiration— submit before this timestamp
Using the SDK
Step 5: Verify the Order
Check order status
Check the Explorer
Openhttps://explorer.cow.fi/sepolia/orders/{ORDER_UID} in your browser. You should see your order with its current status.
Expected behavior
Verify the trade
Once status isfulfilled:
txHash is present and the buyAmount is reasonable.
Step 6: Test Edge Cases
Before going to production, verify these scenarios:Step 7: Graduate to Production
Recommended progression
- Sepolia — verify signing, order creation, and status polling work end-to-end
- Barn (mainnet staging) — test with real liquidity using small amounts
- Production — switch to
api.cow.fi/mainnetwith production amounts
Using barn (mainnet staging)
Barn is the staging endpoint for mainnet: With the SDK:Production checklist
Before going live:- Orders create and settle correctly on Sepolia
- Signing works with your chosen
signingScheme - Status polling correctly detects
fulfilled,expired, andcancelled - Error handling catches
InsufficientBalance,InsufficientAllowance,InvalidSignature - Cancellation flow works
- (Optional) Tested on barn with small mainnet amounts
Switching to production
Change the API base URL to . Or with the SDK, remove theenv: 'staging' parameter (production is the default).
Sepolia Notes
Practical testing tips
- Use the token addresses listed above so your quote and signing examples match the guide.
- If a quote expires before submission, request a fresh quote and retry immediately.
- If an order stays
openuntilvalidTo, retry with adjusted order parameters or continue testing on barn. - Keep test amounts small when moving from Sepolia to barn or mainnet.
Troubleshooting
Resources
- API Integration Guide — Full API integration walkthrough
- Quickstart: Raw API (cURL) — End-to-end cURL walkthrough on Sepolia
- Error Reference — All API error codes and fixes
- Rate Limits — Rate limits apply equally on testnet