Overview
CoW Protocol Python SDK supports trading on multiple EVM-compatible chains, enabling you to build cross-chain trading strategies and multi-network applications.Supported Chains
The SDK provides built-in support for these networks:supported_chains.py
Chain Enumeration
Ethereum Mainnet
Chain ID: 1
Network:
Explorer: https://etherscan.io
Network:
ethereumExplorer: https://etherscan.io
Gnosis Chain
Chain ID: 100
Network:
Explorer: https://gnosisscan.io
Network:
gnosisExplorer: https://gnosisscan.io
Arbitrum One
Chain ID: 42161
Network:
Explorer: https://arbiscan.io
Network:
arbitrum_oneExplorer: https://arbiscan.io
Base
Chain ID: 8453
Network:
Explorer: https://basescan.org
Network:
baseExplorer: https://basescan.org
Polygon
Chain ID: 137
Network:
Explorer: https://polygonscan.com
Network:
polygonExplorer: https://polygonscan.com
Avalanche
Chain ID: 43114
Network:
Explorer: https://snowtrace.io
Network:
avalancheExplorer: https://snowtrace.io
BNB Chain
Chain ID: 56
Network:
Explorer: https://bscscan.com
Network:
bnbExplorer: https://bscscan.com
Lens
Chain ID: 232
Network:
Explorer: https://explorer.lens.xyz
Network:
lensExplorer: https://explorer.lens.xyz
Testnet Support
testnets.py
Chain Properties
EachChain enum provides useful properties:
chain_properties.py
Chain-Specific Configuration
Different operations require chain-specific configurations:Selecting a Chain for Trading
chain_trading.py
Chain-Specific Contract Addresses
The SDK maintains chain-specific contract addresses:chain_contracts.py
Working with Chain IDs
SupportedChainId Enum
chain_id.py
Multi-Chain Order Management
Create and manage orders on different chains:multichain_orders.py
Composable Orders Across Chains
Create conditional orders on different networks:multichain_twap.py
Contract Interaction Across Chains
Interact with contracts on different chains:multichain_contracts.py
RPC Provider Configuration
Configure Web3 providers for different chains:multichain_providers.py
API Configuration Per Chain
Configure API clients for different chains:api_config_multichain.py
Chain Detection and Validation
chain_validation.py
Best Practices
Use Chain-Specific Token Addresses
Use Chain-Specific Token Addresses
Token addresses differ across chains. Always maintain a mapping of token addresses per chain.
Configure Appropriate RPC Providers
Configure Appropriate RPC Providers
Use reliable RPC providers for each chain. Consider rate limits and latency for your use case.
Handle Chain-Specific Gas
Handle Chain-Specific Gas
Gas prices and confirmation times vary significantly between chains. Adjust your strategies accordingly.
Test on Testnets
Test on Testnets
Use Sepolia for Ethereum testing. Other chains may have their own testnets.
Monitor Chain Health
Monitor Chain Health
Implement monitoring for RPC endpoint health and chain congestion across all chains you support.
Complete Multi-Chain Example
complete_multichain.py
Related Resources
Supported Chains
Learn about chain configuration and properties
Order Management
Create and manage orders across chains
TWAP Orders
Execute TWAP strategies on multiple chains
Contract Interaction
Interact with contracts across networks
