Skip to content

feat: add Trading Bot API group#53

Open
troycdc wants to merge 3 commits into
mainfrom
feat/trading-bot-api
Open

feat: add Trading Bot API group#53
troycdc wants to merge 3 commits into
mainfrom
feat/trading-bot-api

Conversation

@troycdc

@troycdc troycdc commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds the new Trading Bot API division as a first-class bot CLI group and MCP service, enabling automated bot management through the existing schema-driven architecture.

New commands

cdcx bot create <bot_type> --notify-on-bot-change --settings '{...}'
cdcx bot terminate <bot_id> --bot-type <type>
cdcx bot update <bot_id> --bot-type <type> [--settings '{...}']
cdcx bot pause <bot_id> --bot-type <type>
cdcx bot resume <bot_id> --bot-type <type>
cdcx bot list --bot-types DCA,GRID --state RUNNING
cdcx bot executions <bot_id>

What's wired up

Layer Change
Parser "Trading Bot API" tag → "bot" group, private/bot/ prefix stripping, command name derivation
Safety terminate = Dangerous, create/update/pause/resume = Mutate, get-* = SensitiveRead
Overlay schemas/apis/bot.toml — renames (create, list, executions), positional args (bot_type, bot_id)
MCP "bot" service group registered, included in "all"
Config ("bot", "Trading bot management") in MCP_SERVICE_GROUPS
Tests Unit tests for tag mapping, command derivation, safety tiers, MCP tool generation; fixture endpoints added

Bot types supported

DCA · TWAP · GRID · FUNDING_ARBITRAGE

Complex settings objects are passed via --json '{"settings": {...}}'.

How it activates

The production OpenAPI spec at exchange-developer.crypto.com does not yet include these endpoints. Once published, running cdcx schema update (or waiting for the 24h auto-refresh) will pull the spec and the bot group appears automatically — no binary update needed.

For testing now: CDC_OPENAPI_URL=https://exchange-developer-dev.x.3ona.co/exchange/v1/openapi/ points to the dev spec which already has the 7 bot endpoints.

Test plan

  • cargo build — compiles clean
  • cargo test — 328 tests pass (new bot-specific tests included)
  • cargo clippy — no warnings
  • cdcx bot --help shows all 7 subcommands with correct descriptions
  • cdcx bot list --bot-types DCA --state RUNNING --dry-run dispatches correctly
  • cdcx bot terminate 123 --bot-type GRID --dry-run dispatches with Dangerous tier
  • MCP tool names: cdcx_bot_create, cdcx_bot_terminate, cdcx_bot_list, etc.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant