Skip to main content
Coding agents, LLM-powered trading tools, and crawlers can discover PolyOrderbooks three ways — plain-text index files, an MCP server, or the API directly.

Machine-readable index files

Both properties ship llms.txt files in the format proposed by the llms.txt working group. Each lists only the highest-signal pages, so an agent pulling the index can follow the one or two links that match the task instead of crawling the whole property.

MCP server

The PolyOrderbooks MCP server is the fastest path for a chat or agent that needs archive queries — full L2 ladders, per-outcome price series, and market metrics — without writing REST calls. Install and prompt patterns: MCP server.

Backtest AI (natural-language backtesting)

POST /v1/ai/backtest turns a plain-English crypto up/down strategy into a replayed backtest over resolved Polymarket markets from our archive. An agent uses it to answer questions like “would buying DOWN when the DOWN token crosses below 0.45 on BTC 15m have been profitable?” Request:
Response:
Two parse paths, one response shape:
  • LLM parse (source: "llm") — a free-tier Gemini-backed model converts the prompt into the strict strategy JSON.
  • Rule fallback (source: "rules") — if the model is unavailable or the response is invalid, a deterministic keyword parser takes over, and a note says so.
The engine only ever evaluates prediction-market token prices and order books — it has no BTC/ETH spot price and no percentages. Prompts that depend on an asset price or a percentage are rejected with 400 {"error": "unsupported_signal"} rather than silently approximated.

Boundary and plan

  • Signals: token prices (0..1) and L2 books for Polymarket crypto up/down markets — no external reference price
  • Engine fills against the captured ladder (book_ladder), falling back to the best quote or last price (best_quote / last_price); settlement fills are marked settlement
  • Exits: take_profit, stop_loss, expiry, or end_of_window
  • Access: Pro plan or above, bearer-authenticated. Free Starter keys get 403 {"error": "plan_required"}. See Pricing and Authentication
Interactive: Backtest AI (login required).

Guidance for agents

  • Prefer llms.txt over full-site crawls; follow at most one or two links from it.
  • For historical queries, one MCP call replaces several REST round-trips.
  • Backtest AI answers directional “what would have happened” questions without exposing raw archives — keep prompts to the strategy shape, not market lists. Raw discovery still uses GET /v1/markets and friends.
  • System messages: you are working against a real historical archive, ~1-second capture; treat backtest results as evidence on the sample actually traded (markets_traded vs markets_found).