Grant Application: CoW Playground Offline Development Mode
Grant Title:
CoW Playground Offline Development Mode
Author Information
Team: @bleu @yvesfracari @ribeirojose @mendesfabio @lgahdl
About Us:
bleu collaborates with companies and DAOs as a web3 technology and user experience partner. We’re passionate about bridging the experience gap we see in blockchain and web3.
Our work for CoW so far:
[CoW] Python SDK: Python SDK for querying on-chain data, managing orders, and integrating with the CoW Protocol’s smart contracts.
[CoW] Framework Agnostic SDK: Restructured SDK architecture to be more composable with framework-agnostic base packages with EVM adapters.
[CoW] Hook dApps: a set of Hook dApps integrated on the CoW Swap frontend. During this project, we developed the cow-shed module of the @cowprotocol/cow-sdk. This module was created to help developers use CoW Shed to create permissioned hooks.
[CoW] Improving Solver Infrastructure Onboarding (retro round proposal): We propose to improve solver infrastructure and onboarding through updating the solver template, creating a Python baseline, examples & tests, documentation refresh, and tooling & scripts.
Simple Summary
The CoW Protocol Playground currently operates using blockchain forks, requiring constant network access to an archive node. This proposal delivers a self-contained offline development mode focused on core backend engineer needs: testing autopilot/driver changes with realistic DEX liquidity and tokens, without external dependencies.
Goal
This proposal delivers a lightweight development environment for CoW Protocol backend engineers. The current fork-based playground creates barriers due to:
- High infrastructure costs (archive node access)
- Network dependency and latency issues
- Difficulty reproducing specific test scenarios
- Complex setup process for new developers
Benefits for the CoW Ecosystem:
- Lower Barriers to Entry: Backend engineers can test autopilot/driver changes immediately without infrastructure setup
- Improved Testing: Deterministic, reproducible scenarios for solver development and testing
- Cost Reduction: Eliminate ongoing archive node costs for development
- Faster Development Cycles: Instant blockchain state and fast block times for rapid iteration
Milestones
| Milestone | Duration | Payment (xDAI) |
|---|---|---|
| M1 — Proof of Concept (PoC) | COMPLETED | 1,800 xDAI |
| M2 — Core Infrastructure & Periphery Contracts | 4 weeks | 12,000 xDAI |
| M3 — Frontend Integration & Documentation | 1 week | 3,000 xDAI |
| Maintenance | 1 year | 16,800 COW |
Total Duration: 5 weeks
Total Funding: 16,800 xDAI
Maintenance Vesting: 16,800 COW over 1 year
Specification
M1: Proof of Concept - COMPLETED
The PoC phase validated the core concept by establishing a minimal working environment.
- Deploy fundamental contracts (with persistent state): Tokens (WETH, USDC, DAI), UniswapV2, GPv2Settlement, minimal Balancer Vault Mock (for settlement contract requirements)
- Deploy Balances contract for order balance validation
- Auto-generate configuration files (
driver.toml,baseline.toml) from deployment script - Implement state persistence using Anvil’s dump/load capabilities
- Create Docker Compose for offline mode
- Execute end-to-end order settlement tests
Interaction:
- Simple test script to validate that the setup is functional.
Outcome: Validated that CoW Protocol services work with a local blockchain without code modifications.
M2: Core Infrastructure & Periphery Contracts
Expand the foundation to support realistic backend testing scenarios with all necessary periphery contracts:
Token Ecosystem:
- Add additional tokens: USDT, GNO
- Create Uniswap V2 pair coverage for all token combinations (WETH-USDC, WETH-DAI, WETH-USDT, WETH-GNO, stablecoin pairs, etc.)
- Cover all pairs based on mainnet proportions
Periphery Contracts:
- CoWHooksTrampoline for testing hook execution
- CoWShed infrastructure for permissioned hooks management
- CoWShed factory and implementation contracts
- Enable testing of controlled hook access patterns
- Support dApp-specific hook deployment and management
- ComposableCoW framework for conditional orders
- Enable testing of conditional order types (stop-loss, TWAP, limit orders with conditions)
- Deploy ERC1271Forwarder.sol for abstract account support (no Safe wallet required)
- Configure Watch Tower service for monitoring conditional orders
External API Mocking:
- Implement CoinGecko API mock server for offline price fetching
- Configure realistic price feeds for all tokens
Interaction:
- Parameterized swap test script, enabling swap of any token combination (of the 5 deployed)
- Hook creation and execution tests
- Conditional order placement and execution tests
Goal: Provide a testing environment where engineers can test autopilot/driver changes, solver strategies, settlement logic, permissioned hooks, and conditional orders with realistic Uniswap V2 liquidity.
M3: Frontend Integration & Documentation
Provide a simple interface and documentation:
Frontend Adaptation:
- Adapt CoW Swap UI for Anvil chain (chain ID 31337, local RPC)
- Configure local token list and metadata
- Enable order submission, signing, and status tracking
- Test order flow end-to-end
Purpose: Simple way to interact with the system and verify API/orderbook functionality during development.
Interaction:
- The frontend will be enabled to interact with the offline environment directly.
Documentation:
- Setup guide for Docker and local development
- Configuration reference for all services
- State management guide (dump/load, reset procedures)
- Common testing scenarios and examples
- Architecture overview with component interactions
- Troubleshooting guide for common issues
- Forge script examples for smart contract testing
Goal: Deliver production-ready environment with clear documentation enabling backend engineers to start testing immediately.
Maintenance Vesting
- Bug fixes and security updates
- Documentation updates as protocol evolves
- Minor feature adjustments based on feedback
- Community support and issue triage
Deliverables
Our revised proposal focuses on core backend engineering needs:
Core Deliverables
1. Self-Contained Blockchain (RFP Requirement)
- Local Anvil blockchain without forking or external network access
- Offline operation without archive node dependencies
- Fast startup times (seconds, not minutes)
- Minimal resource usage
2. State Management (RFP Requirement)
- Import/export capabilities using Anvil’s dump/load features
- Easy state reset to clean configuration
- JSON-based state snapshots for reproducible testing
- Quick environment restoration (< 5 seconds)
3. Core & Periphery Contract Deployments (RFP Requirement)
Core CoW Protocol contracts:
- GPv2Settlement, GPv2VaultRelayer
- GPv2AllowListAuthentication and other authenticators
- Balances contract for order balance validation
Periphery contracts for testing:
- CoWHooksTrampoline for hook execution testing
- CoWShed factory and implementations for permissioned hooks
- ComposableCoW framework for conditional orders
- ERC1271Forwarder.sol for abstract account support
- All necessary support contracts for realistic testing scenarios
4. DEX Infrastructure (RFP Requirement)
Uniswap V2:
- Factory, Router, and multiple trading pairs
- All major pairs: WETH-USDC, WETH-DAI, WETH-USDT, WETH-GNO
- Stablecoin pairs: USDC-DAI, USDC-USDT, DAI-USDT
- Additional pairs for diverse testing scenarios
- Realistic liquidity depths based on mainnet proportions
- Compatible with existing solver implementations
Balancer V2:
- Minimal Balancer V2 Vault mock (required for settlement contract)
- Sufficient for testing settlement contract interactions
- No liquidity pools (Uniswap V2 provides all liquidity for solver testing)
5. Test Tokens (RFP Requirement)
Pre-configured tokens with liquidity:
- WETH, USDC, DAI, USDT, GNO
- Established pools for all common pairs
- Pre-funded test accounts for immediate testing
- Sufficient balances for solver testing
6. Configuration (RFP Requirement)
Easy setup and switching:
docker-compose.offline.yml- Service orchestration:- Anvil local blockchain node
- Autopilot, Driver, OrderBook API, Baseline Solver
- Watch Tower for monitoring conditional orders
- CoinGecko API mock server
- Auto-generated configuration files from deployment script
- One-command startup:
docker-compose -f docker-compose.offline.yml up - Works alongside existing fork mode setup
7. Mock External APIs
- CoinGecko API mock server for offline price fetching
- Configurable price feeds for testing price-dependent features
- Eliminates external API dependencies
8. Frontend Adaptation
- CoW Swap UI configured for Anvil chain (chain ID 31337)
- Simple interface for placing orders and checking API functionality
- Basic order submission and status tracking
- Useful for quick manual testing during development
9. Documentation (RFP Requirement)
Documentation for backend engineers:
- Quick start guide for Docker setup
- Configuration reference for all services
- State management guide (dump/load, reset)
- Testing scenarios and Forge script examples
- Architecture overview showing component interactions
- Troubleshooting guide for common issues
- Contributing guide for future enhancements
Proof of Concept (Completed)
A functional PoC has been completed and validated, demonstrating:
- Local Anvil blockchain with CoW Protocol core contracts
- Balances contract for order validation
- Auto-generated configuration files (driver.toml, baseline.toml)
- State persistence using Anvil dump/load capabilities
- Uniswap V2 DEX with liquidity
- Working Autopilot, Driver, and Baseline Solver
- Successful end-to-end order settlement
Deployment Diagram
Architecture Diagram
Note: Services in pink/red (Autopilot, Driver, Orderbook, Baseline Solver, Watch Tower) are existing CoW Protocol services that require no code changes. The CoinGecko API Mock (gold) is a new mock service for offline price fetching.
Method
Technical Approach
We propose a deployment-based approach that:
- Deploys contracts from scratch using deterministic CREATE2
- Persists Anvil state in JSON for quick reuse
- Auto-generates configuration files for all services
- Provides simple state management (dump/load/reset)
Implementation Strategy
- Contract Deployment: Foundry scripts with CREATE2 for deterministic addresses
- Service Configuration: Template-based auto-generation from deployment
- Docker Orchestration: Single
docker-compose.offline.ymlfor environment setup - State Management: JSON-based state with simple reset capabilities
- Testing Framework: Example Forge scripts and test scenarios
Open Source Commitment
All code will be open-source from day 0. We’re open to feedback during PRs and will maintain the codebase according to CoW Protocol standards.
Long-term Sustainability
Maintenance Plan:
- 1-year maintenance through COW token vesting (16,800 COW)
- Bug fixes and security updates
- Documentation updates as protocol evolves
- Community support and issue triage
Community Ownership:
- All code contributed to CoW Protocol repositories
- Documentation enables community contributions
- Clear architecture enables future extensions
Evaluation Criteria
Per the RFP, our revised proposal addresses all evaluation criteria with focused scope:
1. Technical Approach
- Anvil blockchain: Fast, deterministic, well-documented
- Foundry deployment: Reproducible, CREATE2-based deterministic deployments
- Docker Compose: Industry-standard orchestration
- JSON state management: Simple dump/load/reset capabilities
- Proven in PoC: Working implementation validates feasibility
2. Resource Efficiency
- Minimal footprint: ~MB of storage
- Fast startup: Environment ready in seconds
- Low memory: No archive node requirements
- CPU efficient: Minimal computational resources
- Cost savings: Eliminates archive node costs (~$500-1000/month)
3. Ease of Use
- One-command startup:
docker-compose -f docker-compose.offline.yml up - Works alongside fork mode: No disruption to existing workflows
- Pre-configured: Auto-generated configs, no manual setup
- Simple state reset: Quick clean environment restoration
- Clear documentation: Step-by-step guides for backend engineers
4. Solver Compatibility
- No code changes: Existing solvers work out-of-the-box
- Realistic liquidity: Sufficient depth for strategy testing
- Uniswap V2 coverage: Most common DEX for baseline testing
- Standard interfaces: Production-specification contracts
- PoC validated: Baseline solver successfully finding settlements
5. DEX and Liquidity Configuration
- Uniswap V2 coverage: All major trading pairs with realistic liquidity
- Full pair coverage: WETH pairs, stablecoin pairs, and cross-token pairs
- Realistic liquidity: Based on mainnet proportions for authentic testing
- Balancer V2 Vault: Minimal mock for settlement contract requirements
- Configurable: Adjustable liquidity for different testing scenarios
- Production-ready: Sufficient depth for realistic solver strategy testing
6. Maintenance Requirements
- 1-year COW vesting: 16,800 COW for maintenance and support
- Bug fixes and security updates: Responsive to issues
- Documentation maintenance: Keep pace with protocol changes
- Community support: Active issue triage
- Low maintenance burden: Deterministic deployments minimize drift
7. Documentation Quality
- Backend-focused guides: Setup, configuration, testing
- Architecture overview: Clear component interactions
- Forge script examples: Practical testing scenarios
- State management: Dump/load/reset procedures
- Troubleshooting: Common issues and solutions
8. Cost and Timeline
- Total cost: $16,800 xDAI development + 16,800 COW (1-year vesting) maintenance
- Timeline: 5 weeks from start to delivery
- PoC completed: De-risks timeline with validated proof
- Transparent breakdown: Clear costs and deliverables
- Scope: Uniswap V2 with realistic liquidity, all periphery contracts including hooks, CoWShed, ComposableCoW, and Watch Tower
Values of Grants DAO and its Grants
Our revised proposal aligns with Grants DAO values:
- Open Source: All code open-sourced in CoW Protocol repositories
- Clear Milestones: 3 focused phases with specific, verifiable deliverables
- Price Transparency: Phase-by-phase breakdown aligned with scope
- Sustainability: 1-year maintenance through COW vesting
- Simplicity: Focused on core backend engineer needs, no unnecessary complexity
- Documentation: Guides for immediate productivity
- Responsiveness: Revised scope based on DAO feedback
Length
We estimate completion of this revised project will require 5 weeks.
This covers core infrastructure deployment, periphery contracts (hooks infrastructure, CoWShed, ComposableCoW with ERC1271Forwarder), Watch Tower configuration, basic frontend adaptation, and documentation. The scope focuses on backend engineer needs with realistic Uniswap V2 liquidity and all periphery contracts for testing hooks and conditional orders.
Funding Request
The total funding requested for this project is 16,800 xDAI, to be released upon approval of each milestone.
Budget Breakdown:
The budget reflects the scope focused on backend engineer needs with all necessary periphery contracts:
M1 - PoC (COMPLETED): 1,800 xDAI (0.6 weeks)
M2 - Core Infrastructure & Periphery: 12,000 xDAI (4 weeks)
M3 - Frontend & Documentation: 3,000 xDAI (1 week)
The budget accounts for:
- Deployment of core CoW Protocol contracts and all periphery contracts
- Uniswap V2 with all pair combinations and realistic liquidity
- Minimal Balancer V2 Vault mock for settlement contract
- CoWHooksTrampoline, CoWShed, ComposableCoW, and ERC1271Forwarder
- Watch Tower configuration for conditional order monitoring
- State management tooling and environment orchestration
- Basic frontend adaptation for API verification
- Documentation
CAP:
The total CAP for this grant is 16,800 xDAI + 16,800 COW.
No additional funding will be requested beyond this amount as part of this proposal.
Payment Information
Gnosis Chain Address: 0x554866e3654E8485928334e7F91B5AfC37D18e04
Additional Information
The 1-year maintenance vesting (16,800 COW) ensures ongoing support for the backend engineering community. We’re committed to maintaining high code quality and responsiveness to community feedback.
Terms and Conditions
By submitting this grant application, we acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW Grant Terms and Conditions.

