# How does Pancake verify backtests?

Canonical: https://www.usepancake.com/q/how-does-pancake-verify-backtests

**Answer:** Pancake runs a deterministic execution engine (batter) against your evidence dataset and emits a receipt with a SHA-256 result hash, an explicit verification boundary, and a list of unmodeled risks. The engine re-derives all math from first principles — it does not trust numbers the agent asserts.

Verification in Pancake is structured as a 3-tuple: what the engine verified, what it accepted as agent-supplied evidence, and what it did not model. This breakdown appears verbatim in every receipt so a reader can judge the result against the right standard.

The verified layer covers two categories. First, structural invariants: schema shape, lookahead prevention (decision_time < resolution_time), monotonicity, value ranges, and required column presence. Any failure aborts the run — no partial receipt is issued. Second, runner math: the engine re-computes the full P&L ledger, applies declared fees and slippage symmetrically, and produces Sharpe, Sortino, CAGR, Wilson CI, Brier score, bootstrap CI, and permutation test p-values using open-source formulas with citable sources.

The agent-supplied evidence layer names what the agent provided that the engine cannot independently re-derive: feature column values, entry price source, and liquidity source. These are accepted as declared and surfaced verbatim in the receipt.

The result_hash is a SHA-256 digest of the canonical execution output. Any reader with the strategy spec and dataset can re-run batter at the same engine_version and verify the hash matches. The batter engine is open-source at github.com/usepancake/batter.

## Related

- [Methodology — full verification boundary detail](https://www.usepancake.com/methodology)
- [Engine — batter package + 12 verified formulas](https://www.usepancake.com/engine)

---

Markdown twin of https://www.usepancake.com/q/how-does-pancake-verify-backtests — same content as the HTML page, generated from the same source data. More machine surfaces: https://www.usepancake.com/llms.txt