> For the complete documentation index, see [llms.txt](https://docs.sigrex.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sigrex.io/prediction-signal-bot-beta/create-prediction-signal-bot.md).

# Create Prediction Signal Bot

This page explains how to create and configure a bot that automatically executes trades on prediction markets (Polymarket, Outcome.xyz and Kalshi) based on incoming webhook signals.

#### ⚠️ Early-stage limitation

> **Prediction Signal Bots are currently in an early stage of development.**
>
> At this time, Prediction Signal Bots can **only be triggered through** [**Bot Webhooks**](https://docs.sigrex.io/getting-started/webhook.md). They cannot natively create or manage positions from Code Strategies, LLM Sessions, or other Sigrex strategy types.
>
> However, you can build integrations around this limitation. For example, a **Code Strategy** can send signals to a Prediction Signal Bot's webhook using [`$.Http.post()`](https://docs.sigrex.io/pages/PpGEzbE7tbHdXWi3gkdn#usd.http), allowing you to trigger the bot programmatically from your own strategy logic.
>
> Native integration with Code Strategies, LLM Sessions, and other automation components may be added in future updates.

### 🧠 How It Works

A Prediction Signal Bot:

1. Listens to a **webhook endpoint**
2. Receives a **signal payload**
3. Executes trades on a connected **Prediction Market account**

***

### 📝 Configuration Fields

**`Name`** ***(optional)***

A custom name for your bot.

* Example: `BTC 100K Strategy`
* If left empty, the bot is shown by its market slug (bots using **Slug From Signal** get a generated name)

***

**`Webhook`** ***(required)***

Select the webhook that will trigger this bot.

* This is the endpoint where your signals will be sent
* Must match the payload format described in the **Signal Payload** page

📌 You can connect:

* TradingView alerts
* Custom scripts
* External AI systems

***

**`Frequency`** ***(optional but recommended)***

Controls how often the bot is allowed to execute trades.

* Example: `1 in every 1 second`
* Helps prevent:
  * Spam signals
  * Duplicate executions
  * Rate-limit issues

📌 If multiple signals arrive within the interval, only one will be executed.

***

**`API Connection`** ***(required)***

Select your connected **Prediction Market account**.

* This is the connection you created earlier (see Connect Wallet)
* Used to:
  * Sign orders
  * Execute trades
  * Access your funds

***

**`Slug From Signal`**

Enables Wildcard / Slug from Signal mode.

* Enabled → The bot dynamically processes market slugs provided in each incoming signal payload, allowing a single bot to trade multiple markets dynamically.
* Disabled → The bot only trades the fixed market specified in the Market URL field.

⚡ Performance Note: Because the market slug must be verified before each order execution, Wildcard mode is slightly slower than using a fixed slug. For bots designed to trade a specific market exclusively, keeping this toggle disabled is recommended.

**`Market URL`** ***(required if 'Slug From Signal' is disabled)***

The full URL of the prediction market you want to trade.

* Example:

```
https://polymarket.com/event/elon-musk-of-tweets-april-2026/elon-musk-of-tweets-april-2026-840-879
```

📌 You can also paste an **event** URL. If the event has several markets, select one from the **Market** list and the URL changes to that market.

📌 Bots can't be created or edited on closed or settled markets.

***

<figure><img src="https://249033878-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9eVrTushLZJUnDJcuAQG%2Fuploads%2FH7oQidcYCB6FPmStKIYL%2FScreezxzasfasnshot%202026-04-23%20125029.png?alt=media&#x26;token=238481b6-1093-4330-9a90-1613cef78dcf" alt=""><figcaption></figcaption></figure>

### **⚠️ Important — Slug Matching**

The **slug in your** **signal payload** **must match the bot's market exactly**.

* From the URL above:

```
elon-musk-of-tweets-april-2026-840-879
```

* Your signal must include:

```
{
  "slug": "elon-musk-of-tweets-april-2026-840-879"
}
```

The slug depends on the prediction market:

<table><thead><tr><th width="141">Market</th><th>Slug</th></tr></thead><tbody><tr><td>Polymarket</td><td>Market slug (last part of the market URL)</td></tr><tr><td>Kalshi</td><td>Market ticker, e.g. <code>KXNATO-99-KKAL</code></td></tr><tr><td>Outcome.xyz</td><td>Event id, e.g. <code>o30154</code>. For events with several markets: the market id (the <code>?outcome=</code> number), e.g. <code>1481</code></td></tr></tbody></table>

📌 The `outcome` in your signal must also match one of the bot's outcomes exactly (e.g. `Yes` / `No`, or `IND` / `MIA` on some Outcome.xyz markets).

❗ If the slug does **not match**, the bot will ignore the signal.

💡 Tip:\
Copy the slug and outcomes from the example payload on the bot's page. Even small differences will prevent execution.

***

**`Amount From Signal`**

Controls how trade size is determined:

* **Enabled** → Use `size` from incoming signal payload (signals without `size` are ignored)
* **Disabled** → Use fixed amount defined below

***

**`Amount`** ***(required if 'Amount from Signal' disabled)***

The default buy size.

* Denominated in **USDC** (USD on Kalshi)
* Example: `250`

📌 Sell signals don't use this amount, see **Buying & Selling** below.

***

### 💸 Buying & Selling

**Buy signals**

* Spend the **Amount** (or the signal's `size`)
* On Polymarket and Kalshi a buy fills completely or not at all. If it can't be filled, the bot is suspended and you're notified

**Sell signals**

* Sell the **whole position** of the outcome
* If the size comes from the signal (**Amount From Signal** or `forceSize`), sell that many **shares** instead, capped at what you hold
* Retry what isn't filled at up to **5%**, **15%** and **30%** below the best bid, never lower
* Do nothing if the outcome isn't held

📌 If part of the position can't be sold, you get a warning notification and the bot keeps running, so the next sell signal tries again.

📌 With a `callback`, a sell that needs retries sends one callback per order.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sigrex.io/prediction-signal-bot-beta/create-prediction-signal-bot.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
