feat: add Trading Bot API group#53
Open
troycdc wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the new Trading Bot API division as a first-class
botCLI group and MCP service, enabling automated bot management through the existing schema-driven architecture.New commands
What's wired up
"Trading Bot API"tag →"bot"group,private/bot/prefix stripping, command name derivationterminate= Dangerous,create/update/pause/resume= Mutate,get-*= SensitiveReadschemas/apis/bot.toml— renames (create,list,executions), positional args (bot_type,bot_id)"bot"service group registered, included in"all"("bot", "Trading bot management")inMCP_SERVICE_GROUPSBot types supported
DCA·TWAP·GRID·FUNDING_ARBITRAGEComplex
settingsobjects are passed via--json '{"settings": {...}}'.How it activates
The production OpenAPI spec at
exchange-developer.crypto.comdoes not yet include these endpoints. Once published, runningcdcx schema update(or waiting for the 24h auto-refresh) will pull the spec and thebotgroup 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 cleancargo test— 328 tests pass (new bot-specific tests included)cargo clippy— no warningscdcx bot --helpshows all 7 subcommands with correct descriptionscdcx bot list --bot-types DCA --state RUNNING --dry-rundispatches correctlycdcx bot terminate 123 --bot-type GRID --dry-rundispatches with Dangerous tiercdcx_bot_create,cdcx_bot_terminate,cdcx_bot_list, etc.🤖 Generated with Claude Code