Strategies API
List Strategies
GET /api/strategiesResponse:
json
{
"strategies": [
{
"id": "str_abc123",
"name": "MeanReversion",
"description": "Mean reversion strategy on BTC",
"marketType": "LINEAR",
"version": 3,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-02-01T14:20:00Z"
}
]
}Get Strategy
GET /api/strategies/:idReturns the strategy with full source code and version history.
Create Strategy
POST /api/strategiesBody:
json
{
"name": "MeanReversion",
"description": "Mean reversion on linear futures",
"source": "use tradectl_sdk::prelude::*; ...",
"marketType": "LINEAR"
}Source code max size: 500 KB.
Update Strategy
PUT /api/strategies/:idBody:
json
{
"name": "MeanReversion v2",
"description": "Updated description",
"source": "..."
}Updating source creates a new version automatically.
Delete Strategy
DELETE /api/strategies/:idFails if the strategy has active deployments.