Skip to main content

CoW Protocol SDK

An intent-based, MEV-protected trading protocol SDK for Ethereum and EVM-compatible networks

What 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:
1

Get a quote

Request a price quote for your desired trade from the CoW Protocol API.
2

Sign the order

Sign the order using EIP-712 typed data signing through your wallet.
3

Post to order book

Submit the signed order to the CoW Protocol order book for execution.
The SDK automates these steps while handling network-specific configurations.

Test Coverage

StatementsBranchesFunctionsLines
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.

Resources

Discord

Join the community for support and discussions

GitHub

Browse source code and report issues

Forum

Participate in governance discussions

Snapshot

Vote on CoW Improvement Proposals
Last modified on March 16, 2026