> 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/payload-format.md).

# Payload Format

This page describes the webhook payload required to trigger a Prediction Market bot (e.g. Polymarket).

Your bot listens for incoming HTTP requests. When a valid payload is received, it executes a trade based on the provided parameters.

***

### 🚀 Payload Structure

```typescript
type PredictionSignalPayload = {
  id?: string,           // A custom identifier for the signal (optional, useful for tracking & deduplication)
  key?: string,          // Authorization key (required if webhook protection is enabled on the bot)
  slug: string,          // Polymarket market slug (e.g., 'elon-musk-of-tweets-april-2026-840-879')
  outcome: string,       // Market outcome to trade (e.g., 'Yes', 'No') — must match exactly
  side: "BUY" | "SELL",  // Trade action: 'BUY' to open, 'SELL' to close
  size?: number,         // Trade size in USDC, overrides bot default amount (optional)
  forceSize? boolean,    // It can bypass the amount of those bots that have strict amount settings
  dilution?: boolean,    // If true, allows multiple BUY orders (stacking); if false, prevents consecutive entries (default false)
  debug?: any,           // Extra debugging or metadata info (optional, not used in execution)
  callback? string,      // URL to receive the executed order result and execution details (optional)
}
```

***

### 🧩 Field Explanation

#### `id` *(optional)*

A unique identifier for the signal.

* Useful for tracking, logging, or deduplication
* If not provided, one will be generated internally

***

#### `key` *(optional)*

Webhook protection key.

* Required **only if your bot has webhook protection enabled**
* Must match the key configured in your bot

***

#### `slug` *(required)*

The **market identifier** from Polymarket.

* This is the URL slug of the market
* Example:

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

📌 Used to determine **which market to trade**

***

#### `outcome` *(required)*

The outcome you want to trade.

* Must match one of the market’s available outcomes
* Common values:
  * `"Yes"`
  * `"No"`

📌 Case-sensitive depending on the market

***

#### `side` *(required)*

Defines the action to take:

* `"BUY"` → Open / increase position
* `"SELL"` → Close / reduce position

***

#### `size` *(optional)*

Overrides the default trade size configured in the bot.

* Value is typically in **USDC**
* If omitted → bot uses its predefined size

***

#### `dilution` *(optional, default `false`)*

Whether a BUY can add to a position the bot already holds in the same outcome.

* `true`: the BUY is placed even when the bot already holds this outcome.
* `false` or omitted: when the bot already holds this outcome, the BUY places nothing. It is skipped without an order or a transaction log.

Notes:

* Only the traded outcome counts: holding No doesn't block a BUY of Yes.
* A remainder too small to sell doesn't count as a position: below the market's minimum order size on Polymarket, under 0.01 contracts on Kalshi, under one whole share on Outcome.
* SELL signals aren't affected.

***

#### `debug` *(optional)*

Free-form field for debugging or metadata.

* Not used in execution logic
* Useful for:
  * Logging
  * Strategy tracing
  * External system context

***

#### `callback` *(optional)*

The URL that will receive a `POST` request with the executed order result and additional execution details once the trade has been processed.

* Receives the original signal payload
* Includes information about the executor, bot, and API used
* Includes the order status and the response returned by the exchange

***

### 📥 Example Request

#### cURL

```javascript
curl -X POST https://your-platform.com/webhook/prediction \
  -H "Content-Type: application/json" \
  -d '{
    "id": "signal-123",
    "key": "your-secret-key",
    "slug": "elon-musk-of-tweets-april-2026-840-879",
    "outcome": "Yes",
    "side": "BUY",
    "size": 50,
    "dilution": false
  }'
```

***

#### JSON Example

```json
{
  "slug": "elon-musk-of-tweets-april-2026-840-879",
  "outcome": "Yes",
  "side": "BUY"
}
```

> Sent repeatedly, this opens a position once. Further BUYs are skipped while it’s held; add `"dilution": true` to buy every time.


---

# 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/payload-format.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.
