Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cowprotocol/solver-rewards/llms.txt

Use this file to discover all available pages before exploring further.

The CoW Protocol Solver Rewards pipeline is a Python data pipeline that computes and distributes weekly solver reimbursements and COW token rewards. Each week the pipeline aggregates on-chain and off-chain data — execution costs, slippage, batch rewards, quote rewards, protocol fees, and partner fees — and produces signed multi-send transactions or CSV transfer files ready for the CoW Protocol team Safe.

What the pipeline does

Solvers on CoW Protocol submit and settle trade batches. At the end of every accounting period (a rolling 7-day window, evaluated each Tuesday), the pipeline:
  1. Queries the analytics database (fct_data_per_solver_and_accounting_period, fct_partner_and_protocol_fees) for each solver’s batch rewards, quote rewards, slippage, protocol fees, and network fees across both prod and staging orderbook environments.
  2. Fetches supplementary data from Dune Analytics to determine the block range for the period and validate on-chain figures.
  3. Computes payouts — primary rewards in COW tokens, native-token reimbursements for execution costs and slippage, protocol fee forwarding to the protocol fee Safe, and partner fee distributions including a CoW DAO tax.
  4. Detects overdrafts — solvers whose net payout is negative are recorded in the on-chain overdrafts contract (0x8Fd67Ea651329fD142D7Cfd8e90406F133F26E8a) rather than receiving a transfer.
  5. Outputs results either as CSV transfer files in the out/ directory (for manual Safe upload) or as a multisend transaction posted directly to the CoW Team Safe via the Safe Transaction Service API.
  6. Posts a Slack notification to the configured channel with transaction nonces and Safe queue links.
Accounting periods are defined as StartTime <= block_time < EndTime with a default length of 7 days.

Who uses it

  • CoW Protocol team — responsible for running the pipeline each Tuesday, validating results against the Dune dashboard, and executing the multi-send transaction through the proposer account (0xd8Ca5FE380b68171155C7069B8df166db28befdd).
  • Solver operators — receive COW token rewards and native-token reimbursements as a result of each weekly run. Operators in the CoW DAO bonding pool (0x5d4020b9261f01b6f8a45db929704b0ad6f5e9e6), Rizzolver bonding pool (0x0deb0ae9c4399c51289adb1f3ed83557a56df657), or Fractal bonding pool (0x7719c9c0d35d460b00487a1744394e9525e8a42c) have their buffer accounting routed to their reward_target address.

Supported networks

The pipeline supports payout computation across all networks where CoW Protocol operates:
NETWORK valueChain
mainnetEthereum Mainnet
gnosisGnosis Chain
arbitrumArbitrum One
baseBase
avalancheAvalanche C-Chain
polygonPolygon
bnbBNB Smart Chain
lineaLinea
plasmaPlasma Mainnet
inkInk
COW token rewards are always settled on Ethereum Mainnet regardless of the source chain. Native-token reimbursements are settled on the chain specified by NETWORK.

Weekly accounting cycle

The pipeline is run on a fixed weekly cadence:
  1. The accounting period ends at Tuesday 00:00 UTC.
  2. The team waits for on-chain data to finalize — price feeds (prices.usd), Ethereum transactions, and event logs can lag by several hours.
  3. The payout script is run, generating a transfer file or posting directly to the Safe.
  4. Results are cross-checked against the Dune dashboard.
  5. The multi-send transaction is executed by the proposer account and team members are informed in the #dev-multisig Slack channel.
Do not run the payout script immediately after the accounting period ends. On-chain data sources such as prices.usd and ethereum.transactions can take time to finalize. Running the script too early may produce incorrect payout amounts.

Prerequisites

The following credentials and services are required before running the pipeline:
  • Python >= 3.10 — the codebase uses match/case statements introduced in Python 3.10. A Docker image based on Python 3.12 is provided for environments where upgrading is not possible.
  • Dune API key — used to query on-chain data through the Dune Analytics API (DUNE_API_KEY).
  • Analytics DB access — connection string for the CoW Protocol analytics PostgreSQL database, which exposes pre-computed dbt tables (ANALYTICS_DB_URL).
  • Ethereum node — an RPC endpoint for the target network (NODE_URL) and always a Mainnet endpoint (NODE_URL_MAINNET), used by the Safe transaction service client.
  • Safe API key — required when posting transactions to the Safe Transaction Service (SAFE_API_KEY).
  • Proposer private key — only needed when using --post-tx to sign and submit the multisend transaction (PROPOSER_PK).

Next steps

Quickstart

Install dependencies, configure your environment, and generate your first transfer file.

Configuration

Full reference for every environment variable and how AccountingConfig is assembled at runtime.

Build docs developers (and LLMs) love