Indexes on-chain events from CoW Protocol's ComposableCoW contract, decodes programmatic order types (TWAP, Stop Loss, Perpetual Swap, Good After Time, Trade Above Threshold), and serves the data through a GraphQL API. Built with Ponder by @bleu for CoW Protocol.
- Ponder 0.16.x -- blockchain indexing framework
- TypeScript
- viem -- Ethereum interactions and ABI encoding
- Hono -- API routing
- PostgreSQL
Requires Node.js >= 18.14, pnpm, and Docker.
git clone https://github.com/bleu/cow-programmatic-orders-api.git
cd cow-programmatic-orders-api
pnpm installCopy the env file and configure your RPC endpoints:
cp .env.example .env.localOpen .env.local and set MAINNET_RPC_URL and GNOSIS_RPC_URL.
Start PostgreSQL and run the indexer:
docker compose up -d
pnpm devThe GraphQL API is at http://localhost:42069 once the dev server starts.
| Command | What it does |
|---|---|
pnpm dev |
Start the indexer in dev mode |
pnpm start |
Start in production mode |
pnpm codegen |
Regenerate types after config or schema changes |
pnpm typecheck |
Run TypeScript type checking |
pnpm lint |
Run ESLint |
pnpm test |
Run tests |
- docs/api-reference.md -- Endpoints overview (GraphQL, SQL, REST). OpenAPI/Swagger for custom REST routes lives at
/docswhen the API is running. - docs/architecture.md -- System internals, data flow, schema design
- docs/deployment.md -- Production setup and configuration
- docs/supported-order-types.md -- Decoded order types and their parameters
Open source.