Documentation Index
Fetch the complete documentation index at: https://cowswap-mintlify-docs-audit-1774430481.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Database Schema
LevelDB key-value structure and data models for the Watch Tower. The Watch Tower uses a NoSQL key-value database to store state about programmatic orders and processing progress.Storage keys
The database uses four primary keys to manage state:LAST_PROCESSED_BLOCK
Stores the last block that was successfully processed by the watch-tower. Structure:CONDITIONAL_ORDER_REGISTRY
Contains the registry of all active programmatic orders grouped by owner (safe address). Structure:ConditionalOrder contains:
id- keccak256 hash of the serialized programmatic ordertx- transaction hash that created the orderparams- the programmatic order parametersproof- merkle proof if part of a merkle root, or null for single ordersorders- map of discrete order UIDs to their status (SUBMITTED or FILLED)composableCow- address to poll for orderspollResult- result of the last poll with timestamp and block number
CONDITIONAL_ORDER_REGISTRY_VERSION
Stores the schema version number of the programmatic order registry. Current version:2
This key is used to migrate the registry when the schema changes. Version 2 added the id field to programmatic orders.
LAST_NOTIFIED_ERROR
Tracks the last time an error notification was sent via Slack. Structure:Data serialization
The database stores complex JavaScript objects (Maps and Sets) by using custom serialization:Mapobjects are serialized with adataType: "Map"markerSetobjects are serialized with adataType: "Set"marker- These are deserialized back to native JavaScript collections on read
Schema versioning
The registry implements forward-compatible schema migrations:- When loading data, the
CONDITIONAL_ORDER_REGISTRY_VERSIONis checked - If the version is older than current, data is migrated in-memory
- The updated version is written back on the next save
id field to all programmatic orders by computing it from the order parameters.