Grant Application - CoW Playground Offline Development Mode

Grant Title

“Grant Application - CoW Playground Offline Development Mode”


Author(s)

Team: @bleu
Core contributors: @yvesfracari, @ribeirojose, @mendesfabio, @lgahdl


Experiences and qualifications

bleu collaborates with companies and DAOs as a web3 technology and user experience partner. We focus on bridging the UX gap in blockchain and web3 by building robust infrastructure and intuitive developer and user tooling.

Relevant CoW work:

  • [CoW] Framework-Agnostic SDK – Restructured SDK architecture into composable, framework-agnostic base packages with EVM adapters.
  • [CoW] Hook dApps – Set of Hook dApps integrated on the CoW Swap frontend. As part of this, we developed the cow-shed module of @cowprotocol/cow-sdk to help developers use CoW Shed for permissioned hooks.

Grant Description

The current CoW Protocol Playground relies on blockchain forks and continuous access to an archive node. This introduces:

  • High infrastructure costs (archive node access)
  • Network dependency and latency
  • Complex onboarding for new developers
  • Difficulty reproducing test scenarios

This grant delivers a self-contained, offline development mode for the CoW Playground, based on a local Anvil blockchain with all required CoW contracts and DEX infrastructure deployed from scratch and persisted as a reusable chain state.

Core idea:
Provide a deterministic, lightweight, and fully offline playground where developers can:

  • Spin up a local CoW environment via docker-compose
  • Interact with CoW services (Autopilot, Driver, Orderbook, Baseline Solver, Watch-Tower) without any code changes
  • Test solver strategies against realistic multi-DEX liquidity (Balancer, Uniswap V2/V3, Curve)
  • Use test tokens and pre-configured pools in reproducible scenarios
  • Save and restore chain state via JSON snapshots

Goals and impact for CoW Protocol:

  • Lower barriers to entry: No archive nodes, no external RPCs; developers can start with a single command.
  • Improved testing: Deterministic, reproducible test environments with state import/export.
  • Cost reduction: Eliminate recurring infra costs for archive nodes for development.
  • Faster innovation: Instant local state, fast block times, and quick reset cycles accelerate solver and integration experiments.
  • Educational value: A complete reference deployment/architecture for CoW Protocol that newcomers can explore locally.

Technically, we use:

  • Anvil as the local EVM chain
  • Foundry scripts for deterministic deployments
  • Docker Compose for orchestrating all CoW services plus a CoinGecko API mock
  • JSON-based state management for snapshotting and restoring the chain state
  • Front-end configuration so CoW Swap UI can talk to the local chain (chain ID 31337)

Architecture Overview

Below is a high-level view of the system and delivery phases, to illustrate how the offline playground is structured and shipped.

Deployment Diagram

Architecture Diagram


Type of Grant

Hybrid grant:

  • Milestone-based for the development & delivery of the offline playground (M1–M6).
  • Time-based for the 1-year maintenance & support phase (vesting in COW).

Milestones

(*) “Due date” expressed relative to commencement date (successful passing of the proposal on Snapshot).

Milestone Title Due date (*) Funding request
M1 Proof of Concept (PoC) Already completed (PoC done) 1,800 xDAI
M2 Foundation Expansion Within 2 weeks of commencement 6,000 xDAI
M3 CoW Infrastructure Deployment Within 6 weeks of commencement 12,000 xDAI
M4 Additional DEX Integrations (Uniswap V3, Balancer, Curve) Within 9 weeks of commencement 9,000 xDAI
M5 Frontend Adaptation Within 10.5 weeks of commencement 4,500 xDAI
M6 Integration, Testing & Documentation Within 12 weeks of commencement 4,500 xDAI
Maint. 1-year Maintenance & Support Over 12 months after main delivery 37,800 COW (vesting)

Total funding (development): 37,800 xDAI
Maintenance: 37,800 COW vested over 1 year


Milestone 1 – Proof of Concept (PoC) – COMPLETED

Scope & tasks

  • Deploy fundamental contracts on a local Anvil chain, with persistent state:
    • Tokens
    • Uniswap V2
    • Mocked BalancerVault
    • GPv2Settlement
  • Create a basic docker-compose configuration for offline mode.
  • Execute end-to-end order settlement tests using Autopilot, Driver and Baseline Solver.

Deliverables

Outcome and significance

  • Validates that CoW Protocol services work seamlessly with a local blockchain without code modifications.
  • De-risks the technical approach and provides a concrete base to extend into the full offline playground.

Milestone 2 – Foundation Expansion

Scope

  • Expand the token and infra foundations:
    • Add additional tokens (e.g. USDT, GNO)
    • Deploy MulticallV3 for efficient batch queries
    • Create additional Uniswap V2 pairs
    • Implement a CoinGecko API mock for offline price fetching

Deliverables

  • A richer token ecosystem mirroring real-world scenarios.
  • Working CoinGecko mock integrated with CoW services.

Milestone 3 – CoW Infrastructure Deployment

Scope

  • Deploy advanced CoW infrastructure components:
    • CoWHooksTrampoline
    • CoWShed factory and implementations
    • ComposableCoW contracts for programmatic orders

Deliverables

  • Fully functioning local environment supporting:
    • Conditional orders
    • Hooks flows
    • Safe-based trading via CoWShed
    • ComposableCoW programmatic orders

Milestone 4 – Additional DEX Integrations

Scope

Expand DEX liquidity sources for realistic solver testing:

  • Uniswap V3
    • Factory, Router, Position Manager
    • Concentrated liquidity pools
  • Balancer
    • Real Balancer V2 Vault deployment (replacing mock)
    • Weighted and Stable pools with liquidity
  • Curve
    • AddressProvider, MetaRegistry, factories
    • StableSwap and CryptoSwap pools

Deliverables

  • Multiple DEXs deployed locally with configured liquidity pools, suitable for realistic solver optimization and multi-DEX settlement paths.

Milestone 5 – Frontend Adaptation

Scope

  • Adapt the CoW Swap UI to work against the offline environment:
    • Configure frontend for Anvil chain (chain ID 31337, local RPC)
    • Use local token list and metadata
    • Point RPC/API endpoints to local services

Deliverables

  • A fully functional CoW Swap UI, capable of:
    • Submitting orders to the offline environment
    • Signing and tracking order status end-to-end

Milestone 6 – Integration, Testing & Documentation

Scope

  • Integrate all components and create a robust test and documentation layer:
    • Configure Driver, Baseline Solver, Watch-Tower
    • End-to-end tests for:
      • Limit & market orders
      • ComposableCoW conditional orders
      • Hook execution via CoWHooksTrampoline
      • Multi-DEX settlements (Balancer, Uniswap V2/V3, Curve)
      • Safe-based trading via CoWShed
    • Documentation for setup, usage, and troubleshooting

Deliverables

  • Fully integrated offline playground with:
    • Comprehensive test suite
    • Clear, step-by-step documentation
    • Architecture and state management guides

Scope of Work

Time-Based Component: 1-year Maintenance

The maintenance component is funded in COW tokens and covers:

  • Bug fixes & security updates
    • Address issues raised by users and the CoW team
    • Keep deployments aligned with upstream protocol changes
  • Documentation & examples
    • Update docs when APIs or flows evolve
    • Add new example scenarios as needed
  • Support & triage
    • Respond to community issues in repositories
    • Provide guidance for teams using the offline playground

Expected effort / unit of time

  • Approx. ~4–6 hours per month over 12 months, flexibly used for:
    • Issue triage and fixes
    • Updating deployment scripts
    • Documentation and small improvements

The time-based grant is compensated via 37,800 COW vesting over 1 year, acting as a cap and aligning incentives for long-term sustainability.


Length

  • Commencement date:
    Upon successful passing of this proposal on Snapshot.
  • Development & delivery (M1–M6):
    Estimated completion within ~3 months (≈12 weeks) from commencement.
  • Maintenance period:
    12 months after the main delivery, covered by COW vesting.

This is within the standard 6-month limit for the main grant work; the separate maintenance stream is clearly scoped and capped.


Funding Request

Total development funding requested:
37,800 xDAI, milestone-based and disbursed upon successful completion of each milestone (M1–M6).

Maintenance funding requested:
37,800 COW, vested over 1 year, for ongoing maintenance and support.

Justification (development):

The budget reflects:

  • Full-time software engineering effort over the development period
  • Complex deterministic deployment of all CoW infra and multi-DEX stack
  • State management tooling, configuration generation, and Docker orchestration
  • Frontend integration and end-to-end testing
  • Comprehensive documentation and architecture design

CAP (maximum funding under this grant):

  • 37,800 xDAI (development)
  • 37,800 COW (maintenance, vested)

No additional funding will be requested beyond this amount as part of this proposal.


Gnosis Chain Address (to receive the grant)

0x554866e3654E8485928334e7F91B5AfC37D18e04


Other Information (optional)


Terms and Conditions

By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW DAO Grant Agreement Terms.