# Introduction

Sigrex is a trading automation platform that sits between your ideas and the market.

It provides a complete toolkit to generate, process, and execute trades across major CEXs, Uniswap (native Web3), and Polymarket (beta). Whether you want to use it as a pure execution engine, a signal generator, or a completely autonomous trading system, Sigrex adapts to your workflow.

> **Talk to Sigrex from any AI assistant.** The MCP server plugs into Claude, ChatGPT, Cursor or other compatible clients. Create and manage strategies through chat. OAuth handles sign-in, no API keys required. [**Setup guide →**](https://docs.sigrex.io/more/mcp-server)

<details>

<summary>🌐 Supported Exchanges</summary>

<table><thead><tr><th width="130">Exchange</th><th width="124.6666259765625">Type</th><th width="81.6666259765625" data-type="checkbox">Spot</th><th width="101.6666259765625" data-type="checkbox">Futures</th><th width="126.333251953125">More</th><th width="183.6668701171875">API ID</th></tr></thead><tbody><tr><td><a href="https://alpaca.markets">Alpaca</a> </td><td>CEX</td><td>true</td><td>false</td><td>No Paper trading</td><td>Spot: <code>1</code></td></tr><tr><td><a href="https://www.binance.com">Binance</a></td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>2</code> </p><p>Futures: <code>3</code></p></td></tr><tr><td><a href="https://www.bitget.com/">Bitget </a></td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>13</code> </p><p>Futures: <code>14</code></p></td></tr><tr><td><a href="https://www.mexc.com">MEXC</a> </td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>4</code> </p><p>Futures: <code>16</code></p></td></tr><tr><td><a href="https://www.gate.io">Gate.io</a> </td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>8</code> </p><p>Futures: <code>9</code></p></td></tr><tr><td><a href="https://www.kraken.com">Kraken</a> </td><td>CEX</td><td>true</td><td>true</td><td></td><td><p>Spot: <code>6</code> </p><p>Futures: <code>7</code></p></td></tr><tr><td><a href="https://app.hyperliquid.xyz/trade/BTC">Hyperliquid </a></td><td>CEX</td><td>true</td><td>true</td><td>USDC only</td><td><p>Spot: <code>11</code> </p><p>Futures: <code>12</code></p></td></tr><tr><td><a href="https://app.uniswap.org/">Uniswap</a></td><td>DEX</td><td>true</td><td>false</td><td>Polygon, Arbitrum</td><td>Spot: <code>10</code></td></tr><tr><td><a href="https://polymarket.com/">Polymarket</a></td><td>PREDICTION</td><td>true</td><td>false</td><td></td><td>Spot: <code>15</code> </td></tr><tr><td><a href="https://outcome.xyz/">Outcome.xyz</a></td><td>PREDICTION</td><td>true</td><td>false</td><td></td><td>Spot: <code>17</code> </td></tr></tbody></table>

</details>

<details>

<summary>🤖 Supported LLM Provider</summary>

| Provider                                               | API ID               |
| ------------------------------------------------------ | -------------------- |
| [Google Gemini](https://gemini.google.com/)            | `1`                  |
| [OpenAI](https://openai.com/)                          | `2`                  |
| [DeepSeek](https://www.deepseek.com/)                  | `3`                  |
| [Claude](https://claude.ai/)                           | `4`                  |
| [Mistral](https://mistral.ai/)                         | `5`                  |
| [Cohere](https://cohere.com/)                          | `6`                  |
| [Grok (xAI)](https://grok.com/)                        | `7`                  |
| [Alibaba Cloud (Qwen)](https://www.alibabacloud.com/)  | `8`                  |
| [~~Perplexity~~](https://www.perplexity.ai/)           | ~~`9`~~ (suspended)  |
| [Moonshot AI (Kimi)](https://www.moonshot.ai/)         | `10`                 |
| [Z.ai](https://chat.z.ai/)                             | `11`                 |
| [MiniMax](https://www.minimax.io/)                     | `12`                 |
| [Nvidia](https://build.nvidia.com/)                    | `13`                 |
| [Nous Research](https://portal.nousresearch.com/)      | `14`                 |
| [OpenRouter](https://openrouter.ai/)                   | `15`                 |
| [Xiaomi (MiMo)](https://mimo.xiaomi.com/)              | ~~`16`~~ (suspended) |
| [Groq](https://groq.com/)                              | `17`                 |
| [Cerebras](https://www.cerebras.ai/)                   | `18`                 |
| [SiliconFlow](https://cloud.siliconflow.com/)          | `19`                 |
| [Sambanova](https://sambanova.ai/)                     | `20`                 |
| [Meta AI](https://developer.meta.com/ai/)              | `21`                 |
| [Vercel](https://vercel.com/ai-gateway)                | `22`                 |
| [Cheaper Inference](https://www.cheaperinference.com/) | `23`                 |

</details>

### A few things you can do

* ⚡️ Execute from Anywhere: Send orders from TradingView, your own custom scripts, or external bots, and let Sigrex handle the execution.
* 🤖 Deploy AI Agents: Let AI agents generate reports or trade directly for you.
* ⚙️ Generate Signals: Build and run strategies for signal generation natively inside Sigrex.
* 🔗 Build Event-Driven Reactions: Create workflows that respond instantly to any incoming data.
* 🤝 Collaborate & Share: Split the exact same orders or events seamlessly across multiple users and friends.

### How it works

The system is organized into clear, flexible layers to give you deep customization.

```mermaid
graph TD

    %% Define the distinct layers using subgraphs
    subgraph Internet Layer
        OS(Outer space)
    end
    
    subgraph Data Processing Layer
        DH(Data hook)
    end
    
    subgraph Strategy Layer
        RS1(Reaction Strategies)
        RS2(Reaction Strategies)
        RS3(Reaction Strategies)
        SS(Simple Strategies)
    end
    
    subgraph Signal Processing Layer
        BH(Bot hook)
    end
    
    subgraph Execution Layer
        SB1(Signal Bots)
        SB2(Signal Bots)
        SB3(Signal Bots)
        SB4(Signal Bots)
    end

    %% Define the connections between nodes
    OS --> DH
    OS --> BH
    
    DH --> RS1
    DH --> RS2
    DH --> RS3
    
    RS1 --> BH
    RS2 --> BH
    RS3 --> BH
    SS --> BH
    
    BH --> SB1
    BH --> SB2
    BH --> SB3
    BH --> SB4

    %% Apply a clean, minimalist style similar to the image
    classDef default fill:#ffffff,stroke:#333333,stroke-width:1px,color:#000000;
```

**Simple Strategies** run on their own:

* [**Code Strategies**](/startegies/code) — Write sandboxed JavaScript equipped with rich [helper functions](/startegies/code#available-variables) and HTTP request capabilities. Because they have full access to the [Sigrex API](https://docs.sigrex.io/api-reference/), a single strategy can even manage your other strategies.
* [**LLM Sessions**](/startegies/llm-session) — Periodically running AI agents. You control the [prompts](/startegies/llm-session/signal-generation#template-variables) and equip the LLM with powerful [tools](/startegies/llm-session/signal-generation#llm-tooling-reference) so it can analyze, decide, trade autonomously and even manage your other strategies.

**Reaction Strategies** ([Code](/reaction/code-reaction) or [LLM](/reaction/llm-reaction)) don’t run by themselves. They wait for an **event**. Any HTTP payload you send to a [**Data Hook**](/reaction/data-webhook) becomes an event. You can even share that [**Data Hook**](/reaction/data-webhook) with friends so multiple people can react to the same incoming data.

Everything eventually flows into the [**Bot Hook**](/getting-started/webhook), which routes the final signals to your **Signal Bots** that execute on the exchanges.

This design makes Sigrex extremely flexible: pure execution layer, fully autonomous agents, event-driven workflows, multi-user collaboration, and deep customization through both code and AI.

### What's Next?

* 👉 [Master Bot Webhooks](/getting-started/webhook) — Learn how to [format payloads](/getting-started/signal-payload-format) and route your final signals.
* 👉 [Integrate Exchange APIs](/cex-signal-bot/exchange-api-key) — Securely link your CEX accounts.
* 👉 [Explore Signal Bots](/cex-signal-bot/exchange-api-key) — Set up listeners to execute trades on your connected platforms.
* 👉 [Discover AI Trading](/startegies/llm-session) — See how LLM Sessions can analyze and trade autonomously for you.

Happy building! 🛠️

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="image">Cover image</th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Code Strategy</td><td></td><td><a href="/startegies/code">Code</a></td></tr><tr><td>LLM Session</td><td></td><td><a href="/startegies/llm-session">LLM Session</a></td></tr><tr><td>Reactions</td><td></td><td><a href="/reaction/data-webhook">Reaction</a></td></tr></tbody></table>


# Bot Webhook

A bot **webhook** is a unique endpoint (URL) that can receive trading signals and trigger actions—such as executing trades on crypto exchanges or Web3 platforms like Uniswap. In Sigrex, users can easily create webhooks by filling out a few fields:

***

## 📝 Webhook Fields

* **Name (optional):**\
  You can give your webhook any name you like. If you leave it empty, the system will automatically generate a random, human-readable name (e.g., `silent-rain-9283`).
* **Description:**\
  Describe what the webhook is used for. You can include which trading symbols it listens to (e.g., `BTCUSDT`, `ETH`) and how frequently the signals are expected. This is especially helpful if you're planning to share the webhook with others.
* **Key Protection:**\
  Enabling this feature lets you protect your webhook with a custom key. Only signals that include a matching `"key": "your-secret-key"` field in their payload will be accepted. This helps ensure only trusted signals are processed.

***

## 🔗 After Webhook Creation

Once the webhook is successfully created:

* The system generates a unique UUID for the webhook.
* You'll receive a webhook URL that you can copy and paste into tools like TradingView or connect it to your bot.
* The webhook URL follows this format:

`https://hook.sigrex.io/bot/<webhook-hash>`

For example:

`https://hook.sigrex.io/bot/72d7c761-8ee8-4fed-8400-1130ce689957`

* Your webhook hash also works as an **email address** (e.g., `webhook-hash@sigrex.io`). Sigrex can detect if an email is a valid signal payload and, if so, trigger the connected trades. Non-signal emails (e.g., verification emails) will be forwarded to your registered email instead.

***

## ⚙️ Webhook Actions

After creating a webhook, you can:

* **Start / Pause** the webhook
* **Delete** it if no longer needed
* **Share** it with others (friends or teammates)

{% hint style="warning" %}
Shared webhooks keep the actual URL and hash private. Others only see the **name** and **description**, and can link it to their own SignalBots..
{% endhint %}


# Signal Payload Format

The **signal payload** is the core JSON structure that Sigrex uses to trigger trading actions through webhooks or webhook email addresses. When a signal is sent, it must match this format so the system can understand and execute it properly.

Below is the expected payload schema:

```ts
{
  id?: string,                  // A custom name/id for the alert (optional)
  key?: string,                 // Authorization key (required if webhook is key-protected)
  symbol: string,               // The trading pair (e.g., 'BTCUSDT', 'ETHUSDT')
  side: "BUY" | "SELL",         // Either 'BUY | buy' or 'SELL | sell'
  size?: number,                // Trade size (open in quote, close in base currency), overrides default (optional)
  forceSize? boolean,           // It can bypass the amount of those bots that have strict amount settings
  dilution?: boolean,           // If true, allows partial stacking of positions (optional)
  flag?: FlagType | FlagType[], // Additional tags like 'TEST', 'DEBUG', 'REVERSE' (optional)
  debug?: any,                  // Extra debugging info (optional)
  callback? string              // URL to receive the executed order result and execution details (optional)
}
```

***

## 🔍 Field Descriptions

* **id (optional):**\
  A custom label for the signal. Useful for identifying or grouping alerts in your dashboard.
* **key (optional, required in safe mode):**\
  The security key required for webhooks that are key-protected. Must match the one set during webhook creation.
* **symbol (required):**\
  The trading pair this signal targets. For example, `BTCUSDT`, `ETHUSD`, etc.
* **side (required):**\
  The trade direction. Must be either:
  * `'BUY | buy'` – to open long or close a short position
  * `'SELL | sell'` – to close long or open a short position
* **size (optional):**\
  The trade amount (open in quote, close in base currency). If not set, the default configured size for the connected bot will be used.
* **dilution (optional):**\
  If set to `true`, the bot will stack this trade on top of an existing position if it's in the same direction, instead of replacing it.
* **flag (optional):**\
  Tags that describe the signal’s purpose or behavior, such as:
  * `'TEST'` – test only, no real trade
  * `'DEBUG'` – for debugging
  * `'REVERSE'` – interpret as reverse trade\
    You can use a single flag or multiple in an array.
* **debug (optional):**\
  Any custom or diagnostic information. This data isn’t used by bots, but helps in testing or logging.
* **callback (optional):** The URL that receives the executed order result and additional execution details once processing is complete.

***

## ✅ Example Payloads

Simple

```json
{
  "key": "secret123",
  "symbol": "BTCUSDT",
  "side": "BUY",
}
```

More complex

```json
{
  "id": "Super Strategy",
  "key": "secret123",
  "symbol": "BTCUSDT",
  "side": "BUY",
  "size": 100,
  "dilution": true,
  "flag": ["TEST"],
  "callback": "https://your-app.com/webhooks/order-result"
}
```

## 📞 Example Callback Payload

```json
{
  // The original signal payload that was received
  "signal": {
    "symbol": "BTCUSDC",
    "key": "1ef5169216fgh0ffg3c4362d529b0d599b36",
    "side": "BUY",
    "callback": "https://webhook.site/51d70cee-ab97-4b3d-9146-0b2e87a30c9b"
  },

  // Information about the executor, including the bot and API used
  "executor": {
    "type": "cex-signal-bot",
    "api": {
      "id": 86,
      "exchange": "hyperliquid",
      "service": "futures"
    },
    "bot": {
      "id": 193
    }
  },

  // The actual order result returned by the exchange
  "result": {
    "status": "ok",
    "response": {
      "type": "order",
      "data": {
        "statuses": [
          {
            "filled": {
              "totalSz": "0.00025",
              "avgPx": "79550.0",
              "oid": 538410463312
            }
          }
        ]
      }
    }
  }
}
```


# Exchange API key

This page explains how to securely connect your centralized exchange API keys to Sigrex. This allows the platform to execute trades on your behalf based on signal payloads.

***

## 🌐 Supported CEX-es

<table><thead><tr><th width="130">Exchange</th><th width="124.6666259765625">Type</th><th width="81.6666259765625" data-type="checkbox">Spot</th><th width="101.6666259765625" data-type="checkbox">Futures</th><th width="126.333251953125">More</th><th width="183.6668701171875">API ID</th></tr></thead><tbody><tr><td><a href="https://alpaca.markets">Alpaca</a> </td><td>CEX</td><td>true</td><td>false</td><td>No Paper trading</td><td>Spot: <code>1</code></td></tr><tr><td><a href="https://www.binance.com">Binance</a></td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>2</code> </p><p>Futures: <code>3</code></p></td></tr><tr><td><a href="https://www.bitget.com/">Bitget </a></td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>13</code> </p><p>Futures: <code>14</code></p></td></tr><tr><td><a href="https://www.mexc.com">MEXC</a> </td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>4</code> </p><p>Futures: <code>16</code></p></td></tr><tr><td><a href="https://www.gate.io">Gate.io</a> </td><td>CEX</td><td>true</td><td>true</td><td>USD-M only</td><td><p>Spot: <code>8</code> </p><p>Futures: <code>9</code></p></td></tr><tr><td><a href="https://www.kraken.com">Kraken</a> </td><td>CEX</td><td>true</td><td>true</td><td></td><td><p>Spot: <code>6</code> </p><p>Futures: <code>7</code></p></td></tr><tr><td><a href="https://app.hyperliquid.xyz/trade/BTC">Hyperliquid </a></td><td>CEX</td><td>true</td><td>true</td><td>USDC only</td><td><p>Spot: <code>11</code> </p><p>Futures: <code>12</code></p></td></tr></tbody></table>

> 📌 *Only real/live trading accounts are supported for Alpaca. Paper trading keys are not allowed.*

{% hint style="info" %}
We are continuously working to expand Sigrex’s capabilities. **More exchange integrations are planned for the future**, including both centralized and decentralized platforms. Stay tuned!
{% endhint %}

***

## 🛠️ How to Connect an API Key

1. **Name (Optional):**\
   You can assign a name to your API key connection to help identify it later. If left blank, the system will handle it.
2. **Choose Exchange:**\
   Select which of the supported exchanges the API key is from.
3. **Enter Keys:**
   * **Public Key** (API key)
   * **Private Key** (Secret key)
   * **Extra** (if needed)
4. **Validation:**\
   After submission, Sigrex sends a test request to the selected exchange to validate the API credentials and ensure the connection is functional.

***

## ⚠️ Important Notes

* **Separate Connections for Spot & Futures:**\
  If you want to use the same exchange for both spot and futures trading, **create two separate API connections**—one for spot and one for futures.
* **Alpaca Restrictions:**\
  We do **not** support paper trading keys from Alpaca. Please ensure your account is live before connecting.
* **No Modification After Creation:**\
  After an API key connection is created, it **cannot be edited** for security reasons. If you need to change the keys or exchange:
  1. Disconnect it from all linked bots.
  2. Delete the connection.
  3. Create a new one with updated keys.

***

## 🔐 Security Notice

All API keys (public and private) are encrypted using strong server-side encryption and are **only decrypted at runtime**—when executing trades. Your keys are never exposed or stored in plaintext.


# Creating a CEX Signal Bot

A **CEX Signal Bot** allows users to automatically execute trades on a centralized exchange by listening to a specific webhook (or signal email address). When a valid signal payload is received, the bot triggers a trade using the connected API.

***

## 🛠️ Bot Setup Fields

Here’s a breakdown of the required and optional fields when creating a CEX signal bot:

* **Name (Optional):**\
  You can give your bot a custom name. If left empty, the bot will automatically be named after the selected trading symbol (e.g., "BTCUSDT").
* **Webhook:**\
  Select an existing webhook that the bot should listen to. This webhook will receive trading signals either via HTTP POST or email (`webhook-hash@sigrex.io`).
* **API Connection:**\
  Choose one of your previously added exchange API keys. This determines which centralized exchange the bot will execute trades on.
* **Symbol:**\
  Enter the trading symbol (e.g., `BTCUSDT`). Make sure the symbol format matches the one used by the selected exchange (e.g., some use `BTC_USDT` while others use `BTCUSDT`).
* **Pair Base / Pair Quote:**\
  These fields auto-fill based on the symbol. For example, `BTCUSDT` will have:
  * Base: BTC
  * Quote: USDT
* **Amount:**\
  Set the amount for each trade:
  * You can choose the amount in the quote currency (e.g., USDT) or switch to the base currency (e.g., BTC).
  * The amount must be equal to or greater than the **minimum notional value** required by the exchange for that trading pair.

> ⚠️ **Important:** If the amount is too small, the exchange may reject the order. Always verify the trading rules of your selected pair on the exchange.

***

## ✅ After Creation

Once the bot is created, it will continuously monitor the selected webhook. When a valid signal payload is received, the bot will:

1. Validate the payload (including any required key).
2. Place the trade on the selected exchange using the parameters in the payload.
3. Follow any optional parameters like dilution, etc.


# Gas Tank

The GasTank is a secure Ethereum smart contract that allows users to deposit ETH (or the native token of the chain, such as POL, AVAX, etc.) to cover gas fees for their DEX Signal Bot operations.

When a DEX bot is triggered by a signal, a backend executor contract submits a transaction on-chain. This transaction requires gas (native tokens) to execute. If the user hasn't deposited enough funds into their GasTank, the transaction will revert and the bot will be **automatically suspended** to prevent further failures.

## 🔐 Key Features

* **Secure Deposits:**\
  The GasTank is a non-custodial smart contract. Users can deposit and withdraw their funds at any time.
* **No Lock-In:**\
  Funds are **not locked**. Users maintain full control and can withdraw unused gas funds freely.
* **Autonomous Execution:**\
  The bot uses the deposited gas to cover the costs of on-chain execution automatically.
* **Slight Overburn (15% buffer):**\
  Due to the unpredictable nature of gas usage (especially from internal operations like token burns or events), the system burns **15% more** gas than the exact execution cost to ensure reliability.

Here’s a simplified view of how this is calculated:

```solidity
uint256 totalCost = ((startGas - gasleft()) * tx.gasprice * 115) / 100; // 15% buffer
gasTank.burn(owner, totalCost);
```

***

## 💡 Manual Wallet Execution

If you decide to **manually connect your wallet** (e.g. via MetaMask) and run the DEX trade yourself, the GasTank **is not used**.

* The swap will be sent **from your wallet**.
* **You cover the gas fees** directly.
* **No extra buffer or gas burn** occurs in this case.

This method is ideal if you prefer full transparency, self-signing, or are running bots in a **semi-automated** or **hybrid** mode.

## ⚠️ Why It Matters

* If your GasTank balance is **too low**, your DEX bot **will fail** and be suspended.
* Always keep a **healthy balance** in your GasTank to ensure smooth execution.
* Monitor your GasTank balance in the dashboard.


# Creating a DEX Signal Bot

A DEX Signal Bot allows users to automatically execute swaps on a decentralized exchange like Uniswap by listening to a specific webhook. When a valid signal payload is received, the bot performs a swap based on the user-defined configuration and wallet balance.

## 🌐 Supported DEX-es

<table><thead><tr><th width="130">Exchange</th><th width="124.6666259765625">Type</th><th width="81.6666259765625" data-type="checkbox">Spot</th><th width="101.6666259765625" data-type="checkbox">Futures</th><th width="126.333251953125">More</th><th width="183.6668701171875">API ID</th></tr></thead><tbody><tr><td><a href="https://app.uniswap.org/">Uniswap</a></td><td>DEX</td><td>true</td><td>false</td><td>Polygon, Arbitrum</td><td>Spot: <code>10</code></td></tr></tbody></table>

## 🛠️ **Bot Setup Fields**

Here’s a breakdown of the required and optional fields when creating a DEX signal bot:

**Name (Optional):**\
You can give your bot a custom name. If left empty, the bot will automatically be named after the selected trading symbol (e.g., "WETHUSDC").

**Webhook:**\
Select one of your previously created webhooks. This webhook receives trading signals (via HTTP POST) that trigger the bot’s swap logic.

**Symbol:**\
Enter the trading pair symbol (e.g., WETHUSDC). This symbol is used to match the payload data with the appropriate bot.

**Chain / Exchange:**\
Select the blockchain network (e.g., Arbitrum) and the supported DEX (e.g., Uniswap).\
Factory address for the DEX is shown for verification.

**Base Token Address / Quote Token Address:**\
Enter the ERC20 token addresses you want to swap.

* **Base Token**: The token you're buying or selling (e.g., WETH)
* **Quote Token**: The token you're using to make the trade (e.g., USDC)

**Start With:**\
Choose whether the bot should start with a **BUY** or **SELL**:

* ✅ **BUY**:\
  The bot will first **buy the base token** using the quote token.\
  👉 The user must **deposit the quote token** and set the amount in quote units (e.g., USDC).
* ✅ **SELL**:\
  The bot will first **sell the base token** for the quote token.\
  👉 The user must **deposit the base token** and set the amount in base units (e.g., WETH).

> 🔄 The selected mode determines the direction of the first trade and which token the user must fund the bot with at creation.

**Amount:**\
Set the amount of the starting token to be used in each trade.\
You must send this amount to the bot contract immediately after creation.

* You can enter a fixed number (e.g., 2500)
* Or enable **“Use All”** to allow the bot to trade with its **entire available balance**

***

## ⚠️ **Important: Understanding “Use All” vs Fixed Amount**

* ✅ **Use All Enabled:**\
  The bot will attempt to trade with 100% of its available balance every time.\
  This ensures full usage of capital, but may result in smaller trades over time (e.g., after a loss).
* ❌ **Use All Disabled:**\
  The bot will only trade with the fixed amount you specify (e.g., 100).\
  If the bot balance falls below that amount (e.g., due to a failed or loss-making trade), the swap will not occur.

***

## 💰 **After Creation**

Once the bot is created, you must send the selected amount of the starting token to the **bot contract address**. The bot will use this balance to perform trades based on incoming signals.

You can **deposit or withdraw** from the bot's token balance at any time via your dashboard.

***

## ⛽ [**GasTank**](/dex-signal-bot/gas-tank) **Integration Required**

The bot needs gas (e.g., ETH) to execute trades. Sigrex handles this through the [GasTank](/dex-signal-bot/gas-tank):

* Users must deposit native tokens (ETH, etc.) into their GasTank.
* When the bot runs, Sigrex calculates the gas cost and deducts it from the GasTank.
* A buffer of \~15% is added to cover burn cost and variable gas use.

```solidity
totalCost = ((startGas - gasleft()) * tx.gasprice * 115) / 100;
gasTank.burn(owner, totalCost);
```

⚠️ If your GasTank is empty, your bot may fail to execute and be suspended. If you trigger the swap **manually** via your wallet, this cost is covered directly by you and **no burn** will happen.


# Deployment Addresses

This page lists the deployed smart contract addresses used by the platform across supported EVM networks.


# Arbitrum

This page provides the deployed smart contract addresses on the Arbitrum network, which can be used together with the corresponding ABI files to interact with the contracts.

| Contract   | Address                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------------------- |
| GasTank    | [0x3d152e7B21b91295a136CEB42bA5A0cB0d4d6c74](https://arbiscan.io/address/0x3d152e7B21b91295a136CEB42bA5A0cB0d4d6c74) |
| BotFactory | [0xc44771aEedE1F80756874201C58b47e7ea49E174](https://arbiscan.io/address/0xc44771aEedE1F80756874201C58b47e7ea49E174) |


# Polygon

This page provides the deployed smart contract addresses on the Polygon network, which can be used together with the corresponding ABI files to interact with the contracts.

| Contract   | Address                                                                                                                  |
| ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| GasTank    | [0x4B3632c58cAC8481a241b703c8784C836E023A7D](https://polygonscan.com/address/0x4B3632c58cAC8481a241b703c8784C836E023A7D) |
| BotFactory | [0x3d152e7B21b91295a136CEB42bA5A0cB0d4d6c74](https://polygonscan.com/address/0x3d152e7B21b91295a136CEB42bA5A0cB0d4d6c74) |


# Contract ABI

This page contains the Application Binary Interfaces (ABI) for the smart contracts used by the platform.

An ABI describes how applications and services can interact with a smart contract on an **EVM-compatible blockchain**. It defines the contract's available functions, events, and their input/output parameters.

<details>

<summary><a href="/dex-signal-bot/contract-abi/gastank-abi">GasTank</a></summary>

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/GasTank.ts>" %}

</details>

<details>

<summary><a href="/dex-signal-bot/contract-abi/botfactory-abi">BotFactory</a></summary>

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/BotFactory.ts>" %}

</details>

<details>

<summary><a href="/dex-signal-bot/contract-abi/signalbot-abi">SignalBot</a></summary>

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/SignalBot.ts>" %}

</details>

{% embed url="<https://github.com/Towerflow/ABI/tree/main>" %}


# GasTank ABI

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/GasTank.ts>" visible="true" %}


# BotFactory ABI

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/BotFactory.ts>" %}


# SignalBot ABI

{% @github-files/github-code-block url="<https://github.com/Towerflow/ABI/blob/main/SignalBot.ts>" %}


# Connect Wallet

This guide walks you through connecting your Polymarket account to the platform so your strategies can execute trades automatically.

## 🌐 Supported Prediction Markets

<table><thead><tr><th width="130">Exchange</th><th width="124.6666259765625">Type</th><th width="81.6666259765625" data-type="checkbox">Spot</th><th width="126.333251953125">More</th><th width="183.6668701171875">API ID</th></tr></thead><tbody><tr><td><a href="https://polymarket.com/">Polymarket</a></td><td>PREDICTION</td><td>true</td><td></td><td>Spot: <code>15</code> </td></tr><tr><td><a href="https://outcome.xyz/">Outcome.xyz</a></td><td>PREDICTION</td><td>true</td><td></td><td>Spot: <code>17</code></td></tr></tbody></table>

### 🧠 How It Works

To trade on Polymarket, Sigrex needs:

* A **funding address** (your Polymarket profile address)
* Your **wallet private key**, used only to create a session key

When you connect, Sigrex uses your private key to authorize a **session key** for your account. Your private key is **never saved**. Only the session key is stored.

The session key lets your strategies:

* Place trades
* Manage positions automatically

It **cannot withdraw funds** and is valid for **180 days**.

🔐 Session keys are encrypted and securely stored on the server.

> 💡 **Outcome.xyz:** connections work with a **Hyperliquid API wallet** private key. API wallets can place trades but cannot withdraw funds.

### ✅ Requirements

Session keys only work with Polymarket **Deposit Wallets**, which every account created on or after May 4, 2026 uses. Older accounts (Safe or Proxy wallets) aren't supported yet.

### 📝 Connection Form Fields

#### 1. Name (optional)

Give your connection a custom name.

* Example: `My Polymarket Wallet`
* If left empty, a name will be generated automatically

#### 2. Exchange & Service

Select the appropriate option:

* Exchange: **Polymarket**

#### 3. Profile Address

This is your Polymarket Profile Address.

* Starts with: `0x...`
* This is where you send your funds
* Used as your trading identity on Polymarket

📌 You can find this inside your Polymarket account.

#### 4. Wallet Private Key

The private key of the wallet that owns your Polymarket account.

* Used only to create your session key
* **Never saved**: it's discarded as soon as the session key is created

⚠️ Never share your private key anywhere you don't trust.

### ⏳ Session Key Expiry

Your session key is valid for **180 days**. When it expires, your strategies stop placing trades until you reconnect with your private key to create a new one.

### 🔄 Funding Your Account

Before trading:

1. Send USDC to your Profile Address
2. Wait for confirmation
3. Your balance will be available for trading

### ⚠️ Security Notes

* You retain full ownership of your funds
* Your private key is never stored
* The session key can only trade, it cannot withdraw funds
* Always use a dedicated wallet for automation (recommended)


# Create Prediction Signal Bot

This page explains how to create and configure a bot that automatically executes trades on prediction markets (e.g. Polymarket) 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**](/getting-started/webhook). 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/prediction-signal-bot-beta/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 will be named automatically based on the webhook URL

***

#### `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 wallet connection you created earlier
* Used to:
  * Sign transactions
  * Execute trades
  * Access your funds

***

#### **`Slug From Signal`**&#x20;

Enables Wildcard / Slug from Signal mode.

* Enabled → The bot dynamically processes market slugs provided in each incoming [signal payload](/prediction-signal-bot-beta/payload-format), 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` *(*&#x72;equired if 'Slug From Signal' is disable&#x64;*)*

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
```

📌 The system extracts the **slug** from this URL automatically.

***

<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&amp;token=238481b6-1093-4330-9a90-1613cef78dcf" alt=""><figcaption></figcaption></figure>

#### ⚠️ Important — Slug Matching

The **slug in your** [**signal payload**](/prediction-signal-bot-beta/payload-format) **must match this 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"
}
```

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

💡 Tip:\
Always copy the market URL carefully — even small differences in the slug will prevent execution.

***

#### `Amount From Signal`&#x20;

Controls how trade size is determined:

* **Enabled** → Use `size` from incoming signal payload
* **Disabled** → Use fixed amount defined below

***

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

The default trade size.

* Denominated in **USDC**
* Example: `250`

📌 This is used when:

* No `size` is provided in the signal
* Or "Amount From Signal" is disabled


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


# Connecting LLM Service

You can connect **Sigrex** to popular **LLM providers** using your own API keys. Once connected, you’ll be able to interact with and switch between supported models directly from your assistant logic or trading tools.

## 🧠 Supported Providers

Sigrex supports all major LLM providers shown below:

| Provider                                               | API ID               |
| ------------------------------------------------------ | -------------------- |
| [Google Gemini](https://gemini.google.com/)            | `1`                  |
| [OpenAI](https://openai.com/)                          | `2`                  |
| [DeepSeek](https://www.deepseek.com/)                  | `3`                  |
| [Claude](https://claude.ai/)                           | `4`                  |
| [Mistral](https://mistral.ai/)                         | `5`                  |
| [Cohere](https://cohere.com/)                          | `6`                  |
| [Grok (xAI)](https://grok.com/)                        | `7`                  |
| [Alibaba Cloud (Qwen)](https://www.alibabacloud.com/)  | `8`                  |
| [Perplexity](https://www.perplexity.ai/)               | ~~`9`~~ (suspended)  |
| [Moonshot AI (Kimi)](https://www.moonshot.ai/)         | `10`                 |
| [Z.ai](https://chat.z.ai/)                             | `11`                 |
| [MiniMax](https://www.minimax.io/)                     | `12`                 |
| [Nvidia](https://build.nvidia.com/)                    | `13`                 |
| [Nous Research](https://portal.nousresearch.com/)      | `14`                 |
| [OpenRouter](https://openrouter.ai/)                   | `15`                 |
| [Xiaomi (MiMo)](https://mimo.xiaomi.com/)              | ~~`16`~~ (suspended) |
| [Groq](https://groq.com/)                              | `17`                 |
| [Cerebras](https://www.cerebras.ai/)                   | `18`                 |
| [SiliconFlow](https://cloud.siliconflow.com/)          | `19`                 |
| [Sambanova](https://sambanova.ai/)                     | `20`                 |
| [Meta AI](https://developer.meta.com/ai/)              | `21`                 |
| [Vercel](https://vercel.com/ai-gateway)                | `22`                 |
| [Cheaper Inference](https://www.cheaperinference.com/) | `23`                 |

Each connection lets you choose and use any available model, including those with **vision capabilities** for chart analysis.

## 🔐 Security & Key Management

All API keys are **securely encrypted** and only decrypted at runtime.\
Even platform operators cannot access your plain-text API keys.

## ⚙️ Connection Rules

* During setup, Sigrex sends a **test request** to validate your API key:
  * If the key is invalid or your account lacks credits, the connection will fail.
* The **API key cannot be edited** after creation.
* The **model** can be changed freely within the same provider connection.

## 🪄 Steps to Connect

1. Choose your preferred **LLM provider** from the list.
2. Select the **model** you want to use under that provider.
3. Insert you API key.
4. Click **“Create Connection.”**
5. If the test succeeds, the connection is saved and available to activate.

Once connected, you can freely switch between **supported models** (including vision-enabled ones) across your Sigrex tools — such as **trading bots**, **assistants**, and **dashboards**.


# Code

With the Code feature, you can write your own trading strategy directly in JavaScript.

Your strategy runs in a sandboxed environment where you can analyze the current market data, store custom information, and trigger actions using the built-in `$` object.

***

## 🧩 Available Variables

Each run of your strategy includes access to the following objects and functions:

***

### **`$.Action`**

Enum representing all available trade actions:

* `LONG` → Open a long position
* `SHORT` → Open a short position
* `EXIT` → Close the current position

***

### **`$.Exchange`**&#x20;

Enum representing the exchanges supported by the Sigrex live exchange-rate system.

| **Value**                | **Description** |
| ------------------------ | --------------- |
| `$.Exchange.BINANCE`     | Binance         |
| `$.Exchange.GATEIO`      | Gate.io         |
| `$.Exchange.BITGET`      | Bitget          |
| `$.Exchange.HYPERLIQUID` | Hyperliquid     |
| `$.Exchange.KRAKEN`      | Kraken          |

The enum is used with `$.getExchangeRate()` to specify which exchange should be queried.

***

### **`$.Price`**

{% hint style="warning" %}
The current market price info of the selected symbol only if "use price" option enabled.
{% endhint %}

| Property   | Description                                  |
| ---------- | -------------------------------------------- |
| `symbol`   | Price symbol, e.g. `"BTCUSDT"`               |
| `price`    | Current price of the `symbol`                |
| `exchange` | Source Exchange identifier, e.g. `"binance"` |
| `service`  | Market type, e.g. `"spot"` or `"futures"`    |

Example:

```js
if ($.Price.price > 25000) {
    await $.Strategy.action($.Action.LONG);
}
```

***

### `$.Env`

Provides access to user-defined environment variables.

Users can define global or folder scope environment variables that are automatically available across all strategy executions.

These values can be accessed at runtime using the `$.Env` object.

***

Example:

```ts
const apiKey = $.Env.API_KEY;
const risk = $.Env.RISK;
```

***

### **`$.Strategy`** Properties

Provides context for the current trading session and allows you to execute actions.

| Property | Description                                              |
| -------- | -------------------------------------------------------- |
| `id`     | The unique numeric ID of the current strategy            |
| `type`   | The type of strategy: `code-strategy` or `code-reaction` |

Available if "send signal" enabled

| Property             | Description                                                            |
| -------------------- | ---------------------------------------------------------------------- |
| `signalSymbols`      | Array of symbols where signal actions are sent (`["BTCUSDT",ETHUSDT]`) |
| `lastTrigger.action` | The most recent action (`LONG`, `SHORT`, or `EXIT`)                    |
| `lastTrigger.price`  | The price when the last action was executed                            |
| `lastTrigger.at`     | Timestamp of the last action, or `null` if none                        |

### **`$.Strategy`** Methods

#### `roi(percentage?: boolean, openPrice?: number, currentPrice?: number): number|null`

Calculates the current Return on Investment (ROI) based on the difference between open and current price.

If no prices are provided, it automatically uses the last trigger price as the open price and the current system price. You can override these by passing custom values.

Returns the result as a percentage when enabled, otherwise as a decimal. If no valid price data is available, it returns `null`.

ROI Example:

```ts
// Default usage (uses last trigger price + current price if enabled)
const roiValue = $.Strategy.roi();

// ROI as percentage
const roiPercent = $.Strategy.roi(true);

// Using custom prices
const customRoi = $.Strategy.roi(false, 100, 120);
```

> ⚠️ Keep in mind: for short positions, profitable trades will result in a negative ROI value.

#### `async action(type: $.Action, options?: ActionOption)`

{% hint style="warning" %}
Available only if "send signal" option enabled.
{% endhint %}

Executes a strategy action such as `$.Action.LONG`, `SHORT`, or `EXIT`.

You can optionally pass additional settings like `id`, `size`, or `dilution` to control how the action is handled. The structure is similar to a [signal payload](/getting-started/signal-payload-format).

#### Options

```typescript
type ActionOption = {
    id?: string;                    // A custom name/id for the alert (optional)
    dilution?: boolean;             // If true, allows partial stacking of positions (optional)
    size?: number;                  // Trade size (open in quote, close in base currency), overrides default (optional)
    forceSize?: boolean;            // It can bypass the amount of those bots that have strict amount settings
}
```

Action Example:

```ts
// Simple action
await $.Strategy.action($.Action.LONG);

// Action with options
await $.Strategy.action($.Action.SHORT, {
  id: "trade-1",
  dilution: true,
});
```

The function sends the action to the system and returns the execution result. If the provided options are invalid, it returns an error.

#### **`async stop(notify?: boolean): boolean`**

Stops the strategy from executing again by setting its status to `INACTIVE`.

**Important:** `stop()` does **not** terminate the currently running strategy process. The current execution continues after calling `stop()`. To stop the current execution as well, use `return` after calling `stop()`.

If `notify` is `true`, the system sends a notification email about the strategy being stopped.

**Parameters**

```
notify?: boolean; // Sends a notification email if true
```

**Example**

```
await $.Strategy.stop(true);return;
```

> ⚠️ Use `return` after `stop()` if you want to terminate the current execution. Without `return`, the current process continues, but the strategy will not execute again.

***

### **`$.Storage`**

Persistent JSON storage (up to **24 KB**) that remains between strategy runs.

| Function         | Description                                                 |
| ---------------- | ----------------------------------------------------------- |
| `byteLimit`      | Constant holding the maximum allowed bytes (24,576)         |
| `async get()`    | Retrieves the current stored data (returns `null` if empty) |
| `async set(obj)` | Saves a new data object (overwrites existing data)          |

Example:

```js
const state = await $.Storage.get() || { trades: 0 };
state.trades++;
await $.Storage.set(state);
```

***

### `$.Http`

Utility for sending HTTP requests from within your strategy.

Each request has a maximum timeout of `1750 ms`.

> &#x20;`POST` and `PUT` requests default to `Content-Type: application/json`.

***

<table><thead><tr><th width="435.333251953125">Method or Property</th><th>Description</th></tr></thead><tbody><tr><td><code>timeout</code></td><td>Constant timeout value in milliseconds (<code>1750</code>)</td></tr><tr><td><code>async get(url, params?, headers?)</code></td><td>Sends a GET request</td></tr><tr><td><code>async post(url, data, headers?)</code></td><td>Sends a POST request</td></tr><tr><td><code>async put(url, data, headers?)</code></td><td>Sends a PUT request</td></tr><tr><td><code>async delete(url, params?, headers?)</code></td><td>Sends a DELETE request</td></tr><tr><td><code>async generateSignature(payload, secret, algo?)</code></td><td>Generates an HMAC or ML-DSA44 signature from a payload and secret. Algo options: <code>"HMAC" or "ML-DSA"</code> Default is: <code>HMAC</code></td></tr><tr><td><code>createApiClient({ apiKey, apiSecret })</code></td><td>Creates an instance of the official <a href="https://github.com/sigrexio/sigrex-client-ts">Sigrex API Client</a> that can be used to interact with the services directly from your strategy.</td></tr></tbody></table>

***

#### Response Format

All HTTP methods return an object in the following format:

```ts
{ 
  status: number,
  text: string,
  cache: boolean
}
```

* `status` → HTTP status code (e.g. `200`, `404`, `500`)
* `text` → Raw response body as string
* `cache` → Indicates whether the response was cached

***

#### Caching

> ⚠️ All HTTP requests are cached for **5 seconds**.\
> During this period, repeated requests return the same response.\
> You can check the `cache` field to see if the response was served from cache.

***

Example:

```ts
const params = { symbol: "BTCUSDT" };

const response = await $.Http.get(
  "https://api.binance.com/api/v3/ticker/price",
  params
);

if (response.status === 200) {
  const data = JSON.parse(response.text);
}
```

***

API Client Example:

```typescript
const client = $.Http.createApiClient({
    apiKey: $.Env.API_KEY
    apiSecret: $.Env.API_SECRET,
});

const exchanges = await client.exchanges.list({ enabled: true });
```

***

Signature Example:

```ts
const API_KEY = "your_public_api_key";
const API_SECRET = "your_private_api_secret";

const method = "POST";
const path = "/api/v2/strategy/llm-session";

const body = {
  name: "My Strategy",
  cron_interval: "15m"
};

const timestamp = Math.floor(Date.now() / 1000).toString();

const payload =
  method + path + JSON.stringify(body) + timestamp;

const signature = await $.Http.generateSignature(payload, API_SECRET);
```

***

### **`$.Ta`**

Provides access to a built-in **technical analysis library** for calculating indicators and signals directly inside your strategy or reaction.

The `$.Ta` object exposes the functionality of the **trading-signals** library:

👉 <https://github.com/bennycode/trading-signals/tree/main/packages/trading-signals>

***

#### What You Can Do

With `$.Ta`, you can:

* Calculate indicators like **RSI, EMA, SMA, MACD, ATR, Bollinger Bands**
* Build custom technical strategies
* Combine indicators with webhook data or price logic
* Perform calculations without external API calls

***

#### Usage

Indicators are typically used by feeding values sequentially.

Example: RSI

```typescript
const rsi = new $.Ta.RSI(14);

rsi.update(30000);
rsi.update(30100);
rsi.update(29950);

if (rsi.isStable) {
  const value = rsi.getResult();

  if (value < 30) {
    await $.Strategy.action($.Action.LONG);
  }
}
```

***

### **`Utils`**

#### **`async getExchangeRate(exchange: $.Exchange, symbol: string): number|null`**

Returns the current exchange rate for a symbol on the specified exchange.

The `exchange` parameter must be one of the supported values from the `$.Exchange` enum. If a current rate is available, the function returns it as a `number`; otherwise, it returns `null`.

**Parameters**

```javascript
exchange: $.Exchange; // The exchange to retrieve the rate from
symbol: string;       // The symbol to retrieve (e.g. "btcusdt")
```

**Example**

```javascript
const price = await $.getExchangeRate(
  $.Exchange.BINANCE,
  "btcusdt"
);
```

***

## ⚡ Rules & Limits

To ensure fair and safe execution, the following rules apply:

* Maximum **execution time:** 5000 ms per run
* Maximum **HTTP request time:** 1750 ms
* **HTTP cache :** 5 s
* Maximum **storage size:** 24 KB
* Only **one action per run** is allowed
* Maximum **five actions per second** globally
* Two consecutive `EXIT` actions are **not permitted**
* Violating these limits will **suspend** the strategy temporarily

***

## 🧠 Example Strategy

```js
// Example: simple entry and exit logic

if ($.Strategy.lastTrigger.action === $.Action.EXIT) {
    if ($.Price.price < 19000) {
        await $.Strategy.action($.Action.LONG);
    }
} else {
    if ($.Price.price > 20000) {
        await $.Strategy.action($.Action.EXIT);
    }
}
```

This example demonstrates:

* Checking the last executed action (`$.Strategy.lastTrigger.action`)
* Using current market data (`$.Price`)
* Executing a new action with (`$.Strategy.action()`)

***

## 🏁 Summary

| Feature                | Description                              |
| ---------------------- | ---------------------------------------- |
| **Action trigger**     | `await $.Strategy.action($.Action.LONG)` |
| **Available actions**  | `LONG`, `SHORT`, `EXIT`                  |
| **Actions per run**    | 1                                        |
| **Actions per second** | 5                                        |
| **Execution time**     | 5000 ms                                  |
| **Storage limit**      | 24 KB                                    |
| **HTTP timeout**       | 1750 ms                                  |
| **HTTP cache**         | 5 seconds (see `response.cache`)         |
| **Duplicate EXITs**    | Not allowed                              |

## 🔒 Sandbox Restrictions & Forbidden Identifiers

Your strategy code runs inside a **strictly sandboxed environment**.\
For security, stability, and fair usage, **certain JavaScript identifiers are completely blocked** and **cannot be used anywhere in your code** — not even indirectly or in comments.

If your strategy references any of the identifiers listed below, **execution will fail** and the strategy may be suspended.

***

#### 🚫 Forbidden Identifiers

The following identifiers are **not available** and **must not appear** in your strategy code:

**Networking & Communication**

* `fetch`
* `WebSocket`
* `EventSource`
* `Worker`, `SharedWorker`
* `XMLHttpRequest`
* `navigator`, `location`
* `postMessage`
* `onmessage`, `onmessageerror`
* `MessageChannel`, `BroadcastChannel`
* `import`
* `importScripts`
* `close`

> ✅ Use `$.Http.get()` and `$.Http.post()` instead.

***

**Dynamic Code Execution**

* `eval`
* `Function`
* `AsyncFunction`
* `generatorFunction`
* `constructor`

> ❗ Dynamic or runtime-generated code is not permitted.

***

**Global Objects & DOM-Like APIs**

* `globalThis`
* `window`
* `self`
* `frames`
* `parent`
* `top`
* `document`

> ℹ️ There is **no DOM, browser, or global scope access**.

***

**Timers & Scheduling**

* `setTimeout`, `setInterval`, `setImmediate`
* `clearTimeout`, `clearInterval`, `clearImmediate`
* `queueMicrotask`

> ⏱ Strategies are **event-driven** and executed automatically — manual scheduling is not allowed.

***

**Crypto, Performance & Parallelism**

* `crypto`
* `performance`
* `structuredClone`
* `Atomics`
* `SharedArrayBuffer`

***

**Reflection & Obfuscation**

* `Reflect`
* `Proxy`

***

**Node.js / Deno Environment**

* `process`
* `require`
* `module`
* `exports`
* `export`&#x20;
* `global`
* `Deno`

> ❌ This is **not** a Node.js or Deno runtime.

***

**Encoding / Decoding**

* `atob`
* `btoa`

***

**User Interaction & Debugging**

* `alert`
* `confirm`
* `prompt`
* `console`
* `Intl`
* `FinalizationRegistry`
* `WeakRef`

> 🛑 Logging, dialogs, locale detection, and memory introspection are intentionally disabled.

***

#### ✅ What You *Can* Use

Instead of the blocked APIs, always rely on:

* **Market data:** `$.Price`
* **Trading actions:** `$.Strategy.action(...)`
* **Persistent state:** `$.Storage.get()` / `$.Storage.set()`
* **HTTP requests:** `$.Http.get()` / `$.Http.post()`

These are **the only supported interfaces** for interacting with the outside world.

***

#### ⚠️ Important Notes

* Forbidden identifiers cannot be used **anywhere**:
  * Not in variables
  * Not in functions
  * Not in comments
  * Not via aliases
  * Not via destructuring
* Even unused references may cause execution failure
* Violations may result in **temporary strategy suspension**


# LLM Session

An LLM Session lets you run scheduled AI analyses using large language models.

Each session executes automatically at a defined interval and produces an analysis result based on your configuration.

LLM Sessions can be used for:

* Market commentary
* Strategy reasoning
* Context-aware trade evaluation
* AI-assisted decision support

> Chart input is **optional**.\
> For visual chart analysis, see [**Chart Setup**](/startegies/llm-session/chart-setup).

***

### 🛠️ How It Works

On each run, an LLM Session sends the following to the AI:

* Your **custom prompt**
* System context (when available):
  * Symbol
  * Timeframe
  * Last action
* **Optionally:** a chart image with indicators

The AI processes this information and returns a structured or free-form analysis, depending on your prompt.

***

### ⚙️ Core Configuration

#### Name

Optional.\
If left empty, a name is generated automatically.

***

#### LLM Connection

Select the AI model used for this session.

* **Text-only sessions** → Any supported model
* **Chart-based sessions** → Image-capable (vision) models only

Model compatibility depends on whether **chart input** is enabled.

***

#### Analysis Period

Defines how often the session runs.

Available intervals:

* 3 minutes
* 5 minutes
* 15 minutes
* 30 minutes
* 1 hour
* 2 hours
* 4 hours
* Daily

***

#### Prompt

Defines what the AI should do.

Prompts can be:

* Descriptive (“Summarize market conditions”)
* Analytical (“Evaluate trend strength and momentum”)
* Strategic (“Assess whether conditions favor continuation or reversal”)

You may use **free-form natural language**.

***

#### Send Email

Enable this option to receive the analysis result by email after each run.

***

### 📊 Chart Input (Optional)

LLM Sessions can optionally include a **chart image**.

* When enabled, the AI receives a visual chart with indicators
* When disabled, the session runs as **text-only**

Chart configuration is handled separately.\
See [**Chart Setup**](/startegies/llm-session/chart-setup) for details.

***

### 🧾 Output & Results

Each session run produces an output that is:

* Stored and viewable in the platform
* Timestamped for historical review
* Optionally sent via email

LLM Sessions do **not** execute trades by default.

***

### 🔍 What LLM Sessions Are *Not*

* ❌ Not automatic trading
* ❌ Not guaranteed signals
* ❌ Not raw market data processing

For AI-generated trade signals, use **with** [**Signal Generation**](/startegies/llm-session/signal-generation).

***

### 🔗 Related Features

* [**Chart Setup**](/startegies/llm-session/chart-setup) – Configure visual chart input
* [**Session with Signal Generation**](/startegies/llm-session/signal-generation) – Generate actionable signals

***

### 🧠 Best Practices

* Start with **text-only sessions** to refine your prompt
* Enable chart input only when visual context is needed
* Keep prompts **clear and focused**
* Match the analysis period to the chart timeframe


# Chart Setup

This page explains how to configure chart input for AI-powered analysis.

Chart input is **optional**, but when enabled it allows the AI to analyze a **visual price chart with indicators**. This requires selecting an **image-capable AI model**.

***

### 🧠 When to Use Chart Input

Enable chart input if you want the AI to:

* Visually analyze **price structure**
* Identify **trends, ranges, and breakouts**
* Interpret **indicator behavior** directly from the chart
* Combine **visual context** with your custom prompt

If you only need **text-based reasoning** or strategy logic, chart input is not required.

***

### ⚠️ Model Compatibility

Chart input requires an AI model that supports **image (vision) input**.

* ✅ **Chart input enabled** → **Vision-capable model required**
* ✅ **Chart input disabled** → Any supported text-based model can be used

If a non-vision model is selected while chart input is enabled, the session will not run.

***

### ⚙️ Chart Configuration Options

#### Chart Image Input

Toggle this option to enable or disable chart screenshots.

* **Enabled**
  * A chart image is captured on each session run
  * Indicators are rendered on the chart
  * The image is sent to the AI for analysis
* **Disabled**
  * No chart image is sent
  * Indicator and timeframe settings are ignored

***

#### Symbol

The trading pair or market to display on the chart.

Uses **TradingView-compatible symbols**.

**Examples:**

* `BINANCE:BTCUSDT`
* `BINANCE:ETHUSDT`
* `BTCUSDT`

***

#### Candlestick Interval

Defines the timeframe of each candle on the chart.

**Common values:**

* `1m` – Scalping
* `5m`, `15m` – Intraday
* `1h`, `4h` – Swing trading
* `1d` – Higher timeframe analysis

***

#### Indicators

You can enable **up to two indicators** to be displayed on the chart.

Supported indicators include:

* RSI
* MACD
* EMA
* VWAP
* ATR
* Bollinger Bands

> Indicators are rendered directly onto the chart image and interpreted visually by the AI.

***

### 🖼️ What the AI Receives

When chart input is enabled, the AI receives:

* A **chart screenshot**
* The selected **symbol**
* The **candlestick interval**
* Enabled **indicators**
* Your **custom prompt**
* Any additional system context (e.g. last action)

***

### ✍️ Prompt Writing Tips for Chart Analysis

When using chart input, your prompt should reference **visual elements**.

**Good examples:**

* “Analyze the trend and momentum shown on the chart.”
* “Identify key support and resistance zones.”
* “Check if RSI divergence is forming.”
* “Is the price consolidating or breaking out?”

Avoid prompts that rely only on **numerical data**, since the AI is analyzing an image, not raw OHLC values.

***

### ❌ Common Misconfigurations

* Enabling chart input while using a **text-only AI model**
* Expecting indicator analysis when **chart input is disabled**
* Using very short analysis intervals with **high timeframes** (e.g. 1m period on 1d candles)

***

### 🔗 Related Pages

* [**LLM Session**](/startegies/llm-session) – Schedule AI-based analysis
* [**Chart Analysis with Signal Generation**](/startegies/llm-session/signal-generation) – Generate actionable trading signals


# Signal generation

LLM Session with Send Signal enabled

This feature enables the AI to not only reason about market conditions but also execute real trading actions.\
When enabled, all trading decisions are automatically **sent to your webhook for live processing**.

{% hint style="danger" %}

### &#x20;Disclaimer

This feature is experimental and high-risk. LLMs can make mistakes, misinterpret market conditions, and overreact to price movements. Trading with it can result in financial loss.

Use it carefully with a webhook setup, preferably with no real capital attached, and monitor all signals and logs continuously.
{% endhint %}

***

### ⚙️ Execution Flow

When Signal Generation is active:

1. The system builds the final prompt using:
   * **System prompt (auto-injected)**
   * **User strategy prompt with resolved template variables**
2. The AI evaluates the strategy and decides whether to act
3. If conditions are met, it executes an action:
   * Open position (BUY / SELL)
   * Close position (EXIT)
   * Request market price if needed
4. Executed actions are processed and forwarded as trading signals (e.g. webhook)

If no valid setup is found, no action is executed.

### 📡 Signal Symbol Configuration

The user must define the trading symbol(s) used for execution.

#### Format

Single symbol (recommended):

```
BTCUSDT
```

Multiple symbols (optional):

```
BTCUSDT,ETHUSDT,SOLUSDT
```

{% hint style="warning" %}

#### Scope Rules

* Symbols define **execution scope only**
* Symbols are **not injected into the prompt**
* The AI does not assume available symbols unless explicitly referenced in the user prompt
  {% endhint %}

## 🛠️ LLM Tooling Reference

These tools allow LLMs to execute trading actions, access market and external data, manage persistent state, communicate with other automations, inspect strategy performance and errors, and dynamically control and modify other strategies.

### `open_position`

Opens a new trading position (**BUY (LONG)** or **SELL (SHORT)**) on one or more selected symbols.

Used to execute entry signals directly through the trading system.

***

### `close_position`

Closes an active trading position.

Used for exiting trades based on strategy logic such as profit targets, stop losses, or signal reversals.

***

### `get_symbol_price`

Returns the current market price of a trading pair.

Useful for making live trading decisions and evaluating strategy conditions.

***

### `set_storage`

Stores a persistent JSON object for the strategy.

Calling this tool **replaces the entire existing storage** with the provided value.

Storage is persisted between executions, allowing the LLM to maintain long-term memory and state across strategy runs.

> **Storage Limit:** The maximum storage size is **25 MB**. Attempting to store more data will result in an error.

***

### `get_storage`

Retrieves the strategy's currently saved storage.

Returns the complete persistent JSON object previously stored by the strategy.

***

### `append_storage`

Appends new data to the existing strategy storage without replacing it.

Unlike `set_storage`, this tool preserves the current storage and merges or appends the provided data, making it ideal for gradually building logs, histories, or other persistent datasets.

> **Storage Limit:** The combined storage size cannot exceed **25 MB**. If the limit is exceeded, the tool will return an error.

***

### `web_fetch`

Performs an HTTP **GET** request to a specified URL.

Useful for retrieving external data such as market information, APIs, news feeds, or other publicly available resources.

***

### `run_javascript_code`

Executes custom JavaScript code inside the strategy sandbox.

The tool expects the **body of an asynchronous function**, executes it, and returns the function's return value.

The execution environment uses the same secure sandbox as [**Code Strategies**](/startegies/code), including the same runtime restrictions, resource limits, and security policies. This allows the LLM to perform custom calculations, data transformations, or other logic that would be difficult to express through tool calls alone.

***

### `send_email`

Sends an email to the strategy owner.

Useful for delivering alerts, reports, trade summaries, or other custom notifications generated by the AI strategy.

***

### `get_current_date_time`

Returns the current date and time.

Useful for time-sensitive decisions, scheduling logic, calculating time ranges, or working with timestamps.

***

### `get_candlestick_data`

Fetches historical OHLCV candlestick data for a trading pair.

Allows the LLM to retrieve market history for a specific **symbol**, **timeframe**, and optional time range or candle limit. Useful for technical analysis, pattern detection, and evaluating historical price action.

***

### `get_signal_logs`

Retrieves signal logs from other strategies.

Allows the LLM to analyze historical signals and evaluate strategy performance, including signal outcomes and profitability.

Useful for comparing strategies, measuring performance, identifying patterns, and making data-driven decisions.

***

### `get_error_logs`

Retrieves error logs from strategies.

Allows the LLM to inspect historical strategy errors and execution failures, helping it identify recurring problems, diagnose issues, and learn from previous failures.

***

### `get_code_strategy`

Retrieves a Code Strategy by `id`.

Returns its configuration, including the code, status and last run time. The strategy's storage is not included.

***

### `get_llm_session`

Retrieves an LLM Session by `id`.

Returns its configuration, including the prompt and status.

***

### `get_code_reaction`

Retrieves a Code Reaction by `id`.

Returns its configuration, including the code and status.

***

### `get_llm_reaction`

Retrieves an LLM Reaction by `id`.

Returns its configuration, including the prompt and status.

***

### `set_code_strategy`

Replaces the code of a Code Strategy. Takes `id` and `code`.

The new code replaces the old code entirely, and the strategy keeps its current status.

***

### `set_llm_session`

Replaces the prompt of an LLM Session. Takes `id` and `prompt`.

***

### `set_code_reaction`

Replaces the code of a Code Reaction. Takes `id` and `code`.

***

### `set_llm_reaction`

Replaces the prompt of an LLM Reaction. Takes `id` and `prompt`.

***

### `set_code_strategy_status`

Starts or stops a Code Strategy. Takes `id` and `status` (`ACTIVE` or `INACTIVE`).

***

### `set_llm_session_status`

Starts or stops an LLM Session. Takes `id` and `status` (`ACTIVE` or `INACTIVE`).

***

### `set_code_reaction_status`

Starts or stops a Code Reaction. Takes `id` and `status` (`ACTIVE` or `INACTIVE`).

***

### `set_llm_reaction_status`

Starts or stops an LLM Reaction. Takes `id` and `status` (`ACTIVE` or `INACTIVE`).

### 🧠 System Prompt (Automatically Added)

When signal sending is enabled, two things happen automatically:

1. **Prepending context** to your prompt:

   ```
   You are a trading bot now.
      
   The last order was {{last_trigger_action}}.
   That executed at {{last_trigger_at}}.
   Storage: {{storage}}
   The current time is {{current_time}}.

   IMPORTANT: if the last order was not "EXIT" or "HOLD" that means a position is open and we need to close it or hold it.
   We can only have one position at a time and have to close it before we can open a new one.
   You can make BUY (long) or SELL (short) orders with the help of provided tools. 
   ```

***

### ⚙️ Writing a Good Prompt

To ensure reliable signals, your custom prompt should focus on the **decision-making logic**, not the output format. Here's an example:

#### 📝 Example Custom Prompt

```
Trade on BTCUSDT, The goal is to exit with at least 0.8% profit or stop out with a 1% loss.  
If either level is hit, the position must be closed.

You are analyzing a trading chart.  
Based on current indicators and chart patterns, choose the best action.  
Consider the previous order when making your decision.
```

> 🔁 The system will handle formatting instructions [automatically](#system-prompt-automatically-added) — no need to repeat them.

***

## 🧩 Template Variables

To make prompt creation easier and more dynamic, you can now use the following **template variables** in your prompt:

| Template                               | Description                                                                                                                                                                                                                                                                                                                                                            |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{last_trigger_action}}`              | The last executed signal (e.g., `LONG`, `SHORT`, `EXIT`)                                                                                                                                                                                                                                                                                                               |
| `{{last_trigger_at}}`                  | Timestamp when the last signal was executed (e.g., `2025-06-04 15:32 UTC`)                                                                                                                                                                                                                                                                                             |
| `{{current_time}}`                     | The current time (automatically filled before execution)                                                                                                                                                                                                                                                                                                               |
| `{{val:<name>=<value>}}`               | <p>Declares a <strong>custom value</strong> within your prompt. You can define it once and reuse it anywhere. For example:<br><code>{{val:user=Joe}}</code> then later use <code>{{user}}</code> → will be replaced with <code>Joe</code>.</p>                                                                                                                         |
| `{{price:<exhange>:<service>:<pair>}}` | Returns the live market price for a given trading pair from a specific exchange and market type (e.g. spot, futures). [See available exchanges](#price-variable-reference)                                                                                                                                                                                             |
| `{{comment:<text>}} or {{#:<text>}}`   | Adds inline comments to the prompt for readability and documentation. Comment content is **stripped before the final prompt is sent** and never reaches the model.                                                                                                                                                                                                     |
| `{{get:<url>}}`                        | Fetches data via an **HTTPS GET request** from the specified URL and injects the response into the prompt. Requests are limited to **HTTPS** and have a **timeout of 1750 ms**.                                                                                                                                                                                        |
| `{{toon:<json>}}`                      | Converts JSON into [**Toon**](https://toonformat.dev/) **format**, a compact link-based representation that helps **reduce final prompt token count** while preserving the original content semantics.                                                                                                                                                                 |
| `{{storage}}`                          | Persistent JSON storage associated with the strategy. The stored data is automatically injected into the model's system instructions on every execution, so the AI already has access to it without needing to include `{{storage}}` in the prompt. Use this variable only when you need to explicitly reference or manipulate the storage content inside your prompt. |

These help the AI reason based on **past actions and current context**.

***

#### 📝 Example Prompt with Templates

```
{{comment: example comment }}

{{val:target_profit=0.8}}
{{val:max_loss=1.0}}
{{val:symbol=BTCUSDT}}

You're observing a live trading chart for {{symbol}} with real funds in play.
Your mission: secure at least {{target_profit}}% profit or exit the position if losses reach {{max_loss}}%.
Stay calm and act based on structure, momentum, and signal context.

Previous signal: {{last_trigger_action}} at ({{last_trigger_at}})
Current time: {{current_time}}

External data sources:

Market sentiment: {{get:https://api.example.com/sentiment?symbol={{symbol}}}}

{{#: toon combined with get }}
Technical summary: {{toon: {{get:https://api.example.com/ta-summary?symbol={{symbol}}}} }}

Review the current chart carefully.
Consider trend strength, candle behavior, and volatility.
Weigh the previous signal and the data above before deciding on the next move.

```

### Price Variable Reference

The `{{price:<exchange>:<service>:<pair>}}` template variable allows you to dynamically inject real-time market prices into your LLM prompts or strategy logic.

It automatically fetches the latest price for a given trading pair from a specified exchange and market type.

<table><thead><tr><th width="177.666748046875">Exchange</th><th width="136.3333740234375">Service</th><th>Example</th></tr></thead><tbody><tr><td><code>binance</code></td><td><code>spot</code></td><td><code>{{price:binance:spot:btcusdt}}</code></td></tr><tr><td><code>bitget</code></td><td><code>spot</code></td><td><code>{{price:bitget:spot:btcusdt}}</code></td></tr><tr><td><code>kraken</code></td><td><code>spot</code></td><td><code>{{price:kraken:spot:btcusdt}}</code></td></tr><tr><td><code>gateio</code></td><td><code>spot</code></td><td><code>{{price:gateio:spot:btcusdt}}</code></td></tr><tr><td><code>hyperliquid</code></td><td><code>spot</code></td><td><code>{{price:hyperliquid:spot:btcusdt}}</code></td></tr></tbody></table>


# Data Webhook

A Data Webhook allows external systems to send data into Sigrex. Incoming data can then be processed by Reactions, using either code-based logic or AI-powered evaluation.

Data Webhooks are designed for **custom integrations**, **event-driven workflows**, and **external signal ingestion**.

***

### 🛠️ What Is a Data Webhook?

A Data Webhook is an **HTTP endpoint** that:

* Accepts **incoming JSON data**
* Stores and forwards the data internally
* Triggers one or more **Reactions**
* Can be **shared** with other users

> Currently, Data Webhooks accept **JSON payloads** only.\
> Support for **plain text input** is coming soon.

***

### 🧠 How It Works

1. You create a **Data Webhook**
2. Sigrex generates a **unique webhook URL**
3. External systems send `POST` requests to this URL
4. Incoming data is:
   * Validated
   * Stored
   * Forwarded to all connected **Reactions**
5. Reactions process the data using **code or AI**

***

### ⚙️ Configuration Options

#### Name

Optional.\
Used for easier identification inside the platform.

***

#### Description

Optional.\
Explain the purpose of the webhook or the type of data it receives.

***

### 🌐 Webhook URL

The Data Webhook URL is automatically generated by Sigrex.

The URL follows this format:

`https://hook.sigrex.io/data/<webhook-hash>`

For example:

`https://hook.sigrex.io/data/71d3c761-5ee8-4ged-8400-7132ce6899d7`

Use this URL as the target endpoint for external `POST` requests.

***

#### Payload Format

* **Supported:** JSON (`application/json`)
* **Coming soon:** Plain text payloads

***

#### Key Protection

Enable this option to secure your webhook with a shared secret.

* When enabled:
  * You must define a **password**
  * Requests must include the header:

```
X-Key: <your-password>
```

* Requests without the correct key will be rejected

This helps prevent unauthorized or accidental data submission.

***

### 🔐 Security Notes

* Treat the webhook URL as **sensitive**
* Use **Key Protection** when sharing the webhook
* Rotate the key if it becomes exposed

***

### 🤝 Sharing Webhooks

Data Webhooks can be **shared with other users**.

When shared:

* Others can send data to the same webhook
* All incoming data is processed **exactly the same way**
* Connected Reactions will receive data regardless of sender

This makes Data Webhooks ideal for:

* Team-based workflows
* Community-driven data sources
* Multi-system integrations

***

### 🔁 Forwarding to Reactions

Every incoming payload is automatically forwarded to **all Reactions** attached to the webhook.

Reactions can:

* Parse and validate data
* Trigger logic written in code
* Call AI models for interpretation or classification
* Route data to other Sigrex components

> Data Webhooks themselves do **not** execute actions — Reactions define what happens next.

***

### 🧪 Example Request

```http
POST /data-webhook/<id> HTTP/1.1
Content-Type: application/json
X-Key: my-secret-key

{
  "event": "price_alert",
  "symbol": "BTCUSDT",
  "price": 67250,
  "source": "external-system"
}
```

***

### 🔗 Related Features

* [**Code**](/reaction/code-reaction) **or** [**LLM**](/reaction/llm-reaction) **Reactions** – Define how incoming data is processed
* [**Bot Webhooks**](/getting-started/webhook) – Trigger trading bots directly
* [**LLM Sessions**](/startegies/llm-session) – Scheduled AI analysis
* [**Chart Analysis**](/startegies/llm-session/chart-setup) **with** [**Signal Generation**](/startegies/llm-session/signal-generation) – AI-driven signals

***

### 🚫 Limitations

* JSON-only payloads (for now)
* No direct trading actions without Reactions
* No schema enforcement (data is passed as-is)


# LLM Reaction

An LLM Reaction allows Sigrex to process incoming data using an AI model.

LLM Reactions are **event-driven** and are triggered automatically when data is received through a **Data Webhook**.

They can be used for:

* Data interpretation and classification
* AI-based decision making
* Event-driven trading logic
* Signal generation without chart analysis

***

### 🛠️ How LLM Reactions Work

1. A **Data Webhook** receives an incoming request
2. The payload is forwarded to all connected **Reactions**
3. The **LLM Reaction** injects the data into its prompt
4. The AI processes the request
5. The result is stored and optionally forwarded as a signal

LLM Reactions run **only when new data arrives** — there is no scheduling.

***

### ⚙️ Configuration

#### Prompt

The prompt defines how the AI should interpret incoming data.

LLM Reactions support the following template variables:

* `{{data}}` → Raw payload from the webhook request
* `{{ip}}` → IP address of the sender
* `{{headers}}` → Request headers in JSON format

These variables are replaced at runtime with the actual values from the incoming request.

***

#### 🧾 Example Prompt

```
You will receive external data below.

IP: {{ip}}
Headers: {{headers}}

Payload:
{{data}}

Analyze the data and decide whether any action is required.
If the data is incomplete or unreliable, take no action.
```

***

### 🧩 Incoming Data & Context

The AI receives structured context from the webhook request:

#### `{{data}}`

* Contains the full request body
* Passed to the AI **as-is**
* No schema enforcement
* Typically JSON (text support coming soon)

***

#### `{{headers}}`

* Contains all HTTP request headers
* Provided as a **JSON object**
* Useful for authentication, source identification, or metadata

***

#### `{{ip}}`

* The IP address of the request sender (if available)
* Can be used for filtering or trust-based logic

***

### 🧪 Example Incoming Payload

```
{
  "event": "trend_signal",
  "symbol": "BTCUSDT",
  "direction": "up",
  "confidence": 0.81
}
```

***

### 🧾 Output & Storage

Each execution produces an output that:

* Is stored in the platform
* Is linked to the triggering webhook event
* Can be reviewed for debugging and auditing
* Can be forwarded to downstream systems

***

### 🧠 System Context (Automatically Injected)

When Trading Decision Mode is enabled, Sigrex automatically injects system-level context.

#### Prepended Context

```
You are a trading decision engine.

The last action was {{last_trigger_action}}.
That action executed at {{last_trigger_at}}.
The current time is {{current_time}}.

IMPORTANT:
- Only one position can be open at a time.
- If the last action was LONG or SHORT, a position is currently open.
- A new position may only be opened after an EXIT.
```

***

### 🧠 Prompt Writing Best Practices

* Clearly define **when to act**
* Explicitly describe **exit conditions**
* Handle conflicting or low-confidence data
* Prefer deterministic language
* Suppress explanations when using decision mode

#### Example Trading Prompt

```
You will receive external trading data below.

{{data}}

Open a position only if confidence is above 0.8.
Exit immediately if the data contradicts the current position.
If conditions are unclear, respond with HOLD.
```

***

### 🚫 Limitations

* No chart or image input
* No price selection
* One action per execution
* No partial positions
* Output must be exact

***

### 🔗 Related Features

* [**Data Webhook**](/reaction/data-webhook) – Receive external data
* [**Code Reaction**](/reaction/code-reaction) – Deterministic logic processing
* [**LLM Session**](/startegies/llm-session) – Scheduled AI analysis
* [**Chart Analysis**](/startegies/llm-session/chart-setup) **with** [**Signal Generation**](/startegies/llm-session/signal-generation) – Chart-based signals
* [**Signal Bots**](/cex-signal-bot/creating-a-cex-signal-bot) – Execute trades

***

### 🧠 Summary

LLM Reactions provide a powerful way to:

* React to live external data
* Apply AI reasoning in real time
* Make structured trading decisions
* Build event-driven trading systems without charts

They are best suited for **clean, rule-guided AI decisions** triggered by external events.


# Code Reaction

A Code Reaction lets you write custom JavaScript code that runs whenever a Data Webhook receives a request.

It works like a [**Code Strategy**](/startegies/code), but instead of running on market ticks, it executes **event‑driven** — triggered by incoming webhook data.\
The webhook’s request data is injected into your code so you can react to it, trigger trading actions, store state, and perform HTTP requests.

***

### 🧩 Request Data Object

For each webhook request, Sigrex makes the incoming request available inside your reaction as a `Request` object:

| Field               | Description                        |
| ------------------- | ---------------------------------- |
| `$.Request.ip`      | Sender’s IP address (if available) |
| `$.Request.headers` | All incoming HTTP headers          |
| `$.Request.data`    | Full payload as a string           |

You can parse `$.Request.data` into JSON if needed:

```js
const payload = JSON.parse($.Request.data);
```

***

{% hint style="info" %}

### Code Reactions share the same execution environment and capabilities as [Code Strategies](/startegies/code), extended with the `$.Request` object.

{% endhint %}

***

### 🧠 Example Code Reaction

Here’s a sample that reacts to incoming webhook data and triggers trades:

```js
// Parse the incoming payload
const payload = JSON.parse($.Request.data);

// Load persistent state
const state = await $.Storage.get() || { triggers: 0 };
state.triggers++;

// Logic based on external signal
if (payload.signal === "BUY" && payload.confidence > 0.8) {
    await $.Strategy.action($.Action.LONG);
} else if (payload.signal === "SELL") {
    await $.Strategy.action($.Action.EXIT);
}

// Save state
await $.Storage.set(state);
```

This shows:

* Parsing `$.Request.data`
* Using persistent storage
* Applying custom logic
* Triggering trading actions

***

### 🔍 Typical Use Cases

Code Reactions are ideal for:

* Validating and normalizing external webhook data
* Filtering incoming signals before acting
* Coordinating multiple webhook sources
* Building safety layers for automated bots
* Custom preprocessing for downstream logic

***

### 🚫 Limitations

* No chart or image input
* No AI reasoning
* One execution per webhook event
* Deterministic output only

***

### 🔗 Related Features

* [**Data Webhook**](/reaction/data-webhook) – Receive event data
* [**LLM Reaction**](/reaction/llm-reaction) – AI‑powered reaction logic
* [**Simple Code Strategy** ](/startegies/code)– Scheduled market logic

***

### 🧠 Summary

Code Reactions extend the flexibility of Code Strategies into the **event‑driven world**.\
They let you run custom JavaScript logic whenever external systems send data — enabling highly customizable automated workflows with full control over data, state, and trade actions.


# Friends

Managing Your Friends and Sharing Access

On the Friends page, users can manage their friend connections, which are essential for **sharing webhooks and assets** across accounts.

***

## 🔧 **What You Can Do Here**

* **Send** friend requests to other users
* **Accept** or **ignore** incoming requests
* **Delete** or **cancel** existing connections

Friendship is **required** to share webhooks and other connected resources between users.

***

## 🚫 **Rules & Limitations**

* If a **friend connection is deleted**, both users will **lose access** to any previously shared assets or webhooks.
* If a user **cancels a friend request**, the other user will **not be able to send another** request again unless the canceling user **removes them from the "Rejected Requests" list**.
* You can **block new friend requests** from your account settings—but by default, **this setting is enabled**.

***

## 🔐 **Privacy & Control**

* You’re always in control of your friend list.
* All connection actions are **mutual and respect user consent**.
* Friend connections are one-to-one and private—**only friends can share resources** with each other.


# MCP server

Connect Claude, ChatGPT, Codex, Cursor, VS Code, Hermes or OpenClaw to your Sigrex account and manage strategies, bots and signals in plain language.

Sigrex hosts a remote [Model Context Protocol](https://modelcontextprotocol.io/) server. MCP is an open standard that lets AI assistants use external tools. Compatible clients discover the Sigrex tools on their own and sign you in with OAuth, so there are no API keys to copy.

### Server endpoint

```
https://mcp.sigrex.io
```

The server uses Streamable HTTP. The first time you connect, your client opens the Sigrex sign-in page in your browser. Log in and approve access.&#x20;

> ⚠️ **The connection has full access to your account**, including placing live trades. Only connect clients you trust, and check every action before you approve it.

### Connect your client

In most clients, add the URL above as a remote MCP server or custom connector, then sign in.

**Claude:** go to **Customize → Connectors**, click **+**, then **Add custom connector**, and paste the URL.

**ChatGPT:** turn on **Developer mode** under **Settings → Security and login**. Then go to [chatgpt.com/plugins](https://chatgpt.com/plugins), click **+** and paste the URL.

**Claude Code:**

```bash
claude mcp add --transport http sigrex https://mcp.sigrex.io
```

**Codex:**

```bash
codex mcp add sigrex --url https://mcp.sigrex.io
```

**VS Code, Cursor and other JSON configs:**

```json
{
  "mcpServers": {
    "sigrex": {
      "type": "http",
      "url": "https://mcp.sigrex.io"
    }
  }
}
```

### Agent plugins

The Sigrex plugin bundles the MCP server with a Sigrex skill for your agent:

* [Hermes Agent](https://hermes-agent.nousresearch.com/docs/plugins/sigrex)
* [OpenClaw (ClawHub)](https://clawhub.ai/sigrex/plugins/sigrex)
* [Source on GitHub](https://github.com/sigrexio/agent-plugin)

### Manual OAuth setup

Only needed if your client asks for OAuth endpoints. The full metadata is at `https://mcp.sigrex.io/.well-known/oauth-protected-resource`.

<table><thead><tr><th width="180.3333740234375">Setting</th><th>Value</th></tr></thead><tbody><tr><td>Authorization URL</td><td><code>https://api.sigrex.io/api/auth/oauth2/authorize</code></td></tr><tr><td>Token URL</td><td><code>https://api.sigrex.io/api/auth/oauth2/token</code></td></tr><tr><td>Scopes</td><td><code>openid profile email offline_access mcp</code></td></tr><tr><td>Resource</td><td><code>https://mcp.sigrex.io</code></td></tr><tr><td>Flow</td><td>Authorization code with PKCE</td></tr></tbody></table>


# Notiflow App

Notiflow is a mobile companion app for Sigrex that lets you turn any app’s notifications into automated trading signals.

{% embed url="<https://github.com/Towerflow/notiflow>" %}

You can define custom keywords, and whenever a notification matches, Notiflow sends a custom payload to your webhook — enabling fast automation for trading, alerts, or workflow triggers.

📱 Available on **Android**. (iOS version coming soon.)

<div><figure><img src="https://github.com/0x7s0lt1/notiflow/raw/main/screenshots/Screenshot_1757706784.png" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://github.com/0x7s0lt1/notiflow/raw/main/screenshots/Screenshot_1757706795.png" alt="" width="188"><figcaption></figcaption></figure> <figure><img src="https://github.com/0x7s0lt1/notiflow/raw/main/screenshots/Screenshot_1757706854.png" alt="" width="188"><figcaption></figcaption></figure></div>

***

### Features

* 📡 **Listens to notifications** from any app (messaging, news, trading, etc.)
* 🎯 **Keyword triggers** — define your own words or phrases
* 🔗 **Webhook integration** — send custom payloads when triggers match
* ⚙️ **Runs in the background** so you don’t miss events

***

### Requirements

* Android 7.0 or higher
* Notification access permission enabled

***

### Download

➡️ [Download Notiflow APK](https://github.com/0x7s0lt1/notiflow/raw/refs/heads/main/build/notiflow-v1.0.0.apk)


# Browser Extension

The Sigrex Chrome Extension lets you send trading signals to your bots instantly, without leaving your browser.

<figure><img src="https://249033878-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9eVrTushLZJUnDJcuAQG%2Fuploads%2FT7HXHTGmYlX7206gKLlB%2FGendfgdfgzvxcvxcverated%20Image%20April%2011%2C%202026%20-%207_30PM.png?alt=media&amp;token=d0477456-52d8-436b-b91f-1f3c247f878e" alt=""><figcaption></figcaption></figure>

Install Extension: [Chrome Web Store](https://chromewebstore.google.com/detail/towerflow/booenncomgienhnfhjgmcbmeogfhhbmc)

After a quick authentication, you can trigger **BUY / SELL** actions to your **own bot webhooks**, exactly the same way as sending a Manual Signal from the Sigrex platform — but faster and always accessible.

***

### 🚀 What Is the Chrome Extension?

The extension is a lightweight interface for discretionary and hybrid trading workflows. It enables you to:

* Send manual trading signals from anywhere on the web
* Execute trades without opening the Sigrex dashboard
* Use the same webhook-based execution pipeline as the platform

There is **no difference** in how signals are processed — only in how fast you can send them.

***

### 🔐 Authentication

On first use:

1. Open the extension
2. Authenticate with your Sigrex account
3. Your active bot webhooks are securely synced

Authentication tokens are scoped and revocable. No sensitive credentials are stored in plaintext.

***

### 🧩 Sending a Trading Signal

The extension UI mirrors the Manual Signal interface in Sigrex.

#### Required Fields

**Webhook**

Select one of your active bot webhooks.

Only webhooks you own or have access to will be listed.

***

**Symbol**

Trading pair or instrument.

**Example:**

```
BTCUSDT
```

***

**Order Side**

Choose the trade direction:

* **BUY** – Open or add to a long position
* **SELL** – Close or open a short position (depending on bot logic)

***

### ⚙️ Optional Parameters

Optional parameters allow you to refine how the trade is executed.\
If a field is set to `0`, it is ignored and the bot’s default logic applies.

***

#### Amount

Defines the trade size.

* Interpreted according to your bot and exchange configuration
* Can represent base or quote amount depending on setup

**Example:**

```
Amount: 0.05
```

***

#### 📌 Important Notes

* All optional parameters are forwarded **exactly as provided**
* Validation and execution behavior depend on the receiving bot
* Parameters behave identically to Manual Signals sent from the Sigrex platform

***

### ⚙️ How It Works

When you send a signal:

1. The extension submits the signal to Sigrex
2. Sigrex forwards it to the selected webhook
3. All connected bots receive and process the signal in real time

This ensures:

* Consistent execution
* Unified logging
* Identical behavior across platform, extension, and API usage

***

### 🧠 Common Use Cases

* Quickly react to market moves while browsing charts
* Combine manual discretion with automated execution
* Trigger trades during research, calls, or live sessions
* Test webhook setups without opening the dashboard


# Changelog

## `0.4.2`

Added [**MetaAI**](https://developer.meta.com/ai/), [**Vercel**](https://vercel.com/ai-gateway), and [**Cheaper Inference**](https://www.cheaperinference.com/) as new LLM providers, giving LLM Strategies access to more models and inference options.

Added a **`callback` URL** field to the [Signal Payload schema](/getting-started/signal-payload-format). Users can now specify a callback URL in their signal payload, and Sigrex will send the **execution result** to that URL after the signal has been processed.

The **MCP Server** received a major update with support for **OAuth authentication**. MCP clients can now securely authenticate with Sigrex and access tools that can **control and manage the entire account**, enabling more powerful AI-driven automation and account management workflows.

See the [MCP Server documentation](https://docs.sigrex.io/more/mcp-server) for more details.

## `0.4.1`

Added [**Outcome.xyz**](https://outcome.xyz/) as a supported prediction market for Prediction Signal Bots, expanding prediction market trading integrations.

Code Strategies can now be created **without Signal Generation settings**, making it possible to use them as lightweight runtimes without unnecessary configuration fields.

Added a default `Content-Type: application/json` header to the `$.Http.post()` and `$.Http.put()` methods in Code Strategies. The header no longer needs to be specified manually when making JSON requests.

Added the **`get_candlestick_data`** tool to LLM Strategies, allowing them to retrieve historical candlestick data directly for analysis.

Introduced a new **LLM service call timeout policy** based on the LLM Session cron interval. The timeout is automatically adjusted according to the session frequency:

| LLM Session Interval | Timeout     |
| -------------------- | ----------- |
| 1 minute             | 30 seconds  |
| 3 minutes            | 1.5 minutes |
| 5 minutes            | 2.5 minutes |
| 15 minutes           | 7.5 minutes |
| 30 minutes           | 7.5 minutes |
| 1 hour               | 7.5 minutes |
| 2 hours              | 7.5 minutes |
| 4 hours              | 7.5 minutes |
| 8 hours              | 7.5 minutes |
| 12 hours             | 7.5 minutes |
| 1 day                | 7.5 minutes |

Increased the **LLM Reaction service call timeout** to **5 minutes**, allowing longer-running reactions to complete successfully.

Also included several **UI improvements and refinements** across the platform.

## `0.4.0`

Added [**SiliconFlow** ](https://cloud.siliconflow.com/)and [**SambaNova** ](https://sambanova.ai/)as new LLM providers for LLM Strategies, giving strategies access to even more AI models and inference options.

LLM Strategies can now **start and stop themselves or other strategies**, retrieve their own or other strategies' configurations, and modify strategy logic directly.

LLMs can update the **`code`** field of Code Strategies and the **`prompt`** field of LLM Strategies, enabling new possibilities for self-improving, self-reviewing, and strategy-management workflows.

Added `$.Strategy.id` and `$.Strategy.type` to the Code Strategy runtime. These provide the strategy's unique identifier and type (`code-strategy` or `code-reaction`).

Added `$.getExchangeRate()` to Code Strategies, making it easier to retrieve the current price of a symbol from any exchange supported by Sigrex's live exchange-rate system.

> **Note:** The injected `$.Price` object is deprecated and will be removed in a future release. Use `$.getExchangeRate()` instead.

Added `$.Strategy.stop()` to Code Strategies. This sets the strategy status to `INACTIVE` and prevents future executions. It does **not** immediately terminate the currently running process. To stop the current execution as well, use `return` after calling `$.Strategy.stop()`.

Prediction Signal Bots now support **Wildcard / Slug from Signal** mode. Instead of being restricted to a single market slug, bots can dynamically process market slugs provided in the incoming signal payload.

Because the market slug must be verified before each order, this mode is slightly slower than using a fixed slug. For bots that only trade a specific market, using a manually configured slug is recommended.

Introduced an [**AI Agent Skill Library**](https://github.com/sigrexio/skills), providing reusable skills and capabilities for building more powerful AI agents and automation workflows.

## `0.3.4`

LLM Strategies now support [**OpenRouter**](https://openrouter.ai/), offering access to a wide range of AI models through a single provider, along with [Groq](https://groq.com/) and  [Cerebras](https://www.cerebras.ai/) for high-performance inference.

Added native [`web_fetch`](https://docs.sigrex.io/startegies/llm-session/signal-generation#web_fetch) and [`execute_javascript`](https://docs.sigrex.io/startegies/llm-session/signal-generation#execute_javascript) tools to LLM Strategies. `web_fetch` allows AI strategies to retrieve external data on demand without requiring every URL to be predefined in the prompt. `execute_javascript` runs JavaScript inside the same secure sandbox used by [Code Strategies](/startegies/code), enabling AI strategies to perform calculations, process data, and interact with external APIs.

> **Note:** The `{{get:<url>}}` template variable remains the most cost-efficient and configurable option for predefined HTTP requests. The `web_fetch` tool is intended for dynamic requests determined by the AI during execution.

Added the [`send_email`](https://docs.sigrex.io/startegies/llm-session/signal-generation#send_email) tool for LLM Strategies. AI strategies can now send emails directly when prompted, making it possible to deliver custom alerts, reports, notifications, or other important messages whenever a specific condition or workflow requires user attention.

Added [`get_storage`](https://docs.sigrex.io/startegies/llm-session/signal-generation#get_storage) and [`append_storage`](https://docs.sigrex.io/startegies/llm-session/signal-generation#append_storage) tools for LLM Strategies. AI strategies can now retrieve their persistent storage or append new data without replacing the existing contents. The maximum storage size has also been increased to **25 MB**.

Improved the [`get_symbol_price`](https://docs.sigrex.io/startegies/llm-session/signal-generation#get_symbol_price) tool for LLM Strategies. AI strategies can now retrieve multiple exchange rates in a single request, with support for up to **20 currency pairs per call**, reducing unnecessary API requests and improving execution efficiency.

Added [`$.Http.createApiClient()`](https://docs.sigrex.io/startegies/code#usd.http) to Code Strategies and Code Reactions. This helper creates a fully configured [Sigrex API client](https://github.com/sigrexio/sigrex-client-ts), making it easier to interact with the Sigrex API directly from strategy code.

## `0.3.3`

A major frontend overhaul with numerous UI and UX improvements, delivering a faster, cleaner, and more intuitive experience throughout the platform.

Added support for [**Nous Research**](https://nousresearch.com/) and [**NVIDIA**](https://build.nvidia.com/), giving you access to even more state-of-the-art language models for your AI strategies.

Reactions now support **Frequency** settings, allowing you to control how often a reaction can be triggered and helping prevent unwanted repeated executions.

## `0.3.2`

All bots and strategies can now be organized into folders, making it easier to manage and structure your workspace as it grows.

[Code Strategies](/startegies/code) and [Reactions](/reaction/code-reaction) now support folder-level environment variables. Variables defined on a folder automatically apply to all strategies within that folder and will override globally defined environment variables when the same key is used.

Restricted platform access as part of our ongoing security and compliance measures. Services are currently unavailable connecting from:

* Afghanistan
* Belarus
* Bosnia and Herzegovina
* Guinea
* Guinea-Bissau
* Iran
* Iraq
* Russia

## `0.3.1`

Added **ML-DSA44 post-quantum signing** as a new API authentication option alongside HMAC SHA256.

You can now secure requests using either:

* HMAC
* ML-DSA44 ([post-quantum safe](https://openquantumsafe.org/liboqs/algorithms/sig/ml-dsa.html))

This brings NIST-standard quantum-resistant signatures to the developer API.

## `0.3.0`

LLM Sessions no longer rely on parsing plain-text responses such as `LONG`, `SHORT`, or `EXIT`. Signal generation has been upgraded to native tool calling, allowing AI strategies to open and close positions directly through built-in trading tools.

Introduced the new `set_storage` [tool](/startegies/llm-session/signal-generation#llm-tooling-reference). LLM strategies can now maintain their own persistent JSON storage, which is automatically provided on every execution. This enables AI strategies to track state, remember previous decisions, manage workflows, and build more advanced long-term reasoning processes.


# Terminal

The Ultimate Hub for Manual Traders

The **Terminal** page is the central workspace for users who prefer manual trading. It brings together powerful tools for trading, signaling, and AI-assisted chart analysis — all in one place.

***

## 📊 **Layout Overview**

The interface is made up of **3 main components**:

1. **Chart (TradingView)**
2. **Chart Control Panel (above the chart)**
3. **Right Panel** with 3 submodules:
   * `Trade`
   * `Signal`
   * `AI`

***

## 🔧 **Chart Control Panel**

Located at the top of the chart.

* Lets users **select and switch API connections**.
* Enables symbol switching — affects both the **TradingView chart** and the **"current view" symbol** used across modules.

***

## 🧩 **Right Panel: Submodules**

1. #### 📈 **Trade**
   * Manually send orders to the **selected symbol** using the **active API connection**.
   * Ideal for direct interaction with exchanges.
2. #### 📡 **Signal**
   * Send **custom signals** to a selected webhook.
   * Signals can include various parameters and can be used to:
     * Trigger **personal signal bots**
     * Trigger **friends’ signal bots** (if sharing is allowed)
3. #### 🤖 **AI**
   * Integrate with a connected **AI assistant**.
   * Allows chart [**image-based analysis**](/manual-trading-soon/terminal/ai-chart-analyzation) and **chat interactions**.
   * Useful for receiving strategy suggestions and insights from AI models.

***

## 📌 **Summary**

The Terminal page is a **feature-rich, real-time interface** for traders, combining:

* Charting (via TradingView)
* Manual trading controls
* Signal sending
* AI-powered decision support


# AI Chart Analyzation

Using AI to Analyze Trading Charts

If you have an **active AI connection**, you can send prompts directly to the connected model along with an image of your current chart view.

This feature enables advanced **AI-powered chart analysis**, helping you make informed trading decisions faster.

***

## 🧠 **How It Works**

* When the **AI assistant is active**, you’ll see a prompt box under the chart.
* The current chart view is **captured and sent as an image** along with your prompt to the AI model.
* The model will return a **response based on the chart data and your question**.

***

## 🚫 **Important Limitation**

* ⚠️ **DeepSeek is not currently supported for image input**.
  * You will not see the prompt interface if DeepSeek is your active connection.
  * Consider switching to a **vision-capable model** like GPT-4.1 or Gemini 2.5 Flash.

***

## 💬 **Example Prompts**

Here are some prompt ideas to get meaningful output or trading signals:

* *"Should I open a long or short based on the indicators shown in this chart?"*
* *"If my goal is to take profit on a short trade, is now a good time?"*
* *"Analyze this RSI + MACD combo and tell me if a reversal is coming."*

💡**Tip:** With well-engineered prompts, you can extract highly useful, near-signal-level insights like:

> *“Answer only with **LONG** or **SHORT** and explain why based on the chart.”*

***

## 🔄 **Real-time Use Case**

You can analyze the chart visually, describe your assumptions in natural language, and the AI will help validate or challenge your strategy based on the actual chart data.

Great for:

* Quick second opinions
* Testing your strategies
* Reducing emotional bias


# Sigrex API

{% hint style="info" %}
This API uses **HMAC or ML-DSA44 authentication**.\
Every request must be signed using your API secret.
{% endhint %}

{% tabs %}
{% tab title="Production" %}
**Base URL**

`https://api.sigrex.io/api/v2`
{% endtab %}
{% endtabs %}

***

#### TypeScript SDK

{% hint style="success" %}
An official **TypeScript client library** is available.

[@sigrex/client](https://github.com/sigrexio/sigrex-client-ts)
{% endhint %}

***

#### Getting Started

{% stepper %}
{% step %}

#### Create an account

Create a Sigrex account in the dashboard.
{% endstep %}

{% step %}

#### Generate an API key

Navigate to **API Management** and create a new key.
{% endstep %}

{% step %}

#### Sign your request

All requests must include the following headers:

| Header        | Description                       |
| ------------- | --------------------------------- |
| `api-key`     | Your public API key               |
| `timestamp`   | Current unix timestamp            |
| `signature`   | HMAC SHA256 or ML-DSA44 signature |
| {% endstep %} |                                   |

{% step %}

#### Make your first request

{% endstep %}
{% endstepper %}

***

#### Signature generation examples

{% hint style="info" %}
Signatures are generated using **HMAC SHA256** or **ML-DSA44** and your API secret.

GET / DELETE requests use:

METHOD + PATH + TIMESTAMP

POST / PUT requests use:

METHOD + PATH + BODY + TIMESTAMP
{% endhint %}

**HMAC SHA256 (GET request)**

```ts
import crypto from "crypto"

const API_KEY = "your_public_api_key"
const API_SECRET = "your_private_api_secret"

const method = "GET"
const path = "/api/v2/strategy/llm-session"
const timestamp = Math.floor(Date.now() / 1000).toString()

const message = method + path + timestamp

const signature = crypto
  .createHmac("sha256", API_SECRET)
  .update(message)
  .digest("hex")

```

**ML-DSA44 (GET request)**

```ts
import { createMLDSA44 } from "@oqs/liboqs-js"

const API_KEY = "your_public_api_key"
const PRIVATE_KEY_B64 = "your_private_key_base64"

const method = "GET"
const path = "/api/v2/strategy/llm-session"
const timestamp = Math.floor(Date.now() / 1000).toString()

const message = new TextEncoder().encode(
  method + path + timestamp
)

const sig = await createMLDSA44()

const signature = sig.sign(
  message,
  Uint8Array.from(Buffer.from(PRIVATE_KEY_B64, "base64"))
)

const signatureB64 = Buffer.from(signature).toString("base64")

sig.destroy()

```

**HMAC SHA256 (POST request)**

```ts
import crypto from "crypto"

const API_KEY = "your_public_api_key"
const API_SECRET = "your_private_api_secret"

const method = "POST"
const path = "/api/v2/strategy/llm-session"

const body = {
  name: "My Strategy",
  cron_interval: "15M"
}

const timestamp = Math.floor(Date.now() / 1000).toString()

const payload =
   method + path + JSON.stringify(body) + timestamp

const signature = crypto
  .createHmac("sha256", API_SECRET)
  .update(payload)
  .digest("hex")
  
```

**ML-DSA44 (POST request)**

```ts
import { createMLDSA44 } from "@oqs/liboqs-js"

const API_KEY = "your_public_api_key"
const PRIVATE_KEY_B64 = "your_private_key_base64"

const method = "POST"
const path = "/api/v2/strategy/llm-session"

const body = {
  name: "My Strategy",
  cron_interval: "15M"
}

const timestamp = Math.floor(Date.now() / 1000).toString()

const payload =
  method + path + JSON.stringify(body) + timestamp

const message = new TextEncoder().encode(payload)

const sig = await createMLDSA44()

const signature = sig.sign(
  message,
  Uint8Array.from(Buffer.from(PRIVATE_KEY_B64, "base64"))
)

const signatureB64 = Buffer.from(signature).toString("base64")

sig.destroy()
  
```

***

#### Example request

```bash
curl https://api.sigrex.io/api/v2/strategy/sessions \
  -H "api-key: YOUR_API_KEY" \
  -H "timestamp: 1700000000" \
  -H "signature: GENERATED_SIGNATURE"
```

{% hint style="warning" %}
Never expose your **API secret** in frontend code.\
Always generate signatures on your backend.
{% endhint %}


# Exchanges

## GET /api/v2/exchange

> Get all exchanges with optional filtering

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchanges"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"Exchange":{"type":"object","properties":{"id":{"type":"number","description":"Exchange identifier"},"type":{"type":"string","description":"Exchange type e.g. CEX, DEX, PREDICTION"},"name":{"type":"string","description":"Exchange name e.g. Binance"},"service":{"type":"string","description":"Exchange service e.g. spot, futures"},"enabled":{"type":"boolean","description":"Whether the exchange is enabled"},"hasExchangeRate":{"type":"boolean","description":"Whether the exchange provides exchange rates to the system"},"extra":{"type":"boolean","description":"Whether the exchange API keys need extra information other than the API key and secret"}}}}},"paths":{"/api/v2/exchange":{"get":{"summary":"Get all exchanges with optional filtering","tags":["exchanges"],"parameters":[{"in":"query","name":"enabled","schema":{"type":"boolean"},"description":"Filter by enabled status"},{"in":"query","name":"chainId","schema":{"type":"string"},"description":"Filter by blockchain chain ID"}],"responses":{"200":{"description":"List of exchanges","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}}}}},"500":{"description":"Internal server error"}}}}}}
```

## GET /api/v2/exchange/cex

> Get all CEX exchanges

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchanges"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"Exchange":{"type":"object","properties":{"id":{"type":"number","description":"Exchange identifier"},"type":{"type":"string","description":"Exchange type e.g. CEX, DEX, PREDICTION"},"name":{"type":"string","description":"Exchange name e.g. Binance"},"service":{"type":"string","description":"Exchange service e.g. spot, futures"},"enabled":{"type":"boolean","description":"Whether the exchange is enabled"},"hasExchangeRate":{"type":"boolean","description":"Whether the exchange provides exchange rates to the system"},"extra":{"type":"boolean","description":"Whether the exchange API keys need extra information other than the API key and secret"}}}}},"paths":{"/api/v2/exchange/cex":{"get":{"summary":"Get all CEX exchanges","tags":["exchanges"],"responses":{"200":{"description":"List of enabled CEX exchanges","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}}}}},"500":{"description":"Internal server error"}}}}}}
```

## GET /api/v2/exchange/dex/{chain}

> Get all DEX exchanges by chain ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchanges"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"Exchange":{"type":"object","properties":{"id":{"type":"number","description":"Exchange identifier"},"type":{"type":"string","description":"Exchange type e.g. CEX, DEX, PREDICTION"},"name":{"type":"string","description":"Exchange name e.g. Binance"},"service":{"type":"string","description":"Exchange service e.g. spot, futures"},"enabled":{"type":"boolean","description":"Whether the exchange is enabled"},"hasExchangeRate":{"type":"boolean","description":"Whether the exchange provides exchange rates to the system"},"extra":{"type":"boolean","description":"Whether the exchange API keys need extra information other than the API key and secret"}}}}},"paths":{"/api/v2/exchange/dex/{chain}":{"get":{"summary":"Get all DEX exchanges by chain ID","tags":["exchanges"],"parameters":[{"in":"path","name":"chain","required":true,"schema":{"type":"string"},"description":"Blockchain chain ID"}],"responses":{"200":{"description":"List of DEX exchanges for the specified chain","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}}}}},"400":{"description":"Missing chain ID"},"500":{"description":"Internal server error"}}}}}}
```

## GET /api/v2/exchange/prediction

> Get all Prediction exchanges

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchanges"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"Exchange":{"type":"object","properties":{"id":{"type":"number","description":"Exchange identifier"},"type":{"type":"string","description":"Exchange type e.g. CEX, DEX, PREDICTION"},"name":{"type":"string","description":"Exchange name e.g. Binance"},"service":{"type":"string","description":"Exchange service e.g. spot, futures"},"enabled":{"type":"boolean","description":"Whether the exchange is enabled"},"hasExchangeRate":{"type":"boolean","description":"Whether the exchange provides exchange rates to the system"},"extra":{"type":"boolean","description":"Whether the exchange API keys need extra information other than the API key and secret"}}}}},"paths":{"/api/v2/exchange/prediction":{"get":{"summary":"Get all Prediction exchanges","tags":["exchanges"],"responses":{"200":{"description":"List of prediction exchanges","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}}}}},"500":{"description":"Internal server error"}}}}}}
```

## GET /api/v2/exchange/with-exchange-rate

> Get all exchanges with exchange rates

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchanges"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"Exchange":{"type":"object","properties":{"id":{"type":"number","description":"Exchange identifier"},"type":{"type":"string","description":"Exchange type e.g. CEX, DEX, PREDICTION"},"name":{"type":"string","description":"Exchange name e.g. Binance"},"service":{"type":"string","description":"Exchange service e.g. spot, futures"},"enabled":{"type":"boolean","description":"Whether the exchange is enabled"},"hasExchangeRate":{"type":"boolean","description":"Whether the exchange provides exchange rates to the system"},"extra":{"type":"boolean","description":"Whether the exchange API keys need extra information other than the API key and secret"}}}}},"paths":{"/api/v2/exchange/with-exchange-rate":{"get":{"summary":"Get all exchanges with exchange rates","tags":["exchanges"],"responses":{"200":{"description":"List of enabled exchanges with exchange rates","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}}}}},"500":{"description":"Internal server error"}}}}}}
```


# Strategies


# LLM Sessions

## GET /api/v2/strategy/llm-session

> Get all LLM sessions

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/llm-session":{"get":{"summary":"Get all LLM sessions","tags":["llm-session"],"responses":{"200":{"description":"List of user's LLM sessions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMSession"}}}}}}}}}}
```

## POST /api/v2/strategy/llm-session

> Create a new LLM session

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateLLMSessionRequest":{"type":"object","required":["llm_api_id","cron_interval","prompt"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the strategy"},"llm_api_id":{"type":"number","description":"The main LLM Api key id used for the strategy"},"fallback_api_id":{"type":"number","description":"The fallback LLM Api key id used for the strategy if main is not available"},"cron_interval":{"type":"string","description":"The schedule interval of the strategy","enum":["3M","5M","15M","30M","1H","2H","4H","8H","12H","1D"]},"use_chart":{"type":"boolean","description":"Set true if you want to send chart image with the strategy prompt"},"chart_symbol":{"type":"string","description":"The Tradingview symbol of the chart (required if use_chart is true)"},"chart_interval":{"type":"string","description":"The interval of the chart (required if use_chart is true)","enum":["1","3","5","15","30","60","120","240","D"]},"chart_studies":{"type":"array","description":"The studies of the chart (optional if use_chart is true)","maxItems":2,"items":{"type":"string","enum":["ACCD@tv-basicstudies","studyADR@tv-basicstudies","AROON@tv-basicstudies","ATR@tv-basicstudies","AwesomeOscillator@tv-basicstudies","BB@tv-basicstudies","BollingerBandsR@tv-basicstudies","BollingerBandsWidth@tv-basicstudies","CMF@tv-basicstudies","ChaikinOscillator@tv-basicstudies","chandeMO@tv-basicstudies","ChoppinessIndex@tv-basicstudies","CCI@tv-basicstudies","CRSI@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","DetrendedPriceOscillator@tv-basicstudies","DM@tv-basicstudies","DONCH@tv-basicstudies","DoubleEMA@tv-basicstudies","EaseOfMovement@tv-basicstudies","EFI@tv-basicstudies","ENV@tv-basicstudies","FisherTransform@tv-basicstudies","HV@tv-basicstudies","hullMA@tv-basicstudies","IchimokuCloud@tv-basicstudies","KLTNR@tv-basicstudies","KST@tv-basicstudies","LinearRegression@tv-basicstudies","MACD@tv-basicstudies","MOM@tv-basicstudies","MF@tv-basicstudies","MoonPhases@tv-basicstudies","MASimple@tv-basicstudies","MAExp@tv-basicstudies","MAWeighted@tv-basicstudies","OBV@tv-basicstudies","PSAR@tv-basicstudies","PivotPointsHighLow@tv-basicstudies","PivotPointsStandard@tv-basicstudies","PriceOsc@tv-basicstudies","PriceVolumeTrend@tv-basicstudies","ROC@tv-basicstudies","RSI@tv-basicstudies","VigorIndex@tv-basicstudies","VolatilityIndex@tv-basicstudies","SMIErgodicIndicator@tv-basicstudies","SMIErgodicOscillator@tv-basicstudies","Stochastic@tv-basicstudies","StochasticRSI@tv-basicstudies","TripleEMA@tv-basicstudies","Trix@tv-basicstudies","UltimateOsc@tv-basicstudies","VSTOP@tv-basicstudies","Volume@tv-basicstudies","VWAP@tv-basicstudies","MAVolumeWeighted@tv-basicstudies","WilliamR@tv-basicstudies","WilliamsAlligator@tv-basicstudies","WilliamsFractal@tv-basicstudies","ZigZag@tv-basicstudies"]}},"chart_data_range":{"type":"string","description":"The data range of the chart (optional if use_chart is true)","enum":["1D","5D","1M","3M","6M","YTD","12M","60M","ALL"]},"prompt":{"type":"string","description":"The strategy prompt minimum length is 20 characters maximum length is 1000000000 characters"},"send_signal":{"type":"boolean","description":"Set true to send signal to bot hook"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"signal_symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma"},"send_email":{"type":"boolean","description":"Set true to send the LLM response to the user email"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session":{"post":{"summary":"Create a new LLM session","tags":["llm-session"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLLMSessionRequest"}}}},"responses":{"201":{"description":"LLM session created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMSession"}}}},"400":{"description":"Missing required fields, invalid configuration, or session limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Session limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Package or LLM API not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/llm-session/total

> Get the total number of LLM sessions

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/llm-session/total":{"get":{"summary":"Get the total number of LLM sessions","tags":["llm-session"],"responses":{"200":{"description":"Number of LLM Sessions","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/strategy/llm-session/{id}

> Get LLM session by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}":{"get":{"summary":"Get LLM session by ID","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LLM session details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMSession"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/llm-session/{id}

> Update LLM session

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateLLMSessionRequest":{"type":"object","required":["llm_api_id","cron_interval","prompt"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the strategy"},"llm_api_id":{"type":"number","description":"The main LLM Api key id used for the strategy"},"fallback_api_id":{"type":"number","description":"The fallback LLM Api key id used for the strategy if main is not available"},"cron_interval":{"type":"string","description":"The schedule interval of the strategy","enum":["3M","5M","15M","30M","1H","2H","4H","8H","12H","1D"]},"use_chart":{"type":"boolean","description":"Set true if you want to send chart image with the strategy prompt"},"chart_symbol":{"type":"string","description":"The Tradingview symbol of the chart (required if use_chart is true)"},"chart_interval":{"type":"string","description":"The interval of the chart (required if use_chart is true)","enum":["1","3","5","15","30","60","120","240","D"]},"chart_studies":{"type":"array","description":"The studies of the chart (optional if use_chart is true)","maxItems":2,"items":{"type":"string","enum":["ACCD@tv-basicstudies","studyADR@tv-basicstudies","AROON@tv-basicstudies","ATR@tv-basicstudies","AwesomeOscillator@tv-basicstudies","BB@tv-basicstudies","BollingerBandsR@tv-basicstudies","BollingerBandsWidth@tv-basicstudies","CMF@tv-basicstudies","ChaikinOscillator@tv-basicstudies","chandeMO@tv-basicstudies","ChoppinessIndex@tv-basicstudies","CCI@tv-basicstudies","CRSI@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","DetrendedPriceOscillator@tv-basicstudies","DM@tv-basicstudies","DONCH@tv-basicstudies","DoubleEMA@tv-basicstudies","EaseOfMovement@tv-basicstudies","EFI@tv-basicstudies","ENV@tv-basicstudies","FisherTransform@tv-basicstudies","HV@tv-basicstudies","hullMA@tv-basicstudies","IchimokuCloud@tv-basicstudies","KLTNR@tv-basicstudies","KST@tv-basicstudies","LinearRegression@tv-basicstudies","MACD@tv-basicstudies","MOM@tv-basicstudies","MF@tv-basicstudies","MoonPhases@tv-basicstudies","MASimple@tv-basicstudies","MAExp@tv-basicstudies","MAWeighted@tv-basicstudies","OBV@tv-basicstudies","PSAR@tv-basicstudies","PivotPointsHighLow@tv-basicstudies","PivotPointsStandard@tv-basicstudies","PriceOsc@tv-basicstudies","PriceVolumeTrend@tv-basicstudies","ROC@tv-basicstudies","RSI@tv-basicstudies","VigorIndex@tv-basicstudies","VolatilityIndex@tv-basicstudies","SMIErgodicIndicator@tv-basicstudies","SMIErgodicOscillator@tv-basicstudies","Stochastic@tv-basicstudies","StochasticRSI@tv-basicstudies","TripleEMA@tv-basicstudies","Trix@tv-basicstudies","UltimateOsc@tv-basicstudies","VSTOP@tv-basicstudies","Volume@tv-basicstudies","VWAP@tv-basicstudies","MAVolumeWeighted@tv-basicstudies","WilliamR@tv-basicstudies","WilliamsAlligator@tv-basicstudies","WilliamsFractal@tv-basicstudies","ZigZag@tv-basicstudies"]}},"chart_data_range":{"type":"string","description":"The data range of the chart (optional if use_chart is true)","enum":["1D","5D","1M","3M","6M","YTD","12M","60M","ALL"]},"prompt":{"type":"string","description":"The strategy prompt minimum length is 20 characters maximum length is 1000000000 characters"},"send_signal":{"type":"boolean","description":"Set true to send signal to bot hook"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"signal_symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma"},"send_email":{"type":"boolean","description":"Set true to send the LLM response to the user email"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}":{"put":{"summary":"Update LLM session","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLLMSessionRequest"}}}},"responses":{"200":{"description":"LLM session updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid configuration, or validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session, webhook, or LLM API not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/llm-session/{id}

> Delete LLM session

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}":{"delete":{"summary":"Delete LLM session","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LLM session deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/strategy/llm-session/duplicate

> Duplicate an LLM session

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/duplicate":{"post":{"summary":"Duplicate an LLM session","tags":["llm-session"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Session ID to duplicate"}}}}}},"responses":{"201":{"description":"LLM session duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMSession"}}}},"400":{"description":"Missing id or session limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/llm-session/{id}/reset

> Reset LLM session triggers, history or responses

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ResetLLMTriggersRequest":{"type":"object","required":["resetTriggers","resetStorage","resetResponse"],"properties":{"resetTriggers":{"type":"boolean","description":"Set true to reset triggers"},"resetStorage":{"type":"boolean","description":"Set true to reset storage"},"resetResponse":{"type":"boolean","description":"Set true to reset response history"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}/reset":{"put":{"summary":"Reset LLM session triggers, history or responses","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetLLMTriggersRequest"}}}},"responses":{"200":{"description":"Triggers and/or history reset successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid options, or nothing to reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/llm-session/{id}/status

> Update LLM session status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}/status":{"put":{"summary":"Update LLM session status","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid status, or session limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Active session limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/llm-session/{id}/public

> Update LLM session public visibility

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdatePublicRequest":{"type":"object","required":["isPublic"],"properties":{"isPublic":{"type":"boolean","description":"Set true to make the strategy public"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/llm-session/{id}/public":{"put":{"summary":"Update LLM session public visibility","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicRequest"}}}},"responses":{"200":{"description":"Public visibility updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or invalid public flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Session not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/llm-session/folder

> Get all LLM session folders

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/llm-session/folder":{"get":{"summary":"Get all LLM session folders","tags":["llm-session"],"responses":{"200":{"description":"List of user's LLM session folders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMSessionFolder"}}}}}}}}}}
```

## POST /api/v2/strategy/llm-session/folder

> Create a new LLM session folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/llm-session/folder":{"post":{"summary":"Create a new LLM session folder","tags":["llm-session"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"201":{"description":"Folder created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMSessionFolder"}}}},"400":{"description":"Invalid name or max folder limit reached"}}}}}}
```

## GET /api/v2/strategy/llm-session/folder/root

> Get LLM Sessions from root folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/llm-session/folder/root":{"get":{"summary":"Get LLM Sessions from root folder","tags":["llm-session"],"responses":{"200":{"description":"List","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMSession"}}}}}}}}}}
```

## GET /api/v2/strategy/llm-session/folder/{id}

> Get LLM session folder by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/llm-session/folder/{id}":{"get":{"summary":"Get LLM session folder by ID","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder with its items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMSessionFolder"}}}},"400":{"description":"Missing id"},"404":{"description":"Folder not found"}}}}}}
```

## PUT /api/v2/strategy/llm-session/folder/{id}

> Update LLM session folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/llm-session/folder/{id}":{"put":{"summary":"Update LLM session folder","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"200":{"description":"Folder updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, invalid name, or folder not found"},"404":{"description":"Folder not found"}}}}}}
```

## DELETE /api/v2/strategy/llm-session/folder/{id}

> Delete LLM session folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/llm-session/folder/{id}":{"delete":{"summary":"Delete LLM session folder","tags":["llm-session"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, folder not found, or folder is not empty"},"404":{"description":"Folder not found"}}}}}}
```

## GET /api/v2/strategy/reaction/llm/total

> Get the total number of LLM Reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/llm/total":{"get":{"summary":"Get the total number of LLM Reaction","tags":["llm-session"],"responses":{"200":{"description":"Number of LLM Reactions","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/strategy/reaction/code/total

> Get the total number of Code Reactions

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/code/total":{"get":{"summary":"Get the total number of Code Reactions","tags":["llm-session"],"responses":{"200":{"description":"Number of Code Reactions","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/strategy/code/total

> Get the total number of Code Strategies

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-session"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/code/total":{"get":{"summary":"Get the total number of Code Strategies","tags":["llm-session"],"responses":{"200":{"description":"Number of Code Strategies","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```


# Code Strategies

## GET /api/v2/strategy/code

> Get all code strategies

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/code":{"get":{"summary":"Get all code strategies","tags":["code"],"responses":{"200":{"description":"List of user's code strategies","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeStrategy"}}}}}}}}}}
```

## POST /api/v2/strategy/code

> Create a new code strategy

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateCodeStrategyRequest":{"type":"object","required":["code"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the strategy"},"send_signal":{"type":"boolean","description":"Set true to enable signal generation"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma (required if send_signal is true)"},"code":{"type":"string","description":"The JavaScript code of the strategy"},"use_price":{"type":"boolean","description":"Set true if you want to use price ($.Price) in code"},"exchange_id":{"type":"number","description":"The id of the exchange where the price is fetched (required exchange with hasExchangeRate set to true)"},"price_symbol":{"type":"string","description":"The symbol of the price (required if use_price is true)"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code":{"post":{"summary":"Create a new code strategy","tags":["code"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCodeStrategyRequest"}}}},"responses":{"201":{"description":"Code strategy created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeStrategy"}}}},"400":{"description":"Missing required fields, invalid code, or strategy limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Exchange or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/code/{id}

> Get code strategy by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}":{"get":{"summary":"Get code strategy by ID","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Code strategy details with storage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeStrategyWithStorage"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/code/{id}

> Update code strategy

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateCodeStrategyRequest":{"type":"object","required":["code"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the strategy"},"send_signal":{"type":"boolean","description":"Set true to enable signal generation"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma (required if send_signal is true)"},"code":{"type":"string","description":"The JavaScript code of the strategy"},"use_price":{"type":"boolean","description":"Set true if you want to use price ($.Price) in code"},"exchange_id":{"type":"number","description":"The id of the exchange where the price is fetched (required exchange with hasExchangeRate set to true)"},"price_symbol":{"type":"string","description":"The symbol of the price (required if use_price is true)"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}":{"put":{"summary":"Update code strategy","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodeStrategyRequest"}}}},"responses":{"200":{"description":"Code strategy updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid code, or validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy, exchange, or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/code/{id}

> Delete code strategy

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}":{"delete":{"summary":"Delete code strategy","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Code strategy deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/strategy/code/duplicate

> Duplicate a code strategy

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/duplicate":{"post":{"summary":"Duplicate a code strategy","tags":["code"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Strategy ID to duplicate"}}}}}},"responses":{"201":{"description":"Code strategy duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeStrategy"}}}},"400":{"description":"Missing id or strategy limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/code/{id}/reset

> Reset code strategy triggers and/or storage

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ResetCodeTriggersRequest":{"type":"object","required":["resetTriggers","resetStore"],"properties":{"resetTriggers":{"type":"boolean","description":"Set true to reset triggers"},"resetStore":{"type":"boolean","description":"Set true to reset store"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}/reset":{"put":{"summary":"Reset code strategy triggers and/or storage","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetCodeTriggersRequest"}}}},"responses":{"200":{"description":"Triggers and/or storage reset successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid options, or nothing to reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/code/{id}/status

> Update code strategy status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}/status":{"put":{"summary":"Update code strategy status","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid status, status already set, or strategy limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/code/{id}/public

> Update code strategy public visibility

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdatePublicRequest":{"type":"object","required":["isPublic"],"properties":{"isPublic":{"type":"boolean","description":"Set true to make the strategy public"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}/public":{"put":{"summary":"Update code strategy public visibility","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicRequest"}}}},"responses":{"200":{"description":"Public visibility updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or invalid public flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/code/{id}/store

> Delete code strategy storage

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/code/{id}/store":{"delete":{"summary":"Delete code strategy storage","tags":["code"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Storage deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Reactions


# LLM Reaction

## GET /api/v2/strategy/reaction/llm

> Get all LLM reactions

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/llm":{"get":{"summary":"Get all LLM reactions","tags":["llm-reaction"],"responses":{"200":{"description":"List of user's LLM reactions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMReaction"}}}}}}}}}}
```

## POST /api/v2/strategy/reaction/llm

> Create a new LLM reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateLLMReactionRequest":{"type":"object","required":["data_webhook_id","llm_api_id","prompt"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the reaction"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"data_webhook_id":{"type":"number","description":"The id of the data hook witch will be used to get data"},"llm_api_id":{"type":"number","description":"The main LLM Api key id used for the strategy"},"fallback_api_id":{"type":"number","description":"The fallback LLM Api key id used for the strategy if main is not available"},"delay":{"type":"number","description":"Set how often the reaction will check for new signals. eg. 10 means 10 in 1 second"},"use_chart":{"type":"boolean","description":"Set true if you want to send chart image with the strategy prompt"},"chart_symbol":{"type":"string","description":"The Tradingview symbol of the chart (required if use_chart is true)"},"chart_interval":{"type":"string","description":"The interval of the chart (required if use_chart is true)","enum":["1","3","5","15","30","60","120","240","D"]},"chart_studies":{"type":"array","description":"The studies of the chart (optional if use_chart is true)","maxItems":2,"items":{"type":"string","enum":["ACCD@tv-basicstudies","studyADR@tv-basicstudies","AROON@tv-basicstudies","ATR@tv-basicstudies","AwesomeOscillator@tv-basicstudies","BB@tv-basicstudies","BollingerBandsR@tv-basicstudies","BollingerBandsWidth@tv-basicstudies","CMF@tv-basicstudies","ChaikinOscillator@tv-basicstudies","chandeMO@tv-basicstudies","ChoppinessIndex@tv-basicstudies","CCI@tv-basicstudies","CRSI@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","DetrendedPriceOscillator@tv-basicstudies","DM@tv-basicstudies","DONCH@tv-basicstudies","DoubleEMA@tv-basicstudies","EaseOfMovement@tv-basicstudies","EFI@tv-basicstudies","ENV@tv-basicstudies","FisherTransform@tv-basicstudies","HV@tv-basicstudies","hullMA@tv-basicstudies","IchimokuCloud@tv-basicstudies","KLTNR@tv-basicstudies","KST@tv-basicstudies","LinearRegression@tv-basicstudies","MACD@tv-basicstudies","MOM@tv-basicstudies","MF@tv-basicstudies","MoonPhases@tv-basicstudies","MASimple@tv-basicstudies","MAExp@tv-basicstudies","MAWeighted@tv-basicstudies","OBV@tv-basicstudies","PSAR@tv-basicstudies","PivotPointsHighLow@tv-basicstudies","PivotPointsStandard@tv-basicstudies","PriceOsc@tv-basicstudies","PriceVolumeTrend@tv-basicstudies","ROC@tv-basicstudies","RSI@tv-basicstudies","VigorIndex@tv-basicstudies","VolatilityIndex@tv-basicstudies","SMIErgodicIndicator@tv-basicstudies","SMIErgodicOscillator@tv-basicstudies","Stochastic@tv-basicstudies","StochasticRSI@tv-basicstudies","TripleEMA@tv-basicstudies","Trix@tv-basicstudies","UltimateOsc@tv-basicstudies","VSTOP@tv-basicstudies","Volume@tv-basicstudies","VWAP@tv-basicstudies","MAVolumeWeighted@tv-basicstudies","WilliamR@tv-basicstudies","WilliamsAlligator@tv-basicstudies","WilliamsFractal@tv-basicstudies","ZigZag@tv-basicstudies"]}},"chart_data_range":{"type":"string","description":"The data range of the chart (optional if use_chart is true)","enum":["1D","5D","1M","3M","6M","YTD","12M","60M","ALL"]},"prompt":{"type":"string","description":"The prompt used for the strategy"},"send_signal":{"type":"boolean","description":"Set true if you want to send a signal to the bot hook"},"signal_symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma"},"send_email":{"type":"boolean","description":"Set true if you want to send the LLM response to the user email"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm":{"post":{"summary":"Create a new LLM reaction","tags":["llm-reaction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLLMReactionRequest"}}}},"responses":{"201":{"description":"LLM reaction created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMReaction"}}}},"400":{"description":"Missing required fields, invalid prompt, or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Data webhook, bot webhook, or LLM API not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/reaction/llm/{id}

> Get LLM reaction by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}":{"get":{"summary":"Get LLM reaction by ID","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LLM reaction details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMReaction"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/llm/{id}

> Update LLM reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateLLMReactionRequest":{"type":"object","required":["data_webhook_id","llm_api_id","prompt"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the reaction"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"data_webhook_id":{"type":"number","description":"The id of the data hook witch will be used to get data"},"llm_api_id":{"type":"number","description":"The main LLM Api key id used for the strategy"},"fallback_api_id":{"type":"number","description":"The fallback LLM Api key id used for the strategy if main is not available"},"delay":{"type":"number","description":"Set how often the reaction will check for new signals. eg. 10 means 10 in 1 second"},"use_chart":{"type":"boolean","description":"Set true if you want to send chart image with the strategy prompt"},"chart_symbol":{"type":"string","description":"The Tradingview symbol of the chart (required if use_chart is true)"},"chart_interval":{"type":"string","description":"The interval of the chart (required if use_chart is true)","enum":["1","3","5","15","30","60","120","240","D"]},"chart_studies":{"type":"array","description":"The studies of the chart (optional if use_chart is true)","maxItems":2,"items":{"type":"string","enum":["ACCD@tv-basicstudies","studyADR@tv-basicstudies","AROON@tv-basicstudies","ATR@tv-basicstudies","AwesomeOscillator@tv-basicstudies","BB@tv-basicstudies","BollingerBandsR@tv-basicstudies","BollingerBandsWidth@tv-basicstudies","CMF@tv-basicstudies","ChaikinOscillator@tv-basicstudies","chandeMO@tv-basicstudies","ChoppinessIndex@tv-basicstudies","CCI@tv-basicstudies","CRSI@tv-basicstudies","CorrelationCoefficient@tv-basicstudies","DetrendedPriceOscillator@tv-basicstudies","DM@tv-basicstudies","DONCH@tv-basicstudies","DoubleEMA@tv-basicstudies","EaseOfMovement@tv-basicstudies","EFI@tv-basicstudies","ENV@tv-basicstudies","FisherTransform@tv-basicstudies","HV@tv-basicstudies","hullMA@tv-basicstudies","IchimokuCloud@tv-basicstudies","KLTNR@tv-basicstudies","KST@tv-basicstudies","LinearRegression@tv-basicstudies","MACD@tv-basicstudies","MOM@tv-basicstudies","MF@tv-basicstudies","MoonPhases@tv-basicstudies","MASimple@tv-basicstudies","MAExp@tv-basicstudies","MAWeighted@tv-basicstudies","OBV@tv-basicstudies","PSAR@tv-basicstudies","PivotPointsHighLow@tv-basicstudies","PivotPointsStandard@tv-basicstudies","PriceOsc@tv-basicstudies","PriceVolumeTrend@tv-basicstudies","ROC@tv-basicstudies","RSI@tv-basicstudies","VigorIndex@tv-basicstudies","VolatilityIndex@tv-basicstudies","SMIErgodicIndicator@tv-basicstudies","SMIErgodicOscillator@tv-basicstudies","Stochastic@tv-basicstudies","StochasticRSI@tv-basicstudies","TripleEMA@tv-basicstudies","Trix@tv-basicstudies","UltimateOsc@tv-basicstudies","VSTOP@tv-basicstudies","Volume@tv-basicstudies","VWAP@tv-basicstudies","MAVolumeWeighted@tv-basicstudies","WilliamR@tv-basicstudies","WilliamsAlligator@tv-basicstudies","WilliamsFractal@tv-basicstudies","ZigZag@tv-basicstudies"]}},"chart_data_range":{"type":"string","description":"The data range of the chart (optional if use_chart is true)","enum":["1D","5D","1M","3M","6M","YTD","12M","60M","ALL"]},"prompt":{"type":"string","description":"The prompt used for the strategy"},"send_signal":{"type":"boolean","description":"Set true if you want to send a signal to the bot hook"},"signal_symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma"},"send_email":{"type":"boolean","description":"Set true if you want to send the LLM response to the user email"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}":{"put":{"summary":"Update LLM reaction","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLLMReactionRequest"}}}},"responses":{"200":{"description":"LLM reaction updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid prompt, or validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction, webhook, or LLM API not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/reaction/llm/{id}

> Delete LLM reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}":{"delete":{"summary":"Delete LLM reaction","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"LLM reaction deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/strategy/reaction/llm/duplicate

> Duplicate an LLM reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/duplicate":{"post":{"summary":"Duplicate an LLM reaction","tags":["llm-reaction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Reaction ID to duplicate"}}}}}},"responses":{"201":{"description":"LLM reaction duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMReaction"}}}},"400":{"description":"Missing id or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/llm/{id}/reset

> Reset LLM reaction triggers, history or responses

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ResetLLMTriggersRequest":{"type":"object","required":["resetTriggers","resetStorage","resetResponse"],"properties":{"resetTriggers":{"type":"boolean","description":"Set true to reset triggers"},"resetStorage":{"type":"boolean","description":"Set true to reset storage"},"resetResponse":{"type":"boolean","description":"Set true to reset response history"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}/reset":{"put":{"summary":"Reset LLM reaction triggers, history or responses","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetLLMTriggersRequest"}}}},"responses":{"200":{"description":"Triggers and/or history reset successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid options, or nothing to reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/llm/{id}/status

> Update LLM reaction status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}/status":{"put":{"summary":"Update LLM reaction status","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid status, or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Active reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/llm/{id}/public

> Update LLM reaction public visibility

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdatePublicRequest":{"type":"object","required":["isPublic"],"properties":{"isPublic":{"type":"boolean","description":"Set true to make the strategy public"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/llm/{id}/public":{"put":{"summary":"Update LLM reaction public visibility","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicRequest"}}}},"responses":{"200":{"description":"Public visibility updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or invalid public flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/reaction/llm/folder

> Get all LLM reaction folders

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/llm/folder":{"get":{"summary":"Get all LLM reaction folders","tags":["llm-reaction"],"responses":{"200":{"description":"List of user's LLM reaction folders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMReactionFolder"}}}}}}}}}}
```

## POST /api/v2/strategy/reaction/llm/folder

> Create a new LLM reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/llm/folder":{"post":{"summary":"Create a new LLM reaction folder","tags":["llm-reaction"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"201":{"description":"Folder created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMReactionFolder"}}}},"400":{"description":"Invalid name or max folder limit reached"}}}}}}
```

## GET /api/v2/strategy/reaction/llm/folder/root

> Get LLM reactions from root folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/llm/folder/root":{"get":{"summary":"Get LLM reactions from root folder","tags":["llm-reaction"],"responses":{"200":{"description":"List of LLM reactions in root folder","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMReaction"}}}}}}}}}}
```

## GET /api/v2/strategy/reaction/llm/folder/{id}

> Get LLM reaction folder by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/llm/folder/{id}":{"get":{"summary":"Get LLM reaction folder by ID","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder with its items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMReactionFolder"}}}},"400":{"description":"Missing id"},"404":{"description":"Folder not found"}}}}}}
```

## PUT /api/v2/strategy/reaction/llm/folder/{id}

> Update LLM reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/llm/folder/{id}":{"put":{"summary":"Update LLM reaction folder","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"200":{"description":"Folder updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, invalid name, or folder not found"},"404":{"description":"Folder not found"}}}}}}
```

## DELETE /api/v2/strategy/reaction/llm/folder/{id}

> Delete LLM reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/llm/folder/{id}":{"delete":{"summary":"Delete LLM reaction folder","tags":["llm-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, folder not found, or folder is not empty"},"404":{"description":"Folder not found"}}}}}}
```


# Code Reaction

## GET /api/v2/strategy/reaction/code

> Get all code reactions

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/code":{"get":{"summary":"Get all code reactions","tags":["code-reaction"],"responses":{"200":{"description":"List of user's code reactions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeReaction"}}}}}}}}}}
```

## POST /api/v2/strategy/reaction/code

> Create a new code reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateCodeReactionRequest":{"type":"object","required":["data_webhook_id","code"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the reaction"},"data_webhook_id":{"type":"number","description":"The id of the data hook witch will be used to get data"},"send_signal":{"type":"boolean","description":"Set true to enable signal generation"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma (required if send_signal is true)"},"delay":{"type":"number","description":"Set how often the reaction will check for new signals. eg. 10 means 10 in 1 second"},"code":{"type":"string","description":"The JavaScript code of the strategy"},"use_price":{"type":"boolean","description":"Set true if you want to use price ($.Price) in code"},"exchange_id":{"type":"number","description":"The id of the exchange where the price is fetched (required exchange with hasExchangeRate set to true)"},"price_symbol":{"type":"string","description":"The symbol of the price (required if use_price is true)"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code":{"post":{"summary":"Create a new code reaction","tags":["code-reaction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCodeReactionRequest"}}}},"responses":{"201":{"description":"Code reaction created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeReaction"}}}},"400":{"description":"Missing required fields, invalid code, or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Exchange, webhook, or data hook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/reaction/code/{id}

> Get code reaction by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}":{"get":{"summary":"Get code reaction by ID","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Code reaction details with storage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeReactionWithStorage"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/code/{id}

> Update code reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateCodeReactionRequest":{"type":"object","required":["data_webhook_id","code"],"properties":{"name":{"type":"string","description":"The name of the strategy max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the reaction"},"data_webhook_id":{"type":"number","description":"The id of the data hook witch will be used to get data"},"send_signal":{"type":"boolean","description":"Set true to enable signal generation"},"webhook_id":{"type":"number","description":"The id of the bot hook where signal will be sent (required if send_signal is true)"},"symbol":{"type":"string","description":"The signal symbol or symbols of the strategy separated by comma (required if send_signal is true)"},"delay":{"type":"number","description":"Set how often the reaction will check for new signals. eg. 10 means 10 in 1 second"},"code":{"type":"string","description":"The JavaScript code of the strategy"},"use_price":{"type":"boolean","description":"Set true if you want to use price ($.Price) in code"},"exchange_id":{"type":"number","description":"The id of the exchange where the price is fetched (required exchange with hasExchangeRate set to true)"},"price_symbol":{"type":"string","description":"The symbol of the price (required if use_price is true)"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}":{"put":{"summary":"Update code reaction","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCodeReactionRequest"}}}},"responses":{"200":{"description":"Code reaction updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid code, or validation errors","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Reaction, exchange, webhook, or data hook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/reaction/code/{id}

> Delete code reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}":{"delete":{"summary":"Delete code reaction","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Code reaction deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/strategy/reaction/code/duplicate

> Duplicate a code reaction

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/duplicate":{"post":{"summary":"Duplicate a code reaction","tags":["code-reaction"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Reaction ID to duplicate"}}}}}},"responses":{"201":{"description":"Code reaction duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeReaction"}}}},"400":{"description":"Missing id or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/code/{id}/reset

> Reset code reaction triggers and/or storage

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ResetCodeTriggersRequest":{"type":"object","required":["resetTriggers","resetStore"],"properties":{"resetTriggers":{"type":"boolean","description":"Set true to reset triggers"},"resetStore":{"type":"boolean","description":"Set true to reset store"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}/reset":{"put":{"summary":"Reset code reaction triggers and/or storage","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetCodeTriggersRequest"}}}},"responses":{"200":{"description":"Triggers and/or storage reset successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid options, or nothing to reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/code/{id}/status

> Update code reaction status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}/status":{"put":{"summary":"Update code reaction status","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid status, or reaction limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/strategy/reaction/code/{id}/public

> Update code reaction public visibility

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdatePublicRequest":{"type":"object","required":["isPublic"],"properties":{"isPublic":{"type":"boolean","description":"Set true to make the strategy public"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}/public":{"put":{"summary":"Update code reaction public visibility","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePublicRequest"}}}},"responses":{"200":{"description":"Public visibility updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or invalid public flag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/strategy/reaction/code/{id}/store

> Delete code reaction storage

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/strategy/reaction/code/{id}/store":{"delete":{"summary":"Delete code reaction storage","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Storage deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Strategy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/strategy/reaction/code/folder

> Get all code reaction folders

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/code/folder":{"get":{"summary":"Get all code reaction folders","tags":["code-reaction"],"responses":{"200":{"description":"List of user's code reaction folders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeReactionFolder"}}}}}}}}}}
```

## POST /api/v2/strategy/reaction/code/folder

> Create a new code reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/code/folder":{"post":{"summary":"Create a new code reaction folder","tags":["code-reaction"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"201":{"description":"Folder created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeReactionFolder"}}}},"400":{"description":"Invalid name or max folder limit reached"}}}}}}
```

## GET /api/v2/strategy/reaction/code/folder/root

> Get code reactions from root folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/code/folder/root":{"get":{"summary":"Get code reactions from root folder","tags":["code-reaction"],"responses":{"200":{"description":"List of code reactions in root folder","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeReaction"}}}}}}}}}}
```

## GET /api/v2/strategy/reaction/code/folder/{id}

> Get code reaction folder by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/strategy/reaction/code/folder/{id}":{"get":{"summary":"Get code reaction folder by ID","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder with its items","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeReactionFolder"}}}},"400":{"description":"Missing id"},"404":{"description":"Folder not found"}}}}}}
```

## PUT /api/v2/strategy/reaction/code/folder/{id}

> Update code reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/code/folder/{id}":{"put":{"summary":"Update code reaction folder","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"New folder name (optional, auto-generated if not provided)"}}}}}},"responses":{"200":{"description":"Folder updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, invalid name, or folder not found"},"404":{"description":"Folder not found"}}}}}}
```

## DELETE /api/v2/strategy/reaction/code/folder/{id}

> Delete code reaction folder

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"code-reaction"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/strategy/reaction/code/folder/{id}":{"delete":{"summary":"Delete code reaction folder","tags":["code-reaction"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Folder ID"}],"responses":{"200":{"description":"Folder deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"400":{"description":"Missing id, folder not found, or folder is not empty"},"404":{"description":"Folder not found"}}}}}}
```


# Signal Bots


# CEX Bot

## GET /api/v2/bot/signal/cex

> Get all CEX signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/bot/signal/cex":{"get":{"summary":"Get all CEX signal bots","tags":["cex-bot"],"responses":{"200":{"description":"List of user's CEX signal bots","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CexSignalBot"}}}}}}}}}}
```

## POST /api/v2/bot/signal/cex

> Create a new CEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateCexSignalBotRequest":{"type":"object","required":["webhook_id","api_id","symbol","amount_from_signal"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"api_id":{"type":"number","description":"The id of a bot CEX API key"},"symbol":{"type":"string","description":"The symbol of the bot"},"pair_base":{"type":"string","description":"The base currency of the pair (On ALPACA not required)"},"pair_quote":{"type":"string","description":"The quote currency of the pair (On ALPACA not required)"},"amount_from_signal":{"type":"boolean","description":"Set if amount is coming from signal"},"amount":{"type":"number","description":"The amount to trade (if amount_from_signal is false)"},"is_quote":{"type":"boolean","description":"Set if the amount is in quote currency"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex":{"post":{"summary":"Create a new CEX signal bot","tags":["cex-bot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCexSignalBotRequest"}}}},"responses":{"201":{"description":"CEX signal bot created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CexSignalBot"}}}},"400":{"description":"Missing required fields or invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/cex/total

> Get the total number of CEX signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/bot/signal/cex/total":{"get":{"summary":"Get the total number of CEX signal bots","tags":["cex-bot"],"responses":{"200":{"description":"Total number of CEX signal bots","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/bot/signal/cex/{id}

> Get CEX signal bot by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex/{id}":{"get":{"summary":"Get CEX signal bot by ID","tags":["cex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CEX signal bot details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CexSignalBot"}}}},"400":{"description":"Missing bot id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/cex/{id}

> Update CEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateCexSignalBotRequest":{"type":"object","required":["webhook_id","api_id","symbol","amount_from_signal"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"api_id":{"type":"number","description":"The id of a bot CEX API key"},"symbol":{"type":"string","description":"The symbol of the bot"},"pair_base":{"type":"string","description":"The base currency of the pair (On ALPACA not required)"},"pair_quote":{"type":"string","description":"The quote currency of the pair (On ALPACA not required)"},"amount_from_signal":{"type":"boolean","description":"Set if amount is coming from signal"},"amount":{"type":"number","description":"The amount to trade (if amount_from_signal is false)"},"is_quote":{"type":"boolean","description":"Set if the amount is in quote currency"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex/{id}":{"put":{"summary":"Update CEX signal bot","tags":["cex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCexSignalBotRequest"}}}},"responses":{"200":{"description":"CEX signal bot updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id or invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot, API key, or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/bot/signal/cex/{id}

> Delete CEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex/{id}":{"delete":{"summary":"Delete CEX signal bot","tags":["cex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"CEX signal bot deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/cex/{id}/status

> Update CEX signal bot status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex/{id}/status":{"put":{"summary":"Update CEX signal bot status","tags":["cex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id or invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Bot limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot or package not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/bot/signal/cex/duplicate

> Duplicate a CEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"cex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/cex/duplicate":{"post":{"summary":"Duplicate a CEX signal bot","tags":["cex-bot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Bot ID to duplicate"}}}}}},"responses":{"201":{"description":"CEX signal bot duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CexSignalBot"}}}},"400":{"description":"Missing bot id or bot limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# DEX Bot

## GET /api/v2/bot/signal/dex

> Get all DEX signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/bot/signal/dex":{"get":{"summary":"Get all DEX signal bots","tags":["dex-bot"],"responses":{"200":{"description":"List of user's DEX signal bots","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DexSignalBot"}}}}}}}}}}
```

## POST /api/v2/bot/signal/dex

> Create a new DEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateDexSignalBotRequest":{"type":"object","required":["webhook_id","factory_id","chain_id","symbol","address"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"factory_id":{"type":"number","description":"The id of a bot factory"},"chain_id":{"type":"number","description":"The id of a chain"},"address":{"type":"string","description":"The address of the bot"},"symbol":{"type":"string","description":"The symbol of the bot"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex":{"post":{"summary":"Create a new DEX signal bot","tags":["dex-bot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDexSignalBotRequest"}}}},"responses":{"201":{"description":"DEX signal bot created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DexSignalBot"}}}},"400":{"description":"Missing parameters, invalid data, or invalid contract address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Factory or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/dex/total

> Get the total number of DEX signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/bot/signal/dex/total":{"get":{"summary":"Get the total number of DEX signal bots","tags":["dex-bot"],"responses":{"200":{"description":"Total number of DEX signal bots","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/bot/signal/dex/{id}

> Get DEX signal bot by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/{id}":{"get":{"summary":"Get DEX signal bot by ID","tags":["dex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"DEX signal bot details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DexSignalBot"}}}},"400":{"description":"Missing bot id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/dex/{id}

> Update DEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateDexSignalBotRequest":{"type":"object","required":["webhook_id","symbol"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"symbol":{"type":"string","description":"The symbol of the bot"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/{id}":{"put":{"summary":"Update DEX signal bot","tags":["dex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDexSignalBotRequest"}}}},"responses":{"200":{"description":"DEX signal bot updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id or invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/bot/signal/dex/{id}

> Delete DEX signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/{id}":{"delete":{"summary":"Delete DEX signal bot","tags":["dex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"DEX signal bot deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/dex/{chainId}/{address}

> Get DEX signal bot by chain and address

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/{chainId}/{address}":{"get":{"summary":"Get DEX signal bot by chain and address","tags":["dex-bot"],"parameters":[{"in":"path","name":"chainId","required":true,"schema":{"type":"string"}},{"in":"path","name":"address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"DEX signal bot details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DexSignalBot"}}}},"400":{"description":"Missing chain id or address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/dex/factory/{chainId}/{exchangeId}

> Get bot factory by chain and exchange

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/factory/{chainId}/{exchangeId}":{"get":{"summary":"Get bot factory by chain and exchange","tags":["dex-bot"],"parameters":[{"in":"path","name":"chainId","required":true,"schema":{"type":"string"}},{"in":"path","name":"exchangeId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Factory details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotFactory"}}}},"400":{"description":"Missing chain or exchange","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Factory not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/dex/{id}/status

> Update DEX signal bot status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"dex-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/dex/{id}/status":{"put":{"summary":"Update DEX signal bot status","tags":["dex-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot id, invalid status, or status already set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"DEX bot limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Prediction Bot

## GET /api/v2/bot/signal/prediction/market/{exchange}/{slug}

> Get prediction market by slug

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/market/{exchange}/{slug}":{"get":{"summary":"Get prediction market by slug","tags":["prediction-bot"],"parameters":[{"in":"path","name":"exchange","required":true,"description":"Prediction market exchange","schema":{"type":"string"}},{"in":"path","name":"slug","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Prediction market data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionMarket"}}}},"400":{"description":"Missing slug or invalid slug","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/prediction

> Get all prediction signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/bot/signal/prediction":{"get":{"summary":"Get all prediction signal bots","tags":["prediction-bot"],"responses":{"200":{"description":"List of user's prediction signal bots","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PredictionSignalBot"}}}}}}}}}}
```

## POST /api/v2/bot/signal/prediction

> Create a new prediction signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreatePredictionSignalBotRequest":{"type":"object","required":["webhook_id","api_id","slug_from_signal","amount_from_signal"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"api_id":{"type":"number","description":"The id of a bot Prediction API key"},"slug_from_signal":{"type":"boolean","description":"Set to true to specify a market slug dynamically within the signal payload."},"url":{"type":"string","description":"The market url (required if slug_from_signal is false)"},"amount_from_signal":{"type":"boolean","description":"Set if amount is coming from signal"},"amount":{"type":"number","description":"The amount of the bot in USDC (if amount_from_signal is false)"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction":{"post":{"summary":"Create a new prediction signal bot","tags":["prediction-bot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePredictionSignalBotRequest"}}}},"responses":{"201":{"description":"Bot created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionSignalBot"}}}},"400":{"description":"Missing required fields, invalid data, or limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/bot/signal/prediction/total

> Get the total number of Prediction signal bots

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}}},"paths":{"/api/v2/bot/signal/prediction/total":{"get":{"summary":"Get the total number of Prediction signal bots","tags":["prediction-bot"],"responses":{"200":{"description":"Total number of Prediction signal bots","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"}}}}}}}}}}}
```

## GET /api/v2/bot/signal/prediction/{id}

> Get prediction signal bot by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/{id}":{"get":{"summary":"Get prediction signal bot by ID","tags":["prediction-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Prediction signal bot data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionSignalBot"}}}},"400":{"description":"Missing bot ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/prediction/{id}

> Update prediction signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdatePredictionSignalBotRequest":{"type":"object","required":["webhook_id","api_id","slug_from_signal","amount_from_signal"],"properties":{"name":{"type":"string","description":"The name of the bot max 255 characters"},"folder_id":{"type":"number","description":"The folder id of the bot"},"webhook_id":{"type":"number","description":"The id of a bot webhook"},"api_id":{"type":"number","description":"The id of a bot Prediction API key"},"slug_from_signal":{"type":"boolean","description":"Set to true to specify a market slug dynamically within the signal payload."},"url":{"type":"string","description":"The market url (required if slug_from_signal is false)"},"amount_from_signal":{"type":"boolean","description":"Set if amount is coming from signal"},"amount":{"type":"number","description":"The amount of the bot in USDC (if amount_from_signal is false)"},"delay":{"type":"number","description":"Set how often the bot will check for new signals. eg. 10 means 10 in 1 second"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/{id}":{"put":{"summary":"Update prediction signal bot","tags":["prediction-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePredictionSignalBotRequest"}}}},"responses":{"200":{"description":"Bot updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing required fields or invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot, API key, or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/bot/signal/prediction/{id}

> Delete prediction signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/{id}":{"delete":{"summary":"Delete prediction signal bot","tags":["prediction-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Bot deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/bot/signal/prediction/{id}/status

> Update prediction signal bot status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/{id}/status":{"put":{"summary":"Update prediction signal bot status","tags":["prediction-bot"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing bot ID, invalid status, or limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Bot limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/bot/signal/prediction/duplicate

> Duplicate a prediction signal bot

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-bot"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/bot/signal/prediction/duplicate":{"post":{"summary":"Duplicate a prediction signal bot","tags":["prediction-bot"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"Bot ID to duplicate"}}}}}},"responses":{"201":{"description":"Bot duplicated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionSignalBot"}}}},"400":{"description":"Missing bot ID, bot not found, or limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot or webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Hooks


# Bot Hooks

## GET /api/v2/webhook/bot

> Get all bot webhooks

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/webhook/bot":{"get":{"summary":"Get all bot webhooks","tags":["bot-hook"],"responses":{"200":{"description":"List of user's bot webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BotWebhook"}}}}}}}}}}
```

## POST /api/v2/webhook/bot

> Create a new bot webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateBotWebhookRequest":{"type":"object","required":[],"properties":{"name":{"type":"string","description":"The name of the bot hook max 255 characters"},"description":{"type":"string","description":"The description of the bot hook max 255 characters"},"is_safe":{"type":"boolean","description":"Set it true if want to set hash key"},"hash_key":{"type":"string","description":"The key of the bot hook"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot":{"post":{"summary":"Create a new bot webhook","tags":["bot-hook"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBotWebhookRequest"}}}},"responses":{"201":{"description":"Bot webhook created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotWebhook"}}}},"400":{"description":"Missing required fields, invalid password, or webhook limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Webhook limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Package not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/{id}

> Get bot webhook by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/{id}":{"get":{"summary":"Get bot webhook by ID","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Bot webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotWebhook"}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Bot webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/webhook/bot/{id}

> Update bot webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateBotWebhookRequest":{"type":"object","required":[],"properties":{"name":{"type":"string","description":"The name of the bot hook max 255 characters"},"description":{"type":"string","description":"The description of the bot hook max 255 characters"},"is_safe":{"type":"boolean","description":"Set it true if want to set hash key"},"hash_key":{"type":"string","description":"The key of the bot hook"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/{id}":{"put":{"summary":"Update bot webhook","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBotWebhookRequest"}}}},"responses":{"200":{"description":"Bot webhook updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook id or invalid password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/webhook/bot/{id}

> Delete bot webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/{id}":{"delete":{"summary":"Delete bot webhook","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Bot webhook deleted successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Webhook is in use by bots or strategies","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/{id}/shares

> Get webhook shares

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/{id}/shares":{"get":{"summary":"Get webhook shares","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of webhook shares","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookShare"}}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/webhook/bot/share/{id}

> Share webhook with user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ShareWebhookRequest":{"type":"object","required":["userId"],"properties":{"userId":{"type":"string","description":"The user id of the user to share the webhook with"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/share/{id}":{"post":{"summary":"Share webhook with user","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareWebhookRequest"}}}},"responses":{"201":{"description":"Webhook shared successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookShare"}}}},"400":{"description":"Missing webhook/user id, invalid permission, or not friends","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/webhook/bot/share/{id}

> Remove webhook share

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/share/{id}":{"delete":{"summary":"Remove webhook share","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"type":"string","description":"User ID to unshare with"}}}}}},"responses":{"200":{"description":"Share removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook/user id or not friends","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/bot/signal/{id}/cex

> Get CEX signal bots for webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/bot/signal/{id}/cex":{"get":{"summary":"Get CEX signal bots for webhook","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated CEX signal bots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSignalBots"}}}},"400":{"description":"Missing webhook id, page, or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/bot/signal/{id}/dex

> Get DEX signal bots for webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/bot/signal/{id}/dex":{"get":{"summary":"Get DEX signal bots for webhook","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated DEX signal bots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedSignalBots"}}}},"400":{"description":"Missing webhook id, page, or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/webhook/bot/{id}/status

> Update webhook status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/{id}/status":{"put":{"summary":"Update webhook status","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook id, invalid status, or status already set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Webhook limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook or package not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/shared

> Get all shared webhooks for user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/webhook/bot/shared":{"get":{"summary":"Get all shared webhooks for user","tags":["bot-hook"],"responses":{"200":{"description":"List of shared webhooks accessible to user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedWebhook"}}}}}}}}}}
```

## GET /api/v2/webhook/bot/shared/with/{id}

> Get webhooks shared with specific user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/shared/with/{id}":{"get":{"summary":"Get webhooks shared with specific user","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","description":"User ID to get webhooks shared with"}}],"responses":{"200":{"description":"List of webhooks shared with specified user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedWebhook"}}}}},"400":{"description":"Missing user id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Friendship not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/bot/shared/by/{id}

> Get webhooks shared by specific user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"bot-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/bot/shared/by/{id}":{"get":{"summary":"Get webhooks shared by specific user","tags":["bot-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","description":"User ID to get webhooks shared by"}}],"responses":{"200":{"description":"List of webhooks shared by specified user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedWebhook"}}}}},"400":{"description":"Missing user id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Friendship not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Data Hooks

## GET /api/v2/webhook/data

> Get all data webhooks

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/webhook/data":{"get":{"summary":"Get all data webhooks","tags":["data-hook"],"responses":{"200":{"description":"List of user's data webhooks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataWebhook"}}}}}}}}}}
```

## POST /api/v2/webhook/data

> Create a new data webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateDataWebhookRequest":{"type":"object","required":[],"properties":{"name":{"type":"string","description":"The name of the data hook max 255 characters"},"description":{"type":"string","description":"The description of the data hook max 255 characters"},"is_safe":{"type":"boolean","description":"Set it true if want to set hash key"},"hash_key":{"type":"string","description":"The key of the data hook"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data":{"post":{"summary":"Create a new data webhook","tags":["data-hook"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDataWebhookRequest"}}}},"responses":{"201":{"description":"Data webhook created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhook"}}}},"400":{"description":"Missing required fields or invalid password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Webhook limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Package not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/{id}

> Get data webhook by ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}":{"get":{"summary":"Get data webhook by ID","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Data webhook details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhook"}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/webhook/data/{id}

> Update data webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateDataWebhookRequest":{"type":"object","required":[],"properties":{"name":{"type":"string","description":"The name of the data hook max 255 characters"},"description":{"type":"string","description":"The description of the data hook max 255 characters"},"is_safe":{"type":"boolean","description":"Set it true if want to set hash key"},"hash_key":{"type":"string","description":"The key of the data hook"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}":{"put":{"summary":"Update data webhook","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDataWebhookRequest"}}}},"responses":{"200":{"description":"Data webhook updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhook"}}}},"400":{"description":"Missing webhook id or invalid password","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/webhook/data/{id}

> Delete data webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}":{"delete":{"summary":"Delete data webhook","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Data webhook deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Webhook is in use by reactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/{id}/shares

> Get webhook shares

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}/shares":{"get":{"summary":"Get webhook shares","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of webhook shares","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataWebhookShare"}}}}},"400":{"description":"Missing webhook id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/{id}/llm-reactions

> Get LLM reactions for webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}/llm-reactions":{"get":{"summary":"Get LLM reactions for webhook","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated LLM reactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedReactions"}}}},"400":{"description":"Missing webhook id, page, or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/{id}/code-reactions

> Get code reactions for webhook

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}/code-reactions":{"get":{"summary":"Get code reactions for webhook","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated code reactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedReactions"}}}},"400":{"description":"Missing webhook id, page, or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/webhook/data/share/{id}

> Share webhook with user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ShareWebhookRequest":{"type":"object","required":["userId"],"properties":{"userId":{"type":"string","description":"The user id of the user to share the webhook with"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/share/{id}":{"post":{"summary":"Share webhook with user","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareWebhookRequest"}}}},"responses":{"201":{"description":"Webhook shared successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataWebhookShare"}}}},"400":{"description":"Missing webhook/user id, invalid permission, or not friends","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/webhook/data/share/{id}

> Remove webhook share

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/share/{id}":{"delete":{"summary":"Remove webhook share","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["userId"],"properties":{"userId":{"type":"string","description":"User ID to unshare with"}}}}}},"responses":{"200":{"description":"Share removed successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook/user id or not friends","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/webhook/data/{id}/status

> Update webhook status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/{id}/status":{"put":{"summary":"Update webhook status","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing webhook id or invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Webhook limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Webhook not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/shared

> Get all shared data webhooks for user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/webhook/data/shared":{"get":{"summary":"Get all shared data webhooks for user","tags":["data-hook"],"responses":{"200":{"description":"List of shared data webhooks accessible to user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedDataWebhook"}}}}}}}}}}
```

## GET /api/v2/webhook/data/shared/with/{id}

> Get data webhooks shared with specific user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/shared/with/{id}":{"get":{"summary":"Get data webhooks shared with specific user","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","description":"User ID to get data webhooks shared with"}}],"responses":{"200":{"description":"List of data webhooks shared with specified user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedDataWebhook"}}}}},"400":{"description":"Missing user id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Friendship not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/webhook/data/shared/by/{id}

> Get data webhooks shared by specific user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"data-hook"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/webhook/data/shared/by/{id}":{"get":{"summary":"Get data webhooks shared by specific user","tags":["data-hook"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","description":"User ID to get data webhooks shared by"}}],"responses":{"200":{"description":"List of data webhooks shared by specified user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SharedDataWebhook"}}}}},"400":{"description":"Missing user id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Friendship not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# API Keys


# LLM API Keys

## GET /api/v2/api/llm/services

> Get all enabled LLM services

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/llm/services":{"get":{"summary":"Get all enabled LLM services","tags":["llm-api-keys"],"responses":{"200":{"description":"List of enabled services","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMService"}}}}}}}}}}
```

## GET /api/v2/api/llm/models/{serviceId}

> Get models for a specific service

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/models/{serviceId}":{"get":{"summary":"Get models for a specific service","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"serviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"List of models for the service","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMModel"}}}}},"400":{"description":"Missing serviceId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/api/llm/{id}/model

> Update model for an API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateModelRequest":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"number","description":"The id of a LLM model"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/{id}/model":{"put":{"summary":"Update model for an API key","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateModelRequest"}}}},"responses":{"200":{"description":"Model updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or modelId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key or model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/api/llm

> Get all LLM API keys for user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/llm":{"get":{"summary":"Get all LLM API keys for user","tags":["llm-api-keys"],"responses":{"200":{"description":"List of user's API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LLMApiKey"}}}}}}}}}}
```

## POST /api/v2/api/llm

> Create a new LLM API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateLLMApiKeyRequest":{"type":"object","required":["serviceId","modelId","apiKey"],"properties":{"name":{"type":"string","description":"The name of the API key max 255 characters"},"serviceId":{"type":"number","description":"The id of a LLM service"},"modelId":{"type":"number","description":"The id of a LLM model"},"apiKey":{"type":"string"}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm":{"post":{"summary":"Create a new LLM API key","tags":["llm-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLLMApiKeyRequest"}}}},"responses":{"201":{"description":"API key created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing required fields or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Service or model not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/api/llm/{id}

> Delete an LLM API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"llm-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/llm/{id}":{"delete":{"summary":"Delete an LLM API key","tags":["llm-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Missing id or API key is in use","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Exchange API Keys

## GET /api/v2/api/exchange

> Get all exchange API keys for user

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/exchange":{"get":{"summary":"Get all exchange API keys for user","tags":["exchange-api-keys"],"responses":{"200":{"description":"List of user's exchange API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeApiKey"}}}}}}}}}}
```

## POST /api/v2/api/exchange

> Create a new exchange API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreateExchangeApiKeyRequest":{"type":"object","required":["exchangeId","publicKey","privateKey"],"properties":{"exchangeId":{"type":"number","description":"The id of a CEX exchange"},"name":{"type":"string","description":"The name of the API key max 255 characters"},"publicKey":{"type":"string"},"privateKey":{"type":"string"},"extra":{"type":"string","description":"Some extra value if required, depends on the exchange"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/exchange":{"post":{"summary":"Create a new exchange API key","tags":["exchange-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExchangeApiKeyRequest"}}}},"responses":{"201":{"description":"API key created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeApiKey"}}}},"400":{"description":"Missing required fields or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Exchange not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/api/exchange/bot/signal/{id}

> Get signal bots that use an API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/exchange/bot/signal/{id}":{"get":{"summary":"Get signal bots that use an API key","tags":["exchange-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated signal bot data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignalBots"}}}},"400":{"description":"Missing id, page, or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/api/exchange/{id}/status

> Update API key status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/exchange/{id}/status":{"put":{"summary":"Update API key status","tags":["exchange-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id or invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/api/exchange/{id}

> Delete an exchange API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/exchange/{id}":{"delete":{"summary":"Delete an exchange API key","tags":["exchange-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing api id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"API key is in use by signal bots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/api/exchange/test

> Test exchange API key credentials

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"exchange-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"TestApiKeyRequest":{"type":"object","required":["exchangeId","publicKey","privateKey"],"properties":{"exchangeId":{"type":"number","description":"The id of a CEX exchange"},"publicKey":{"type":"string"},"privateKey":{"type":"string"},"extra":{"type":"sting","description":"Some extra value if required, depends on the exchange"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/exchange/test":{"post":{"summary":"Test exchange API key credentials","tags":["exchange-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestApiKeyRequest"}}}},"responses":{"200":{"description":"API key is valid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResponse"}}}},"400":{"description":"Missing required fields or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResponse"}}}},"404":{"description":"Exchange not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


# Prediction API Keys

## GET /api/v2/api/prediction

> Get all prediction API keys

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{}},"paths":{"/api/v2/api/prediction":{"get":{"summary":"Get all prediction API keys","tags":["prediction-api-keys"],"responses":{"200":{"description":"List of user's prediction API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PredictionApiKey"}}}}}}}}}}
```

## POST /api/v2/api/prediction

> Create a new prediction API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"CreatePredictionApiKeyRequest":{"type":"object","required":["exchangeId","funderAddress","walletPrivateKey"],"properties":{"name":{"type":"string","description":"The name of the API key max 255 characters"},"exchangeId":{"type":"number","description":"The id of a Exchange"},"funderAddress":{"type":"string","description":"PolyMarket platform funder address"},"walletPrivateKey":{"type":"string","description":"Signer wallet private key"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/prediction":{"post":{"summary":"Create a new prediction API key","tags":["prediction-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePredictionApiKeyRequest"}}}},"responses":{"201":{"description":"API key created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredictionApiKey"}}}},"400":{"description":"Missing required fields, invalid name, or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Exchange not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v2/api/prediction/bot/signal/{id}

> Get prediction signal bots by API ID

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/prediction/bot/signal/{id}":{"get":{"summary":"Get prediction signal bots by API ID","tags":["prediction-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":true,"schema":{"type":"integer"}},{"in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated list of prediction signal bots","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PredictionSignalBot"}}}}}}},"400":{"description":"Missing required parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## PUT /api/v2/api/prediction/{id}/status

> Update prediction API key status

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"UpdateStatusRequest":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["ACTIVE","INACTIVE"]}}},"SuccessResponse":{"type":"object","properties":{"message":{"type":"string"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/prediction/{id}/status":{"put":{"summary":"Update prediction API key status","tags":["prediction-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Status updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessResponse"}}}},"400":{"description":"Missing id, invalid status, or status already set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## DELETE /api/v2/api/prediction/{id}

> Delete prediction API key

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/prediction/{id}":{"delete":{"summary":"Delete prediction API key","tags":["prediction-api-keys"],"parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key deleted successfully","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Missing API ID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"API key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"API key is in use by signal bots","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /api/v2/api/prediction/test

> Test prediction API credentials

```json
{"openapi":"3.0.0","info":{"title":"Sigrex API","version":"2.1.0"},"tags":[{"name":"prediction-api-keys"}],"servers":[{"url":"https://api.sigrex.io"}],"security":[{"ApiKey":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ApiKey":{"type":"apiKey","in":"header","name":"api-key","description":"Your public API key"}},"schemas":{"TestPredictionApiKeyRequest":{"type":"object","required":["exchangeId","funderAddress","walletPrivateKey"],"properties":{"exchangeId":{"type":"number","description":"The id of a Exchange"},"funderAddress":{"type":"number","description":"PolyMarket platform funder address"},"walletPrivateKey":{"type":"string","description":"Signer wallet private key"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/api/v2/api/prediction/test":{"post":{"summary":"Test prediction API credentials","tags":["prediction-api-keys"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPredictionApiKeyRequest"}}}},"responses":{"200":{"description":"API credentials are valid","content":{"application/json":{"schema":{"type":"boolean"}}}},"400":{"description":"Missing required fields, invalid credentials, or exchange not found","content":{"application/json":{"schema":{"oneOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ErrorResponse"}]}}}}}}}}}
```


