CoW Protocol SDK
An intent-based, MEV-protected trading protocol SDK for Ethereum and EVM-compatible networksWhat is CoW Protocol SDK?
The CoW Protocol SDK is a comprehensive TypeScript toolkit for building trading applications on CoW Protocol, an intent-based decentralized exchange that provides MEV protection through batch auctions. It supports swaps, limit orders, TWAP orders, and more.The TradingSdk is the primary tool for most users. It handles swaps and limit orders with built-in quote retrieval, signing, and order submission.
Key Features
Intent-Based Trading
Express what you want to trade, not how. Solvers compete to find the best execution path for your order.
MEV Protection
Batch auction mechanism prevents front-running, sandwich attacks, and other MEV extraction techniques.
Gasless Trading
No upfront gas costs. Network fees are embedded in the order pricing.
Best Prices
Orders are matched across multiple liquidity sources and professional market makers for competitive pricing.
Supported Networks
Ethereum
Chain ID: 1
Gnosis Chain
Chain ID: 100
Arbitrum One
Chain ID: 42161
Base
Chain ID: 8453
Polygon
Chain ID: 137
Avalanche
Chain ID: 43114
Lens
Chain ID: 232
BNB Chain
Chain ID: 56
Linea
Chain ID: 59144
Plasma
Chain ID: 9745
Ink
Chain ID: 57073
Sepolia Testnet
Chain ID: 11155111
SDK Components
Core
TradingSdk
Main tool for swaps and limit orders with built-in signing and submission.
OrderSigningUtils
Cryptographic utilities for signing orders and cancellations.
OrderBookApi
Retrieve and manage orders, quotes, and trades.
MetadataApi
Access supplementary order metadata.
Advanced
BridgingSdk
Cross-chain token swaps and bridging.
ConditionalOrder
Programmatic orders including TWAP and stop-loss.
CowShedSdk
Smart contract account abstraction and hook pre-authorization.
Basic Trading Flow
The typical workflow for executing a trade with the SDK:
The SDK automates these steps while handling network-specific configurations.
Test Coverage
| Statements | Branches | Functions | Lines |
|---|---|---|---|
| 94.77% | 76.78% | 97.43% | 97.67% |
Next Steps
Installation
Install the SDK and its dependencies.
Quickstart
Get up and running quickly with a basic example.
Examples
Browse complete working examples.
API Reference
Explore the full API documentation.