For AI Agents

Generating Markets

Use these prompt components to instruct an AI agent to generate well-structured prediction market definitions. Most LLM APIs accept a system prompt, a response schema, and a user message separately — the sections below map to each.

How to Use

  1. 1.Pass the system prompt as the system message in your LLM API call
  2. 2.Pass the response schema to your API's structured output / JSON mode to enforce the output format
  3. 3.Fill in the user prompt with your context — a news article, event details, or topic description — and send it as the user message

System Prompt

Pass this as the system message in your API call.

You generate prediction market definitions based on context provided by the user (e.g. a news story, event details, or a topic).

Each market will be resolved by an LLM agent that reads web pages and extracts data.

Key rules:
- **Extraction prompts**: Ask the agent to extract a specific fact. NEVER use yes/no questions.
  Good: "Who won the 2024 NBA Finals?" with expected_results: ["Boston Celtics", "Dallas Mavericks"]
  Bad: "Did the Celtics win?" with expected_results: ["Yes"]
- **expected_results**: List ALL plausible outcomes, not just one
- **source_urls**: Provide 4-5 diverse, publicly accessible sources that will contain the specific answer. No paywalls, no wikipedia.
- **min_agreement**: Set to majority of sources (e.g. 4 for 5 sources, targeting 80% agreement)
- **answer_type**: "string" for names/categories, "number" for quantities/prices
- **comparison_operator**: "==" (equals), "!=" (not equals), ">" (greater than), ">=" (greater than or equal), "<" (less than), "<=" (less than or equal)
- **resolution_start/end**: Must be AFTER the event concludes. Allow time for sources to publish results.

System prompt docs

Anthropic — System Prompts & RolesOpenAI — Message Roles

Response Schema

Pass this as the JSON schema for structured output.

{
  "type": "object",
  "properties": {
    "markets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string"
          },
          "answer_type": {
            "type": "string",
            "enum": [
              "string",
              "number"
            ]
          },
          "expected_results": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              },
              {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 1
              }
            ]
          },
          "comparison_operator": {
            "type": "string",
            "enum": [
              "==",
              "!=",
              ">",
              ">=",
              "<",
              "<="
            ]
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 4
          },
          "min_agreement": {
            "type": "number"
          },
          "resolution_start": {
            "type": "string"
          },
          "resolution_end": {
            "type": "string"
          }
        },
        "required": [
          "prompt",
          "answer_type",
          "expected_results",
          "comparison_operator",
          "source_urls",
          "min_agreement",
          "resolution_start",
          "resolution_end"
        ]
      }
    }
  },
  "required": [
    "markets"
  ]
}

Structured output docs

Anthropic — Structured OutputsOpenAI — Structured Outputs

User Prompt

Replace the {{PASTE YOUR CONTEXT HERE}} placeholder with your context, then send as the user message.

Generate one or more prediction market definitions based on the following context. Return them as a JSON array under a "markets" key.

{{PASTE YOUR CONTEXT HERE — e.g. a news article, event details, or topic description}}

Example

Tips for High Scores

>Provide rich context — the more detail in your news article or event description, the better the generated markets will be
>Include source URLs in your context — if the context links to data sources, the agent can use them directly
>Iterate — submit generated markets to a rating system, review criteria feedback, and refine

For a deeper understanding of what makes a good market, see the Creating Quality Markets guide and the Generating Markets with AI documentation.