CoW Protocol is an open-source, permissionless trading protocol that settles user intents in batch auctions. It supports direct matching between users (Coincidence of Wants) as well as on-chain liquidity sources.
This repository hosts the Solana implementation, currently in early development. The protocol is already live on Ethereum and other EVM chains; the Solidity contracts are at cowprotocol/contracts.
The design of the program is documented in DESIGN.md. It contains a high-level technical description of what the program does and points out meaningful differences from the Ethereum implementation.
Install the Solana toolchain (Rust, Solana CLI, and friends) by following the Solana quick setup.
Common dev tasks are exposed via just recipes (see Justfile).
Most package managers provide this package, see list of available Just packages.
Run just --list to see what's available.
The repository is a Cargo workspace following the program / client / interface split:
interface/: shared types and theInstructionbuilders. Depends only on the lightweight crates so it can be consumed from both on-chain and off-chain code.programs/settlement/: the on-chain settlement program.client/: off-chain client helpers that re-export the builders frominterfaceand add small convenience wrappers.
Build the on-chain program (produces target/deploy/settlement.so):
just build-programBuild everything (workspace crates plus the on-chain program):
just buildjust testRequires Docker.
just build-verifiedRequires Docker (for the verified build step).
You will need a deployer keypair — a Solana wallet funded with enough SOL to cover program storage rent and transaction fees. This wallet becomes the upgrade authority for the deployed program.
Do not fund the program address itself. Only the deployer wallet needs SOL.
There are two distinct flows depending on whether this is a first-time deploy or an upgrade to an existing program.
Pass the program keypair file as the first argument. Solana derives the program address from it and registers the deployer as the upgrade authority:
just deploy ./program-keypair.json ./deployer-keypair.jsonPass the program's public key (address) as the first argument. The deployer wallet must already be the upgrade authority:
just deploy MooohhPEAAHwAwEozL7JPEmnDvaahuUpccYN4Yb8ccK ./deployer-keypair.jsonsolana config set --url devnet
just deploy MooohhPEAAHwAwEozL7JPEmnDvaahuUpccYN4Yb8ccK ~/solana-keys/deployer.jsonThe deployer for the canonical devnet program (MooohhPEAAHwAwEozL7JPEmnDvaahuUpccYN4Yb8ccK) is stored in the team password manager under B6acm3swJK9pJ7fe4i4GQgP7x5A3RndvsdV2bKhcA1i5.