Saltar al contenido principal

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 a BotSpec.
  • 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​

FieldTypeDescription
idstringUnique UUID
namestringHuman-readable name
slugstringURL-friendly identifier
kindstringtrading or research
statusstringdraft, active, archived
current_versionintegerLatest version number

BotDeployment​

FieldTypeDescription
targetstringbacktest, paper, k8s
statusstringpending, running, success, failed, halted
task_idstringCelery task ID
result_summarydictSummary of results (e.g., PnL, Sharpe)