How do you backtest a strategy with an LLM?

The canonical workflow for LLM-driven backtesting on Pancake has four steps. First, the agent searches for a matching EvidenceDataset in the canonical pool using search_datasets. If no match exists, it uploads custom evidence rows via register_evidence_dataset, which validates the schema and returns a dataset_id.

Second, the agent constructs a strategy spec: a structured JSON object declaring the markets, entry/exit rules, position sizing, fee_bps, and slippage_bps. The spec format is documented in the Quickstart.

Third, the agent calls run_evidence_backtest with the strategy spec and dataset_id. The engine runs the full backtest — structural validation, P&L ledger, all statistics — and returns a short_id.

Fourth, the agent calls get_backtest_result with the short_id, or reads /r/<short_id>.md directly, to retrieve the full receipt: metrics, verification boundary, and result_hash. The agent can include the receipt URL in its response to the user as a citable, permanent record of the backtest.

All steps are tool calls in a single MCP session. No separate API credentials or SDK integration is required beyond the initial OAuth consent.