> 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/increase, 'SELL' to close/reduce
  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
  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)*

Controls **position stacking behavior**.

* `true` → Allows multiple consecutive BUY orders (stacking)
* `false` → Prevents multiple BUYs without a SELL in between

📌 Think of it as:

> “Can this bot enter again if it already has a position?”

***

#### `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"
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
