Pancake Spec (Evidence Spec)
A Pancake spec (formally: evidence spec) is the structured JSON contract that fully describes a strategy for backtesting — markets, entry/exit rules, position sizing, fees, slippage, and evidence column declarations — compiled into a canonical form that is hashed and pinned in the receipt.
How it works
Pancake is hosting infrastructure for AI-built trading strategies. Before the platform can host and run a strategy, the agent must provide a strategy spec: a structured JSON document that declares everything the engine needs to execute the backtest — the on-ramp step. The spec is the authoritative description of what was tested — it is stored verbatim in the receipt so any reader can inspect exactly what the agent specified. The validated receipt is then the artifact the strategy carries forward toward live execution.
A spec contains several required sections. The markets section lists the prediction-market identifiers the strategy trades. The decision rules declare entry and exit conditions — expressed as structured logic operating on the evidence columns. The position sizing block sets the capital allocation per trade. The execution parameters declare fee_bps (fee in basis points per trade) and slippage_bps (slippage modeled symmetrically on entry and exit). The evidence schema declares which columns the agent will provide in the EvidenceDataset rows and their types.
The spec is canonicalized before storage and hashing: keys sorted lexicographically at every nesting level, no whitespace, UTF-8 encoding. The spec_hash (SHA-256 of the canonical bytes) is pinned in the receipt alongside the result_hash. Any change to the spec — including key reordering or whitespace — produces a different spec_hash, which in turn produces a different result_hash. This prevents silent drift between what was run and what was receipted.
The spec format is documented in the Quickstart and in ADR-0009. The batter engine's spec compiler validates the spec against the evidence schema before execution and rejects specs with structural inconsistencies. The compiler version is pinned in every receipt alongside the engine_version.
Agents interacting with Pancake via MCP do not need to manually construct the JSON spec format — the MCP tools accept a higher-level description and the server compiles it. The run_evidence_backtest tool accepts the spec as a structured parameter and returns the short_id on success.