Trading Bots API
A Bot is the smallest self-contained, deployable unit on AlphaSwarm. It aggregates a universe, strategy, engine, ML models, and agents.
Endpoints
CRUD Operations
GET /bots: List all bots.POST /bots: Create a new bot from aBotSpec.GET /bots/{bot_ref}: Get bot detail (by ID or slug).PUT /bots/{bot_ref}: Update bot spec or status.DELETE /bots/{bot_ref}: Delete a bot.
Lifecycle & Deployment
POST /bots/{bot_ref}/backtest: Dispatch a backtest run for the bot.POST /bots/{bot_ref}/paper/start: Start a paper trading session.POST /bots/{bot_ref}/paper/stop/{task_id}: Stop a specific paper session.POST /bots/{bot_ref}/deploy: Deploy the bot to a production target (e.g., Kubernetes).POST /bots/{bot_ref}/halt: Halt all active deployments for a specific bot.POST /bots/halt-all: Kill switch to halt every active bot deployment on the platform.
Observability & Replay
GET /bots/{bot_ref}/versions: List immutable, hash-locked version snapshots of the bot.GET /bots/{bot_ref}/deployments: List all historical and active deployments.POST /bots/{bot_ref}/replay: Time-travel replay of events for the bot.GET /bots/{bot_ref}/state/snapshot: Get the latest event-sourced state snapshot (positions, exposures, metrics).GET /bots/{bot_ref}/state/events: Paginated event stream from the bot's history.
Regulatory & Compliance
POST /bots/{bot_ref}/conformance: Run RTS 6 Article 6 conformance tests.POST /bots/{bot_ref}/stress: Run RTS 6 Article 10 stress tests (2x peak).GET /bots/{bot_ref}/risk/validation-report: Generate annual risk validation report payload.
Research Chat
POST /bots/{bot_ref}/chat: Interaction with a ResearchBot via prompt.
Schemas
BotSummary
| Field | Type | Description |
|---|---|---|
id | string | Unique UUID |
name | string | Human-readable name |
slug | string | URL-friendly identifier |
kind | string | trading or research |
status | string | draft, active, archived |
current_version | integer | Latest version number |
BotDeployment
| Field | Type | Description |
|---|---|---|
target | string | backtest, paper, k8s |
status | string | pending, running, success, failed, halted |
task_id | string | Celery task ID |
result_summary | dict | Summary of results (e.g., PnL, Sharpe) |