The pipeline is configured entirely through environment variables, loaded viaDocumentation 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.
python-dotenv at import time in src/config.py. Copy .env.sample to .env and fill in the required values before running any script.
Network setup
The network to run accounting for. Must be one of:
mainnet, gnosis, arbitrum, base, avalanche, polygon, bnb, linea, plasma, ink.This value determines which network-specific reward caps, Safe addresses, wrapped token addresses, and Dune blockchain identifiers are used. COW token rewards are always settled on Ethereum Mainnet regardless of this value.RPC endpoint URL for the network specified by
NETWORK. Used by the Safe Ethereum client when building and submitting native-token multisend transactions.RPC endpoint URL for Ethereum Mainnet. Required even when
NETWORK is not mainnet because COW token transfers are always executed on Mainnet.Dune Analytics
API key for Dune Analytics. Used by
DuneFetcher to execute parameterized queries that retrieve on-chain block ranges and supplementary solver metrics.Obtain a key from dune.com under your account settings.Safe / payment
Checksum address of the Safe on the target
NETWORK used for native-token reimbursements. Defaults to the CoW Protocol payout Safe.Checksum address of the Safe on Ethereum Mainnet used for COW token transfers. Defaults to the CoW Protocol payout Safe.
Private key of the proposer account used to sign and submit multisend transactions to the Safe Transaction Service. Only required when running with
--post-tx.The expected proposer account is 0xd8Ca5FE380b68171155C7069B8df166db28befdd.API key for the Safe Transaction Service (
https://developer.safe.global). Required when posting transactions to the Safe API via --post-tx.Slack notifications
Slack bot token used by the
slackclient library to post notifications. When --post-tx is set and the transaction is submitted, a message with Safe queue URLs and transaction nonces is posted to SLACK_CHANNEL.Slack channel ID where payout notifications are posted. The CoW Protocol team uses
#dev-multisig for payout transaction alerts.Database
Connection string for the CoW Protocol analytics PostgreSQL database, excluding the database name. The pipeline appends
/{environment}_{network} (e.g. prod_mainnet, staging_xdai) dynamically to target each environment.The URL must not include a trailing database name. The pipeline constructs the full connection string by appending /{environment}_{network_db_name} (e.g. prod_mainnet, staging_xdai) at runtime.The database must expose the dbt schema with the following tables:fct_data_per_solver_and_accounting_periodfct_partner_and_protocol_fees
Connection string for the CoW Protocol staging (barn) orderbook PostgreSQL database. Used in legacy or direct-query contexts.
Connection string for the CoW Protocol production orderbook PostgreSQL database. Used in legacy or direct-query contexts.
Output path
Directory where CSV transfer files are written. Defaults to
./out relative to the project root. The directory is created if it does not exist.AccountingConfig and sub-configs
All environment variables are consumed through a hierarchy of frozen dataclasses defined in src/config.py. The top-level object is AccountingConfig, assembled via AccountingConfig.from_network(network).
AccountingConfig.from_network(network: Network)
The factory method composes all sub-configs for the given network and returns a single frozen AccountingConfig instance:
from_network() or from_env() static method:
| Sub-config | Factory | Source |
|---|---|---|
PaymentConfig | from_network(network) | PAYOUTS_SAFE_ADDRESS, PAYOUTS_SAFE_ADDRESS_MAINNET, PROPOSER_PK, network-specific token addresses |
OrderbookConfig | from_network(network) | ANALYTICS_DB_URL, network-derived network_db_name, schema dbt |
DuneConfig | from_network(network) | DUNE_API_KEY, network-derived dune_blockchain |
NodeConfig | from_env() | NODE_URL, NODE_URL_MAINNET |
RewardConfig | from_network(network) | Network-specific quote_reward_cow, quote_reward_cap_native, service fee 15% |
ProtocolFeeConfig | from_network(network) | Protocol fee Safe 0x22af3D38E50ddedeb7C47f36faB321eC3Bb72A76 (all networks) |
BufferAccountingConfig | from_network() | Hardcoded bonding pool addresses |
IOConfig | from_env() | NETWORK, SLACK_CHANNEL, SLACK_TOKEN, derived project paths |
OverdraftConfig | from_network(network) | Overdrafts contract 0x8Fd67Ea651329fD142D7Cfd8e90406F133F26E8a (all networks) |
Reward parameters by network
TheRewardConfig sets the COW quote reward and a per-network native-token cap. The service fee is fixed at 15% across all networks (service_fee_factor = Fraction(15, 100)).
| Network | quote_reward_cow | quote_reward_cap_native |
|---|---|---|
mainnet | 6 COW | 0.0007 ETH |
gnosis | 6 COW | 0.15 xDAI |
arbitrum | 6 COW | 0.00024 ETH |
base | 6 COW | 0.00024 ETH |
avalanche | 6 COW | 0.006 AVAX |
polygon | 6 COW | 0.0006 POL |
bnb | 6 COW | 0.001 BNB |
linea | 6 COW | 0.00003 ETH |
plasma | 6 COW | 0.0006 XPL |
ink | 6 COW | 0.00003 ETH |
Minimum transfer thresholds
Transfers below the following amounts are excluded from the final output. Thresholds are set inPaymentConfig:
| Network | Min native-token transfer | Min COW transfer |
|---|---|---|
mainnet | 0.001 ETH | 10 COW |
gnosis | 0.01 xDAI | 1 COW |
arbitrum | 0.0001 ETH | 1 COW |
base | 0.0001 ETH | 1 COW |
avalanche | 0.0001 AVAX | 1 COW |
polygon | 0.0001 POL | 1 COW |
bnb | 0.0001 BNB | 1 COW |
linea | 0.0001 ETH | 1 COW |
plasma | 0.0001 XPL | 1 COW |
ink | 0.0001 ETH | 1 COW |
Buffer accounting pools
Solvers whose bonding pool address appears in the following list have their buffer accounting results forwarded to theirreward_target address instead of the solver submission address:
0x5d4020b9261f01b6f8a45db929704b0ad6f5e9e6— CoW DAO bonding pool0x0deb0ae9c4399c51289adb1f3ed83557a56df657— Rizzolver bonding pool0x7719c9c0d35d460b00487a1744394e9525e8a42c— Fractal bonding pool
BufferAccountingConfig.from_network() and applies to all networks.