Skip to main content

Introduction

An overview of the CoW Protocol Watch Tower for monitoring and executing programmatic orders

What is Watch Tower?

The Watch Tower is a standalone application that monitors the blockchain for programmatic orders created through the CoW Protocol programmatic order framework. It acts as a critical infrastructure component that bridges on-chain programmatic orders with the CoW Protocol OrderBook API.
“Watch Tower keeps an eye on Composable Cows, automatically detecting new programmatic orders and posting eligible discrete orders to the orderbook.”

Why does it exist?

Programmatic orders in CoW Protocol allow users to define trading logic on-chain through smart contracts. However, these orders need to be:
  1. Discovered - The watch tower monitors blockchain events to detect when new programmatic orders are created
  2. Evaluated - It continuously polls programmatic orders to check if their execution conditions are met
  3. Submitted - When conditions are satisfied, it posts the resulting discrete orders to the CoW Protocol OrderBook API
Without the watch tower, programmatic orders would remain dormant on-chain with no mechanism to activate them when their conditions are met.

How it fits into CoW Protocol

The watch tower serves as the execution layer in CoW Protocol’s programmatic orders architecture: The watch tower operates as a decentralized service - anyone can run their own instance to monitor specific addresses or provide redundancy for the network.

Key capabilities

Event monitoring

The watch tower tracks two primary events emitted by the ComposableCoW contract:
  • ConditionalOrderCreated - Emitted when a single programmatic order is created
  • MerkleRootSet - Emitted when a batch of programmatic orders (merkle tree) is set for a safe

Persistent registry

All discovered programmatic orders are stored in a local LevelDB database, maintaining:
  • Active programmatic orders by owner (safe address)
  • Order parameters and merkle proofs
  • Last processed block information
  • Submitted discrete order status
The watch tower uses LevelDB for its ACID guarantees. If a write fails, the application exits and automatically re-processes from the last successful block on restart, ensuring eventual consistency.

Continuous polling

For each registered programmatic order, the watch tower:
  1. Calls the order’s poll method with current block context
  2. Evaluates if trading conditions are satisfied
  3. Submits discrete orders to the OrderBook API when conditions are met

Multi-chain support

The watch tower can monitor multiple chains simultaneously, including:
  • Ethereum Mainnet
  • Arbitrum One
  • Gnosis Chain
  • Base
  • Sepolia (testnet)

Use cases

For protocol integrators

Run your own watch tower instance to:
  • Monitor specific safe addresses or contracts
  • Ensure reliable execution of your users’ programmatic orders
  • Maintain independence from third-party infrastructure

For DApp node operators

The watch tower is available as a DAppNode package, allowing you to:
  • Contribute to CoW Protocol’s decentralized infrastructure
  • Provide redundancy for programmatic order execution
  • Support the ecosystem while earning potential rewards

For development and testing

Use the watch tower locally to:
  • Test programmatic order implementations
  • Debug programmatic order logic
  • Validate order execution flow
Programmatic order types may consume considerable RPC calls. Ensure you have access to a reliable RPC endpoint with sufficient rate limits when running a watch tower instance.

Getting started

The watch tower can be deployed in several ways:
docker run --rm -it \
  -v "$(pwd)/config.json:/config.json" \
  ghcr.io/cowprotocol/watch-tower:latest \
  run \
  --config-path /config.json

Local development

# Install dependencies
yarn

# Run watch tower
yarn cli run --config-path ./config.json

DAppNode

Install the CoW Watch Tower package directly from the DAppNode package manager.

Requirements

To run your own watch tower instance, you’ll need:
  • RPC node - Connected to your target chain(s) with sufficient rate limits
  • Internet access - To communicate with the CoW Protocol OrderBook API
  • Storage - For the LevelDB database (default: ./database)
  • Configuration - A valid config.json specifying your deployment settings
The deployment-block configuration refers to the block number where the ComposableCoW contract was deployed. This optimizes the watch tower by only fetching events after this block.
See Deployed Contracts for block numbers on each chain.

Next steps

Last modified on March 12, 2026