openapi: 3.1.0 info: title: Gainium API v2.0 version: 2.0.0 description: > # Gainium API v2.0 with Field Selection API v2.0 introduces efficient field selection to reduce payload size by 70-90%. ## Authentication All REST requests must contain the following headers: - **token**: Public key of the user - **time**: Timestamp of the request in ms - **signature**: The base64-encoded signature ### To sign a request: 1. Use API-Secret to encrypt the prehash string {body+method+endpoint+timestamp} with sha256 HMAC 2. The request body is a JSON string and need to be the same with the parameters passed by the API 3. After that, use base64-encode to encrypt the result in step 1 again **Example:** ```javascript crypto.createHmac('sha256', secret).update(body + method + endpoint + time).digest('base64') ``` ## Field Selection All GET endpoints in v2 support field selection via the `fields` query parameter. ### Field Presets - **minimal**: Essential fields only (IDs, names, status) - **standard**: Commonly requested fields (default) - **extended**: Additional useful fields - **full**: All available fields ### Custom Fields Specify custom fields with comma-separated list: ``` ?fields=_id,uuid,settings.name,profit.total ``` Supports dot notation for nested fields: ``` ?fields=settings.name,settings.pair,profit.total,profit.totalUsd ``` ### Response Metadata All responses include metadata with selected fields: ```json { "status": "OK", "reason": null, "data": [...], "meta": { "page": 1, "total": 150, "count": 150, "onPage": 10, "fields": ["_id", "uuid", "settings.name", ...] } } ``` ### Benefits - **70-90% smaller payloads** with minimal/standard presets - **Faster response times** via MongoDB projection - **Reduced network bandwidth** usage - **Better API performance** overall ## V1 to V2 Migration Guide V2 introduces REST-compliant endpoints with proper HTTP methods and resource-oriented URLs. All v1 endpoints remain available for backward compatibility. ### Paper Trading Context - **V1**: `paperContext` as query parameter or body field - **V2**: `paper-context` header (optional, defaults to `false`) ### Bot Operations #### Get Bots - **V1**: `GET /api/bots/dca` → **V2**: `GET /api/v2/bots/dca` - **V1**: `GET /api/bots/combo` → **V2**: `GET /api/v2/bots/combo` - **V1**: `GET /api/bots/grid` → **V2**: `GET /api/v2/bots/grid` #### Update Bots - **V1**: `POST /api/updateDCABot` → **V2**: `PUT /api/v2/bots/dca/{botId}` - **V1**: `POST /api/updateComboBot` → **V2**: `PUT /api/v2/bots/combo/{botId}` #### Bot Actions - **V1**: `POST /api/startBot` → **V2**: `POST /api/v2/bots/{dca|combo|grid}/{botId}/start` - **V1**: `POST /api/stopBot` → **V2**: `POST /api/v2/bots/{dca|combo|grid}/{botId}/stop` - **V1**: `POST /api/archiveBot` → **V2**: `DELETE /api/v2/bots/{dca|combo|grid}/{botId}` - **V1**: `POST /api/restoreBot` → **V2**: `POST /api/v2/bots/{dca|combo|grid}/{botId}/restore` - **V1**: `POST /api/cloneDCABot` → **V2**: `POST /api/v2/bots/dca/{botId}/clone` - **V1**: `POST /api/cloneComboBot` → **V2**: `POST /api/v2/bots/combo/{botId}/clone` - **V1**: not exist → **V2**: `POST /api/v2/bots/grid/{botId}/clone` - **V1**: `POST /api/changeBotPairs` → **V2**: `PUT /api/v2/bots/dca/{botId}/pairs` ### Deal Operations #### Get Deals - **V1**: `GET /api/deals` → **V2**: `GET /api/v2/deals/{dca|combo|terminal}` #### Update Deals - **V1**: `POST /api/updateDCADeal` → **V2**: `PUT /api/v2/deals/dca/{dealId}` - **V1**: `POST /api/updateComboDeal` → **V2**: `PUT /api/v2/deals/combo/{dealId}` #### Deal Actions - **V1**: `POST /api/startDeal` → **V2**: `POST /api/v2/deals/{dca|combo}/{dealId}/start` - **V1**: `POST /api/addFunds` → **V2**: `POST /api/v2/deals/add-funds` - **V1**: `POST /api/reduceFunds` → **V2**: `POST /api/v2/deals/reduce-funds` - **V1**: `POST /api/closeDeal/{dealId}` → **V2**: `DELETE /api/v2/deals/{dca|combo|terminal}/{dealId}?type=closeByMarket` - **V1**: `POST /api/cancelDeal/{dealId}` → **V2**: `DELETE /api/v2/deals/{dca|combo|terminal}/{dealId}?type=cancel` ### User Operations #### Get User Data - **V1**: `GET /api/user/exchanges` → **V2**: `GET /api/v2/user/exchanges` - **V1**: `GET /api/user/balances` → **V2**: `GET /api/v2/user/balances` ### Key Differences 1. **HTTP Methods**: V2 uses proper REST methods (GET, POST, PUT, DELETE) instead of POST for everything 2. **URL Structure**: Resource-oriented paths (`/bots/dca/{botId}`) instead of action verbs (`/updateDCABot`) 3. **Bot Type in Path**: Bot type is now part of the URL path for better API documentation and clarity 4. **Headers vs Parameters**: Cross-cutting concerns like `paperContext` moved to headers 5. **Field Selection**: V2 supports efficient field selection on all GET endpoints 6. **Deal Type Specification**: V1 used a single `/api/deals` endpoint; V2 separates by type (`/deals/dca`, `/deals/combo`, `/deals/terminal`) 7. **Bot Creation**: V2 creates bots via `POST /api/v2/bots/{type}` (implemented in future version) servers: - url: https://api.gainium.io description: Production server components: securitySchemes: ApiKeyAuth: type: apiKey in: header name: token description: Public API key SecretAuth: type: apiKey in: header name: secret description: Your HMAC secret (used to sign requests, never sent) TimeHeader: type: apiKey in: header name: time description: Request timestamp in milliseconds. Auto-generated — do not fill in SignatureAuth: type: apiKey in: header name: signature description: >- HMAC-SHA256 signature of {body+method+endpoint+timestamp}. Auto-generated — do not fill in parameters: FieldsParam: name: fields in: query required: false description: > Field selection parameter. Accepts: - **Presets**: `minimal`, `standard`, `extended`, `full` - **Custom fields**: Comma-separated list (e.g., `_id,uuid,settings.name,profit.total`) - **Dot notation**: For nested fields (e.g., `settings.name`, `profit.total`) Default: `standard` schema: type: string default: standard examples: - minimal - standard - extended - full - _id,uuid,settings.name,profit.total PageParam: name: page in: query required: false description: Page number for pagination (1-based) schema: type: integer minimum: 1 default: 1 example: 1 PaperContextHeader: name: paper-context in: header required: false description: >- Paper trading context. Set to "true" for paper trading, "false" or omit for real trading. schema: type: string enum: - 'true' - 'false' default: 'false' example: 'false' BotTypeParam: name: botType in: path required: true description: Type of bot (dca, combo, or grid) schema: type: string enum: - dca - combo - grid example: dca DealTypeParam: name: dealType in: path required: true description: Type of deal (dca, combo, or terminal) schema: type: string enum: - dca - combo - terminal example: dca BotIdParam: name: botId in: path required: true description: Bot ID (MongoDB ObjectId) schema: type: string example: 507f1f77bcf86cd799439011 DealIdParam: name: dealId in: path required: true description: Deal ID (MongoDB ObjectId) schema: type: string example: 507f1f77bcf86cd799439012 AgentIdParam: name: agentId in: path required: true schema: type: string description: MongoDB ObjectId of the agent HitlIdParam: name: hitlId in: path required: true schema: type: string description: MongoDB ObjectId of the HITL request RunIdParam: name: runId in: path required: true schema: type: string description: MongoDB ObjectId of the agent run BacktestIdParam: name: backtestId in: path required: true schema: type: string description: MongoDB ObjectId of the agent backtest schemas: APIListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of response items meta: $ref: '#/components/schemas/ResponseMeta' APIResponse: type: object required: - status - reason - data properties: status: type: string enum: - OK - NOTOK description: Request execution status example: OK reason: type: string nullable: true description: Error reason if status is NOTOK example: null AddFundsSchema: type: object required: - qty properties: qty: type: string description: Amount to add example: '100' asset: type: string enum: - base - quote description: Asset type (required for fixed type) example: quote symbol: type: string description: Trading symbol (optional) example: BTC_USDT type: type: string enum: - fixed - perc description: Funds type (default is fixed) example: fixed BacktestCostEstimate: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: object description: Backtest cost estimation with credit information required: - estimatedCredits - availableCredits - allowed properties: estimatedCredits: type: integer description: Estimated cost in credits for the backtest example: 2 availableCredits: type: integer description: User's currently available credits example: 10000 allowed: type: boolean description: Whether user has sufficient credits for the backtest example: true example: estimatedCredits: 2 availableCredits: 10000 allowed: true BacktestDCAConfig: type: object required: - exchange - exchangeUUID properties: exchange: type: string description: Exchange identifier example: binance exchangeUUID: type: string description: Unique exchange connection identifier example: 550e8400-e29b-41d4-a716-446655440000 settings: $ref: '#/components/schemas/DCABotSettings' from: type: integer description: Backtest start timestamp (milliseconds) example: 1640995200000 to: type: integer description: Backtest end timestamp (milliseconds) example: 1672531199000 interval: type: string description: Chart interval for backtest example: 1h fromBacktest: type: boolean description: Import from previous backtest example: false trades: type: boolean description: Include trade details in results example: true paperContext: type: boolean description: Paper trading context example: true BacktestGridConfig: type: object required: - exchange - exchangeUUID properties: exchange: type: string description: Exchange identifier example: binance exchangeUUID: type: string description: Unique exchange connection identifier example: 550e8400-e29b-41d4-a716-446655440000 settings: $ref: '#/components/schemas/BotSettings' from: type: integer description: Backtest start timestamp (milliseconds) example: 1640995200000 to: type: integer description: Backtest end timestamp (milliseconds) example: 1672531199000 interval: type: string description: Chart interval for backtest example: 1h fromBacktest: type: boolean description: Import from previous backtest example: false trades: type: boolean description: Include trade details in results example: true paperContext: type: boolean description: Paper trading context example: true BacktestRequest: type: object required: - payload - symbols properties: payload: $ref: '#/components/schemas/ServerSideBacktestPayload' symbols: type: array description: Array of trading symbols for backtest items: $ref: '#/components/schemas/BacktestSymbol' BacktestRequestItem: type: object description: A single backtest request record including optional embedded result properties: _id: type: string description: MongoDB ObjectId of the request example: 69a04ceccf441b9c0d60dcd7 status: type: string enum: - pending - loadingData - processing - success - failed description: Current processing status example: success type: type: string enum: - dca - combo - grid description: Bot type for this backtest example: dca exchange: type: string description: Exchange code example: binance exchangeUUID: type: string format: uuid description: Exchange connection UUID example: dc6679c4-1e33-43b8-80d7-a4954c5234ce symbols: type: array description: Trading pairs included in the backtest items: $ref: '#/components/schemas/BacktestSymbol' cost: type: integer description: Credits charged for this backtest example: 2 backtestId: type: string nullable: true description: >- shareId of the saved backtest result (present when status is success) example: 09f94e16-fdbd-4196-b7fe-969a683b94c4 statusReason: type: string nullable: true description: >- Human-readable reason for the current status (usually set on failure) example: null statusHistory: type: array description: Full timeline of status transitions items: $ref: '#/components/schemas/BacktestStatusHistoryItem' payload: type: object description: >- Full backtest configuration payload (only included when payload field is selected) backtest: type: object nullable: true description: > Embedded backtest result object. Present when backtestId is set and one or more `backtest.*` fields are selected (or no field filter). Use `backtest.financial`, `backtest.settings`, etc. for field selection. example: null created: type: string format: date-time description: ISO timestamp when the request was created example: '2026-02-26T13:38:52.929Z' updated: type: string format: date-time description: ISO timestamp of last update example: '2026-02-26T13:39:09.686Z' BacktestRequestListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of backtest request items items: $ref: '#/components/schemas/BacktestRequestItem' meta: $ref: '#/components/schemas/ResponseMeta' BacktestRequestSingleResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/BacktestRequestItem' BacktestResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: object properties: message: type: string description: Backtest result message example: Backtest request sent successfully requestId: type: string description: Request ID for tracking backtest status example: 507f1f77bcf86cd799439013 BacktestStatusHistoryItem: type: object description: A single status transition entry for a backtest request properties: status: type: string enum: - pending - loadingData - processing - success - failed description: Status at this point in time example: pending time: type: integer description: Unix timestamp (ms) when the status was set example: 1772113132925 BacktestSymbol: type: object required: - pair - baseAsset - quoteAsset properties: pair: type: string description: Trading pair symbol example: BTC_USDT baseAsset: type: string description: Base asset symbol (e.g., BTC in BTC_USDT) example: BTC quoteAsset: type: string description: Quote asset symbol (e.g., USDT in BTC_USDT) example: USDT BalanceListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of balances items: $ref: '#/components/schemas/BalanceStandard' meta: $ref: '#/components/schemas/ResponseMeta' BalanceMinimal: type: object description: Minimal balance representation required: - asset - free - locked - exchangeUUID properties: asset: type: string description: Asset symbol example: BTC free: type: string description: Available balance example: '0.5' locked: type: string description: Locked balance (in orders) example: '0.1' exchangeUUID: type: string format: uuid description: Exchange connection UUID example: 650e8400-e29b-41d4-a716-446655440001 BalanceStandard: allOf: - $ref: '#/components/schemas/BalanceMinimal' - type: object properties: exchange: type: string description: Exchange code example: binance paperContext: type: boolean nullable: true description: Whether this is a paper trading context example: false BaseSettings: type: object properties: name: type: string example: null profitCurrency: type: object orderFixedIn: type: object pair: type: string description: Trading pair symbol example: BTC/USDT futures: type: boolean description: Enable futures trading example: false coinm: type: boolean description: Coin-margined futures example: false marginType: type: string description: Margin type for futures enum: - inherit - cross - isolated example: cross leverage: type: number description: Leverage multiplier example: 10 strategy: type: string description: Trading strategy direction (long or short) enum: - LONG - SHORT example: LONG BotSchemaDefinition: type: object required: - botType - label - description - sections properties: botType: type: string enum: - dca - combo - grid label: type: string example: DCA Bot description: type: string sections: type: array items: $ref: '#/components/schemas/SectionDefinition' BotSettings: description: BotSettings configuration allOf: - $ref: '#/components/schemas/BaseSettings' - type: object properties: pair: type: string description: Trading pair symbol example: BTC/USDT topPrice: type: number description: Top price of grid range example: 55000 lowPrice: type: number description: Bottom price of grid range example: 45000 levels: type: number description: Number of grid levels example: 10 gridStep: type: number description: Step between grid levels example: 1000 budget: type: number description: Total budget allocated to bot example: 10000 ordersInAdvance: type: number description: Orders to place in advance example: 5 useOrderInAdvance: type: boolean description: Enable advance order placement example: true prioritize: type: object description: Prioritization settings example: volume sellDisplacement: type: number description: Displacement for sell orders example: 0.5 gridType: type: object description: Type of grid example: arithmetic tpSl: type: boolean description: Combined TP/SL for grid example: false tpSlCondition: type: object description: Condition for TP/SL trigger example: any tpSlAction: type: object description: Action for TP/SL example: close sl: type: boolean description: Enable stop loss for grid example: false slCondition: type: object description: Stop loss trigger condition example: price slAction: type: object description: Stop loss action example: closeAll tpPerc: type: number description: Take profit percentage example: '2.5' slPerc: type: number description: Stop loss percentage example: '1.5' tpTopPrice: type: number description: Take profit top price example: 60000 slLowPrice: type: number description: Stop loss bottom price example: 40000 updatedBudget: type: boolean description: Budget has been updated example: false useStartPrice: type: boolean description: Use custom start price example: false startPrice: type: string description: Custom start price example: '50000' futures: type: boolean description: Enable futures trading example: false newProfit: type: boolean description: New profit calculation example: false newBalance: type: boolean description: New balance mode example: false coinm: type: boolean description: Coin-margined futures example: false strategy: type: string description: Trading strategy direction (long or short) enum: - LONG - SHORT example: LONG futuresStrategy: type: string description: Futures trading strategy enum: - LONG - SHORT - NEUTRAL example: LONG slLimit: type: boolean description: Use limit orders for stop loss example: false tpSlLimit: type: boolean description: Use limit orders for TP/SL example: false feeOrder: type: boolean description: Include fees in order calculation example: true lastPriceRangeAlert: type: number description: Alert when price near range example: 5 skipBalanceCheck: type: boolean description: Skip balance verification example: false ComboBacktestRequest: type: object required: - payload - symbols properties: payload: type: object description: Combo backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/ComboBacktestPayload' symbols: type: array description: Array of trading symbols for backtest items: $ref: '#/components/schemas/BacktestSymbol' ComboBotExtended: $ref: '#/components/schemas/DCABotExtended' ComboBotListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of Combo bots items: $ref: '#/components/schemas/ComboBotExtended' meta: $ref: '#/components/schemas/ResponseMeta' ComboBotMinimal: $ref: '#/components/schemas/DCABotMinimal' ComboBotSettings: description: ComboBotSettings configuration allOf: - $ref: '#/components/schemas/DCABotSettings' - type: object properties: gridLevel: type: string description: Current grid level example: '5' newBalance: type: boolean description: New balance mode example: false feeOrder: type: boolean description: Include fees in order calculation example: true ComboBotStandard: $ref: '#/components/schemas/DCABotStandard' ComboDealExtended: $ref: '#/components/schemas/DCADealExtended' ComboDealMinimal: $ref: '#/components/schemas/DCADealMinimal' ComboDealStandard: $ref: '#/components/schemas/DCADealStandard' CreateComboBotInput: type: object description: > Input schema for creating a new Combo bot. Inherits all ComboBotSettings properties plus additional required fields for creation. Combo bots extend DCA bots with additional grid-level functionality. Some settings in ComboBotSettings type are not used - refer to API documentation for excluded fields list. Note: The following properties are auto-generated and should NOT be provided in the request: - `futures` (auto-detected from exchange configuration) - `coinm` (auto-detected from exchange configuration) - `paperContext` (provided via paper-context header) required: - exchangeUUID allOf: - $ref: '#/components/schemas/ComboBotSettings' - type: object properties: exchangeUUID: type: string description: UUID of the exchange configuration example: 650e8400-e29b-41d4-a716-446655440001 vars: type: array description: Bot variables configuration items: type: object description: Bot variable object properties: path: type: string description: >- Path to the variable in bot settings or stats. For example, "orderSize" or "indicators.{uuid}.value" example: orderSize variable: type: string description: Variable id example: var1 futures: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. coinm: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. pair: type: array description: Trading pairs. In the format {base}_{quote} items: type: string example: BTC_USDT CreateDCABotInput: type: object description: > Input schema for creating a new DCA bot. Inherits all DCABotSettings properties plus additional required fields for creation. Note: The following properties are auto-generated and should NOT be provided in the request: - `futures` (auto-detected from exchange configuration) - `coinm` (auto-detected from exchange configuration) - `paperContext` (provided via paper-context header) required: - exchangeUUID allOf: - $ref: '#/components/schemas/DCABotSettings' - type: object properties: exchangeUUID: type: string description: UUID of the exchange configuration example: 650e8400-e29b-41d4-a716-446655440001 vars: type: array description: Bot variables configuration items: type: object description: Bot variable object properties: path: type: string description: >- Path to the variable in bot settings or stats. For example, "orderSize" or "indicators.{uuid}.value" example: orderSize variable: type: string description: Variable id example: var1 futures: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. coinm: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. pair: type: array description: Trading pairs. In the format {base}_{quote} items: type: string example: BTC_USDT CreateGridBotInput: type: object description: > Input schema for creating a new Grid bot. Grid bots automatically buy and sell assets within a configured price range. Note: The following properties are auto-generated and should NOT be provided in the request: - `futures` (auto-detected from exchange configuration) - `coinm` (auto-detected from exchange configuration) - `paperContext` (provided via paper-context header) required: - exchangeUUID - pair - topPrice - lowPrice - budget allOf: - $ref: '#/components/schemas/BotSettings' - type: object properties: exchangeUUID: type: string description: UUID of the exchange configuration example: 650e8400-e29b-41d4-a716-446655440001 futures: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. coinm: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. pair: type: string description: Trading pair in the format {base}_{quote} example: BTC_USDT CreateTerminalDealInput: type: object description: > Input schema for creating a new Terminal Deal (one-time trade). Inherits all DCABotSettings properties plus additional required fields. Terminal deals are one-time trades that execute immediately and don't continue running like regular bots. The type field will be automatically set to 'terminal'. Note: The following properties are auto-generated and should NOT be provided in the request: - `futures` (auto-detected from exchange configuration) - `coinm` (auto-detected from exchange configuration) - `type` (automatically set to 'terminal') - `paperContext` (provided via paper-context header) required: - exchangeUUID - terminalDealType allOf: - $ref: '#/components/schemas/DCABotSettings' - type: object properties: exchangeUUID: type: string description: UUID of the exchange configuration example: 650e8400-e29b-41d4-a716-446655440001 futures: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. coinm: readOnly: true description: >- Auto-generated - do not provide. Detected from exchange configuration. pair: type: array description: Trading pairs. In the format {base}_{quote} items: type: string example: BTC_USDT DCABotExtended: allOf: - $ref: '#/components/schemas/DCABotStandard' - type: object description: Extended DCA bot representation with comprehensive settings properties: symbol: type: array description: Trading symbols items: type: object properties: key: type: string description: Symbol key (e.g., BTC_USDT) example: BTC_USDT value: type: object description: Symbol-specific settings properties: symbol: type: string description: Trading symbol example: BTCUSDT baseAsset: type: string description: Base asset of the pair example: BTC quoteAsset: type: string description: Quote asset of the pair example: USDT settings: description: DCA bot settings configuration $ref: '#/components/schemas/DCABotSettings' profitToday: type: object nullable: true description: Today's profit tracking properties: start: type: number example: 1705305600000 end: type: number example: 1705391999999 totalToday: type: number example: 45.2 totalTodayUsd: type: number example: 45.2 statusReason: type: string nullable: true description: Reason for current status example: null previousStatus: type: string enum: - open - closed - range - error - archive - monitoring nullable: true description: Previous bot status example: null currentBalances: type: array nullable: true description: Current asset balances items: type: object properties: key: type: string description: Asset symbol example: BTC value: type: number description: Initial balance of the asset example: 0.1 initialBalances: type: array nullable: true description: Initial asset balances when bot started items: type: object properties: key: type: string description: Asset symbol example: BTC value: type: number description: Initial balance of the asset example: 0.1 usage: type: object nullable: true description: Bot usage properties: current: type: object description: Current usage properties: base: type: number description: Current base asset usage example: 0.05 quote: type: number description: Current quote asset usage example: 2500 max: type: object description: Maximum usage properties: base: type: number description: Maximum base asset usage example: 0.1 quote: type: number description: Maximum quote asset usage example: 5000 userId: type: string description: User ID who owns the bot example: 123456789 workingShift: type: array items: type: object properties: start: type: number description: Shift start timestamp example: 1705305600000 end: type: number description: Shift end timestamp example: 1705391999999 assets: type: object nullable: true description: Asset-specific information properties: used: type: array description: Assets currently used in active deals items: type: object properties: key: type: string description: Asset symbol example: BTC value: type: number description: Amount of the asset used in active deals example: 0.05 required: type: array description: Assets required for next DCA orders items: type: object properties: key: type: string description: Asset symbol example: USDT value: type: number description: Amount of the asset required for next DCA orders example: 2500 DCABotListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of DCA bots items: $ref: '#/components/schemas/DCABotExtended' meta: $ref: '#/components/schemas/ResponseMeta' DCABotMinimal: type: object description: Minimal DCA bot representation properties: _id: type: string description: Internal MongoDB ID example: 507f1f77bcf86cd799439011 uuid: type: string format: uuid description: Unique bot identifier example: 550e8400-e29b-41d4-a716-446655440000 settings: type: object properties: name: type: string description: Bot name example: BTC Long DCA status: type: string enum: - open - closed - range - error - archive - monitoring description: Bot operational status example: open exchange: type: string description: Exchange code example: binance exchangeUUID: type: string format: uuid description: Exchange connection UUID example: 650e8400-e29b-41d4-a716-446655440001 paperContext: type: boolean nullable: true description: Paper trading context ID (null for real trading) example: false DCABotSettings: description: DCABotSettings configuration allOf: - $ref: '#/components/schemas/BaseSettings' - type: object properties: skipBalanceCheck: type: boolean description: Skip balance verification example: false dcaCondition: type: string description: Condition for DCA orders enum: - percentage - indicators - custom - dynamicAr example: percentage dcaVolumeBaseOn: type: string description: How DCA volume is calculated enum: - scale - change example: scale dcaVolumeRequiredChange: type: string description: Required change for volume adjustment example: '10' dcaVolumeMaxValue: type: string description: Maximum volume value example: '1000' dcaVolumeRequiredChangeRef: type: string description: Reference for volume change (TP or average) enum: - tp - avg example: tp baseSlOn: type: string description: Stop loss based on start or average price enum: - start - avg example: avg dcaCustom: type: array description: Custom DCA configuration array items: $ref: '#/components/schemas/DCACustom' example: [] strategy: type: string description: Trading strategy direction (long or short) enum: - LONG - SHORT example: LONG baseOrderSize: type: string description: Size of the initial base order example: '100' baseOrderPrice: type: string description: Price for the base order example: '50000' useLimitPrice: type: boolean description: Use limit price for orders example: false startOrderType: type: string description: Order type for opening position enum: - LIMIT - MARKET example: MARKET startCondition: type: string description: Condition to start a new deal enum: - ASAP - Manual - TradingviewSignals - Timer - TechnicalIndicators example: ASAP tpPerc: type: string description: Take profit percentage example: '2.5' slPerc: type: string description: Stop loss percentage example: '1.5' orderSize: type: string description: Size of each order example: '100' step: type: string description: Price deviation % for next DCA order example: '1.5' ordersCount: type: number description: Maximum number of DCA orders example: 5 activeOrdersCount: type: number description: Number of active orders to maintain example: 3 volumeScale: type: string description: Volume multiplier for each DCA order example: '1.5' stepScale: type: string description: Step multiplier for each DCA order example: '1.2' minimumDeviation: type: string description: Minimum price deviation to trigger DCA example: '0.5' useTp: type: boolean description: Enable take profit example: true useSl: type: boolean description: Enable stop loss example: true useSmartOrders: type: boolean description: Enable smart order execution example: false minOpenDeal: type: string description: Minimum price to open deals example: '1' maxOpenDeal: type: string description: Maximum price to open deals example: '5' useDca: type: boolean description: Enable Dollar Cost Averaging example: true hodlDay: type: string description: Days between opening new deal example: '7' hodlAt: type: string description: Time to open new deal example: '23:59' hodlHourly: type: boolean description: Hold on hourly basis example: false hodlNextBuy: type: number description: Next buy time in hours example: 24 maxNumberOfOpenDeals: type: string description: Maximum concurrent open deals example: '3' indicators: type: array description: Array of technical indicators items: $ref: '#/components/schemas/SettingsIndicators' example: [] indicatorGroups: type: array description: Groups of indicator conditions items: $ref: '#/components/schemas/SettingsIndicatorGroup' example: [] type: type: string description: Bot or indicator type enum: - regular - terminal - trigger example: regular orderSizeType: type: string description: Order reference enum: - base - quote - percTotal - percFree - usd example: quote limitTimeout: type: string description: Timeout for limit orders (seconds) example: '300' useLimitTimeout: type: boolean description: Enable limit order timeout example: false notUseLimitReposition: type: boolean description: Disable limit order repositioning example: false cooldownAfterDealStart: type: boolean description: Enable cooldown after deal starts example: false cooldownAfterDealStartUnits: type: string description: Time units for cooldown enum: - seconds - minutes - hours - days example: minutes cooldownAfterDealStartInterval: type: number description: Cooldown interval value example: 60 cooldownAfterDealStartOption: type: string description: Apply cooldown per symbol or bot enum: - symbol - bot example: symbol cooldownAfterDealStop: type: boolean description: Enable cooldown after deal stops example: false cooldownAfterDealStopUnits: type: string description: Time units for stop cooldown enum: - seconds - minutes - hours - days example: minutes cooldownAfterDealStopInterval: type: number description: Stop cooldown interval example: 30 cooldownAfterDealStopOption: type: string description: Apply stop cooldown per symbol or bot enum: - symbol - bot example: bot moveSL: type: boolean description: Enable moving stop loss example: false moveSLTrigger: type: string description: Trigger value for moving SL example: '2.0' moveSLValue: type: string description: New SL value when triggered example: '0.5' moveSLForAll: type: boolean description: Apply moving SL to all orders example: false trailingSl: type: boolean description: Enable trailing stop loss example: false trailingTp: type: boolean description: Enable trailing take profit example: false trailingTpPerc: type: string description: Trailing take profit percentage example: '1.5' useCloseAfterX: type: boolean description: Enable close after X feature example: false useCloseAfterXwin: type: boolean description: Close after X wins example: false closeAfterXwin: type: string description: Number of wins before closing example: '5' useCloseAfterXloss: type: boolean description: Close after X losses example: false closeAfterXloss: type: string description: Number of losses before closing example: '3' useCloseAfterXprofit: type: boolean description: Close after reaching profit example: false closeAfterXprofitValue: type: string description: Profit value to trigger close example: '1000' closeAfterXprofitCond: type: string description: Condition for profit close enum: - cd - cu - gt - lt example: gt closeAfterX: type: string description: Close after X value example: '10' useCloseAfterXopen: type: boolean description: Close after X open deals example: false closeAfterXopen: type: string description: Number of open deals before closing example: '10' pair: type: array description: Trading pair symbol items: type: string example: BTC/USDT useMulti: type: boolean description: Enable multiple pairs trading example: false maxDealsPerPair: type: string description: Max deals per trading pair example: '2' ignoreStartDeals: type: boolean description: Ignore deals in start condition check example: false comboTpBase: type: string description: Base for combo TP calculation enum: - full - filled example: full botStart: type: string description: How the bot is started enum: - manual - webhook - indicators - price example: manual useBotController: type: boolean description: Enable bot controller example: false stopType: type: string description: How to stop the bot enum: - leave - cancel - closeByLimit - closeByMarket example: cancel stopStatus: type: string description: Bot status for stopping enum: - closed example: monitoring dealCloseCondition: type: string description: Condition for closing deal enum: - tp - techInd - manual - webhook - dynamicAr example: tp dealCloseConditionSL: type: string description: Condition for SL close enum: - tp - techInd - manual - webhook - dynamicAr example: tp useMinTP: type: boolean description: Use minimum take profit example: false minTp: type: string description: Minimum take profit value example: '1.0' closeDealType: type: string description: Type of deal close action enum: - leave - cancel - closeByLimit - closeByMarket example: closeByLimit closeOrderType: type: string description: Order type for closing position enum: - LIMIT - MARKET example: LIMIT terminalDealType: type: string description: Terminal deal handling type enum: - simple - smart - import example: smart useMultiTp: type: boolean description: Enable multiple take profit levels example: false multiTp: type: array description: Array of take profit targets items: $ref: '#/components/schemas/MultiTP' example: [] useMultiSl: type: boolean description: Enable multiple stop loss levels example: false pairPrioritization: type: string description: How pairs are prioritized enum: - alphabetical - random example: alphabetical multiSl: type: array description: Array of stop loss targets items: $ref: '#/components/schemas/MultiTP' example: [] marginType: type: string description: Margin type for futures enum: - inherit - cross - isolated example: cross leverage: type: number description: Leverage multiplier example: 10 futures: type: boolean description: Enable futures trading example: false importFrom: type: string description: Import settings from bot ID example: bot-123 gridLevel: type: string description: Current grid level example: '5' useVolumeFilter: type: boolean description: Filter pairs by volume example: false useRelativeVolumeFilter: type: boolean description: Filter by relative volume example: false volumeTop: type: string description: Top volume threshold example: '100' relativeVolumeTop: type: string description: Relative volume threshold example: '50' volumeValue: type: string description: Volume filter value enum: - top25 - top100 - top200 - custom example: top100 relativeVolumeValue: type: string description: Relative volume filter value enum: - top25 - top100 - top200 - custom example: top100 useFixedTPPrices: type: boolean description: Use fixed TP prices example: false useFixedSLPrices: type: boolean description: Use fixed SL prices example: false fixedTpPrice: type: string description: Fixed take profit price example: '55000' fixedSlPrice: type: string description: Fixed stop loss price example: '48000' baseStep: type: string description: Base step for grid example: '1.0' baseGridLevels: type: string description: Base number of grid levels example: '10' useActiveMinigrids: type: boolean description: Enable active minigrids example: false comboActiveMinigrids: type: string description: Number of active minigrids example: '3' comboSlLimit: type: boolean description: Use limit orders for combo SL example: false comboTpLimit: type: boolean description: Use limit orders for combo TP example: false closeByTimer: type: boolean description: Enable close by timer example: false closeByTimerValue: type: number description: Time value before closing example: 24 closeByTimerUnits: type: string description: Time units for timer enum: - seconds - minutes - hours - days example: hours feeOrder: type: boolean description: Include fees in order calculation example: true maxDealsPerHigherTimeframe: type: string description: Max deals per timeframe example: '5' useMaxDealsPerHigherTimeframe: type: boolean description: Enable max deals per timeframe example: false remainderFullAmount: type: boolean description: Use full amount for remainder example: false autoRebalancing: type: boolean description: Enable automatic rebalancing example: false adaptiveClose: type: boolean description: Use adaptive close strategy example: false useStaticPriceFilter: type: boolean description: Enable static price filter example: false useCooldown: type: boolean description: Enable cooldown feature example: false useVolumeFilterAll: type: boolean description: Apply volume filter to all pairs example: false useDynamicPriceFilter: type: boolean description: Enable dynamic price filter example: false dynamicPriceFilterDeviation: type: string description: Deviation for dynamic price filter example: '5.0' dynamicPriceFilterOverValue: type: string description: Over value for price filter example: '10' dynamicPriceFilterUnderValue: type: string description: Under value for price filter example: '10' dynamicPriceFilterPriceType: type: string description: Price type for filter (avg/entry) enum: - avg - entry example: avg dynamicPriceFilterDirection: type: string description: Filter direction enum: - over - under - overAndUnder example: overAndUnder useRiskReward: type: boolean description: Enable risk/reward ratio example: false rrSlType: type: string description: Type of risk/reward stop loss enum: - fixed - indicator example: fixed rrSlFixedValue: type: string description: Fixed SL value for risk/reward example: '2.0' riskSlType: type: string description: Risk stop loss type enum: - perc - fixed example: perc riskSlAmountPerc: type: string description: Risk amount as percentage example: '2.0' riskSlAmountValue: type: string description: Risk amount value example: '100' riskUseTpRatio: type: boolean description: Use TP ratio in risk management example: false riskTpRatio: type: string description: Take profit ratio example: '2.0' riskMinPositionSize: type: string description: Minimum position size example: '50' riskMaxPositionSize: type: string description: Maximum position size example: '5000' dynamicArLockValue: type: boolean description: Lock dynamic AR value example: false comboUseSmartGrids: type: boolean description: Enable smart grids for combo bot example: false comboSmartGridsCount: type: string description: Number of smart grids example: '5' riskMaxSl: type: string description: Maximum stop loss example: '5.0' riskMinSl: type: string description: Minimum stop loss example: '0.5' scaleDcaType: type: string description: Type of DCA scaling enum: - percentage - atr - adr example: percentage startDealLogic: type: string description: Logic for start deal conditions (AND/OR) enum: - and - or example: and stopDealLogic: type: string description: Logic for stop deal conditions enum: - and - or example: or stopDealSlLogic: type: string description: Logic for stop loss conditions enum: - and - or example: and stopBotLogic: type: string description: Logic for stop bot conditions enum: - and - or example: or useRiskReduction: type: boolean description: Enable risk reduction example: false riskReductionValue: type: string description: Risk reduction percentage example: '10' useReinvest: type: boolean description: Enable profit reinvestment example: false reinvestValue: type: string description: Percentage of profit to reinvest example: '50' startBotPriceCondition: type: string description: Price condition to start bot enum: - cd - cu - gt - lt example: gt startBotPriceValue: type: string description: Price value for bot start example: '50000' stopBotPriceCondition: type: string description: Price condition to stop bot enum: - cd - cu - gt - lt example: lt stopBotPriceValue: type: string description: Price value for bot stop example: '45000' startBotLogic: type: string description: Logic for start bot conditions enum: - and - or example: and botActualStart: type: string description: Actual trigger for bot start enum: - manual - webhook - indicators - price example: indicators useNoOverlapDeals: type: boolean description: Prevent overlapping deals example: false useSeparateMaxDealsOverAndUnder: type: boolean description: Separate limits for over/under deals example: false maxDealsOver: type: string description: Max deals above entry example: '3' maxDealsUnder: type: string description: Max deals below entry example: '5' useSeparateMaxDealsOverAndUnderPerSymbol: type: boolean description: Per-symbol over/under limits example: false maxDealsOverPerSymbol: type: string description: Max over deals per symbol example: '2' maxDealsUnderPerSymbol: type: string description: Max under deals per symbol example: '3' dcaByMarket: type: boolean description: Execute DCA orders at market price example: false DCABotStandard: allOf: - $ref: '#/components/schemas/DCABotMinimal' - type: object description: Standard DCA bot representation with commonly used fields properties: settings: type: object properties: pair: type: array description: Trading pairs items: type: string example: - BTC_USDT profitCurrency: type: string enum: - base - quote description: Profit currency example: quote profit: type: object description: Bot profit statistics properties: total: type: number description: Total profit in profit currency example: 0.025 totalUsd: type: number description: Total profit in USD example: 1250.5 deals: type: object description: Deal statistics properties: all: type: integer description: Total number of deals example: 42 active: type: integer description: Number of active deals example: 3 created: type: string format: date-time description: Bot creation timestamp example: '2024-01-15T10:30:00Z' updated: type: string format: date-time description: Last update timestamp example: '2024-01-20T14:22:33Z' DCACustom: type: object properties: step: type: string description: Price deviation % for next DCA order example: '1.5' size: type: string description: Custom order size example: '150' uuid: type: string description: Unique identifier example: 123e4567-e89b-12d3-a456-426614174000 description: DCACustom configuration DCADealExtended: allOf: - $ref: '#/components/schemas/DCADealStandard' - type: object properties: settings: type: object description: Deal-specific settings properties: baseOrderSize: type: string example: '100' safetyOrderSize: type: string example: '100' maxSafetyTradesCount: type: integer example: 5 initialBalances: type: object description: Initial asset balances additionalProperties: type: number example: BTC: 0.01 USDT: 1000 currentBalances: type: object description: Current asset balances additionalProperties: type: number example: BTC: 0.0118 USDT: 575 feePaid: type: number description: Total fees paid example: 2.5 usage: type: object description: Resource usage stats stats: type: object description: Deal statistics strategy: type: object description: Strategy information DCADealMinimal: type: object description: Minimal DCA deal representation properties: _id: type: string example: 507f1f77bcf86cd799439012 botId: type: string description: Parent bot UUID example: 550e8400-e29b-41d4-a716-446655440000 status: type: string enum: - closed - open - start - error - canceled description: Deal status example: open symbol: type: object properties: symbol: type: string example: BTC_USDT profit: type: object properties: total: type: number description: Total profit in base currency example: 0.0015 totalUsd: type: number description: Total profit in USD example: 75 created: type: number description: Deal creation timestamp example: 1705737300000 DCADealStandard: allOf: - $ref: '#/components/schemas/DCADealMinimal' - type: object properties: exchange: type: string example: binance exchangeUUID: type: string format: uuid example: 650e8400-e29b-41d4-a716-446655440001 paperContext: type: boolean nullable: true example: false avgPrice: type: string description: Average entry price example: '42350.50' lastPrice: type: string description: Current market price example: '43120.00' levels: type: object description: Safety order levels properties: all: type: integer description: Total levels configured example: 5 complete: type: integer description: Completed levels example: 2 cost: type: number description: Total investment example: 500 value: type: number description: Current position value example: 575 updated: type: number description: Last update timestamp example: 1705823400000 closed: type: number nullable: true description: Deal close timestamp (null if active) example: null DcaBacktestRequest: type: object required: - payload - symbols properties: payload: type: object description: DCA backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/DCABacktestPayload' symbols: type: array description: Array of trading symbols for backtest items: $ref: '#/components/schemas/BacktestSymbol' DealListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of deals (DCA or Combo) items: $ref: '#/components/schemas/DCADealExtended' meta: $ref: '#/components/schemas/ResponseMeta' ErrorResponse: type: object required: - status - reason properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string description: Error description examples: - Invalid fields parameter - Bot not found - Unauthorized ExchangeGeneralListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of exchanges items: type: object properties: code: type: string description: Exchange code example: binance market: type: string description: Exchange market example: spot type: type: string description: Futures type example: linear ExchangeListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of exchanges items: $ref: '#/components/schemas/ExchangeStandard' ExchangeMinimal: type: object description: Minimal exchange representation required: - code - market - id - name properties: code: type: string description: Exchange code example: binance market: type: string description: Market type enum: - spot - futures example: spot id: type: string description: Exchange connection ID example: 650e8400-e29b-41d4-a716-446655440001 name: type: string description: Exchange display name example: Binance Main ExchangeStandard: allOf: - $ref: '#/components/schemas/ExchangeMinimal' - type: object properties: type: type: string description: Connection type enum: - real - paper example: real FieldDefinition: type: object description: > Describes a single field on a bot settings or indicator object. `type` is the runtime JS type; `validators` are the constraint labels; `enum` lists allowed values when type = "enum". required: - name - type - required - validators properties: name: type: string example: tpPerc type: type: string enum: - string - number - numberInString - boolean - enum - array - object - Date example: numberInString required: type: boolean example: false validators: type: array items: type: string example: - mustBeString - mustBeValidNumber - mustBePositive enum: type: array items: type: string description: Allowed values, only present when type = "enum" itemType: type: string description: Element type when type = "array" min: type: number max: type: number maxPrecision: type: number maxLength: type: number default: description: Default value used when field is omitted note: type: string description: Extra human-readable usage guidance example: description: Representative example value example: '2.5' GlobalVariable: type: object description: Global variable required: - _id - name - type - value - userId properties: _id: type: string description: Global variable ID example: 650e8400-e29b-41d4-a716-446655440001 name: type: string description: Variable name example: myVariable type: type: string description: Variable type enum: - text - int - float example: text value: type: string description: Variable value example: '100' userId: type: string description: User ID who owns this variable example: 650e8400-e29b-41d4-a716-446655440002 botAmount: type: number description: Number of bots using this variable example: 5 createdAt: type: string format: date-time description: Creation timestamp example: '2024-01-01T00:00:00Z' updatedAt: type: string format: date-time description: Last update timestamp example: '2024-01-01T00:00:00Z' GlobalVariableListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of global variables items: $ref: '#/components/schemas/GlobalVariable' meta: $ref: '#/components/schemas/ResponseMeta' GridBacktestRequest: type: object required: - payload - symbols properties: payload: type: object description: Grid backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/GridBacktestPayload' symbols: type: array description: Array of trading symbols for backtest items: $ref: '#/components/schemas/BacktestSymbol' GridBotExtended: allOf: - $ref: '#/components/schemas/GridBotStandard' - type: object properties: settings: $ref: '#/components/schemas/BotSettings' initialPrice: type: number nullable: true description: Initial price when bot started example: 32500 initialPriceFrom: type: string enum: - swap - user - start nullable: true description: Source of initial price example: swap initialPriceStart: type: number nullable: true description: Initial start price example: null initialPriceStartFrom: type: string enum: - swap - user - start nullable: true description: Source of initial start price example: swap transactionsCount: type: object nullable: true description: Transaction counters properties: buy: type: integer example: 15 sell: type: integer example: 13 statusReason: type: string nullable: true example: null GridBotListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of Grid bots items: $ref: '#/components/schemas/GridBotExtended' meta: $ref: '#/components/schemas/ResponseMeta' GridBotMinimal: type: object description: Minimal Grid bot representation properties: _id: type: string example: 507f1f77bcf86cd799439011 uuid: type: string format: uuid example: 550e8400-e29b-41d4-a716-446655440000 settings: type: object properties: name: type: string example: BTC Grid 30k-35k status: type: string enum: - open - closed - range - error - archive - monitoring example: open exchange: type: string example: binance exchangeUUID: type: string format: uuid example: 650e8400-e29b-41d4-a716-446655440001 paperContext: type: boolean nullable: true example: false GridBotStandard: allOf: - $ref: '#/components/schemas/GridBotMinimal' - type: object properties: settings: type: object properties: symbol: type: string description: Trading symbol example: BTCUSDT profit: type: object properties: total: type: number example: 0.15 totalUsd: type: number example: 4500 levels: type: object description: Grid level statistics properties: active: type: object properties: buy: type: integer example: 4 sell: type: integer example: 4 all: type: object properties: buy: type: integer example: 5 sell: type: integer example: 5 created: type: number description: Creation timestamp example: 1705305600000 updated: type: number description: Last update timestamp example: 1705391999999 IndicatorDefinition: allOf: - $ref: '#/components/schemas/IndicatorSummary' - type: object required: - coreFields - typeSpecificFields - example - groupDefinition properties: coreFields: type: array description: Fields required for every indicator regardless of type items: $ref: '#/components/schemas/FieldDefinition' typeSpecificFields: type: array description: Additional fields for this specific indicator type items: $ref: '#/components/schemas/FieldDefinition' example: type: object description: Minimal valid indicator object for this type groupDefinition: $ref: '#/components/schemas/IndicatorGroupDefinition' IndicatorGroupDefinition: type: object required: - description - rules - fields description: >- Documents the indicatorGroups mechanism. Every indicator must reference a group via its groupId field. The group object lives in the settings.indicatorGroups array and ties one or more indicators together under a shared action+section with AND/OR logic. properties: description: type: string description: >- Plain-English explanation of how groups work and why they are required. rules: type: array description: >- Validation rules that must hold between each indicator and its group. An AI agent must follow all of these when constructing bot settings. items: type: string example: - >- Every indicator must have a non-empty groupId that equals the id of an entry in settings.indicatorGroups. - >- A group's action must exactly equal the indicator's indicatorAction. - >- A group's section must exactly equal the indicator's section (or both must be absent/undefined). - >- Never mix indicators with different indicatorAction or section values in the same group. - >- Indicators within a group are combined using the group's logic field ('and' or 'or'). - Multiple groups for the same action+section are ANDed together. fields: type: array description: >- Field definitions for a single IndicatorGroup object in settings.indicatorGroups. items: $ref: '#/components/schemas/FieldDefinition' IndicatorSummary: type: object required: - type - name - supportedActions properties: type: type: string example: RSI name: type: string example: Relative Strength Index (RSI) description: type: string supportedActions: type: array items: type: string example: - startDeal - closeDeal - startDca - stopBot - startBot supportedSections: type: array items: type: string supportedIntervals: type: array description: >- Only present when the `?exchange=` query parameter is supplied. Lists the candlestick intervals available on that exchange. items: type: string example: - 1m - 5m - 15m - 30m - 1h - 4h - 1d - 1w MultiTP: type: object properties: target: type: string description: Target profit/loss percentage example: '2.5' amount: type: string description: Amount to close at target example: '50' uuid: type: string description: Unique identifier example: 123e4567-e89b-12d3-a456-426614174000 fixed: type: string description: Fixed price target example: '55000' description: MultiTP configuration ResponseMeta: type: object required: - page - total - count - onPage - fields properties: page: type: integer description: Current page number (1-based) example: 1 total: type: integer description: Total number of items matching query example: 150 count: type: integer description: Total items in database example: 150 onPage: type: integer description: Number of items on current page example: 10 fields: type: array description: List of fields included in response items: type: string example: - _id - uuid - settings.name - status - exchange ScreenerExtended: allOf: - $ref: '#/components/schemas/ScreenerStandard' - type: object properties: priceChangePercentage30d: type: number description: 30d price change percentage example: 25.5 priceChangePercentage1y: type: number description: 1 year price change percentage example: 125.8 atlChangePercentage: type: number description: Change from all-time low percentage example: 45000 athChangePercentage: type: number description: Change from all-time high percentage example: -35.5 volatility3d: type: number description: 3 day volatility example: 0.035 volatility7d: type: number description: 7 day volatility example: 0.045 exchanges: type: array description: List of exchanges trading this coin items: type: string example: - binance - coinbase - kraken sparkline: type: array description: Price sparkline data (7 days) items: type: number example: - 42000 - 42500 - 43000 - 42800 - 43250 ScreenerListResponse: allOf: - $ref: '#/components/schemas/APIResponse' - type: object required: - meta properties: data: type: array description: Array of screener coins items: $ref: '#/components/schemas/ScreenerExtended' meta: $ref: '#/components/schemas/ResponseMeta' ScreenerMinimal: type: object description: Minimal screener coin representation required: - symbol - name - currentPrice - priceChangePercentage24h - totalVolume - marketCap - marketCapRank properties: symbol: type: string description: Coin symbol example: BTC name: type: string description: Coin full name example: Bitcoin currentPrice: type: number description: Current price in USD example: 43250.5 priceChangePercentage24h: type: number description: 24h price change percentage example: 2.5 totalVolume: type: number description: 24h trading volume example: 28500000000 marketCap: type: number description: Market capitalization example: 850000000000 marketCapRank: type: integer description: Market cap rank example: 1 ScreenerStandard: allOf: - $ref: '#/components/schemas/ScreenerMinimal' - type: object properties: priceChangePercentage1h: type: number description: 1h price change percentage example: 0.5 priceChangePercentage7d: type: number description: 7d price change percentage example: 8.2 volumeChange24h: type: number description: 24h volume change percentage example: 15.3 marketCapChangePercentage24h: type: number description: 24h market cap change percentage example: 2.8 volatility1d: type: number description: 1 day volatility metric example: 0.025 liquidityScore: type: number description: Liquidity score (0-100) example: 95 category: type: string description: Coin category example: Layer 1 SectionDefinition: type: object required: - id - name - description - fields properties: id: type: string example: take_profit name: type: string example: Take Profit description: type: string fields: type: array items: $ref: '#/components/schemas/FieldDefinition' SectionSummary: type: object required: - id - name - description - fieldCount properties: id: type: string example: take_profit name: type: string example: Take Profit description: type: string fieldCount: type: integer description: Number of fields in this section example: 12 ServerSideBacktestPayload: oneOf: - type: object description: DCA or Combo bot backtest payload required: - type - data - config properties: type: type: string enum: - dca - combo description: Bot type for backtest data: $ref: '#/components/schemas/BacktestDCAConfig' - type: object description: Grid bot backtest payload required: - type - data - config properties: type: type: string enum: - grid description: Bot type for backtest data: $ref: '#/components/schemas/BacktestGridConfig' config: type: object description: Backtest configuration settings properties: periodName: type: string description: Name for the backtest period example: Q1 2024 SettingsIndicatorGroup: type: object properties: id: type: string description: Group or item identifier example: group-1 logic: type: string description: Logic operator (AND/OR) enum: - and - or example: and action: type: string description: Action to trigger enum: - startDeal - closeDeal - startDca - stopBot - riskReward - startBot example: startDeal section: type: string description: Settings section (tp/sl/dca/controller) enum: - tp - sl - dca - controller example: sl description: SettingsIndicatorGroup configuration SettingsIndicators: type: object properties: type: type: string description: Bot or indicator type enum: - RSI - ADX - BBW - BB - MACD - Stoch - CCI - AO - StochRSI - WR - BullBear - UO - IC - TV - MA - SR - QFL - MFI - PSAR - VO - MOM - BBWP - ECD - XO - MAR - BBPB - DIV - ST - PC - ATR - PP - ADR - ATH - KC - KCPB - UNPNL - DC - OBFVG - SESSION - LW example: regular indicatorLength: type: number description: Indicator period length example: 14 indicatorValue: type: string description: Indicator value threshold example: '70' indicatorCondition: type: string description: Comparison condition enum: - cd - cu - gt - lt example: gt indicatorInterval: type: string description: Chart timeframe enum: - 1m - 3m - 5m - 15m - 30m - 1h - 2h - 4h - 8h - 1d - 1w example: oneH groupId: type: string description: Indicator group ID example: group-1 uuid: type: string description: Unique identifier example: 123e4567-e89b-12d3-a456-426614174000 signal: type: string description: Trading signal type enum: - strongBuy - strongSell - buy - sell - bothBuy - bothSell example: strongBuy condition: type: string description: Check condition timing enum: - every - entry example: entry checkLevel: type: number description: Level to check indicator example: 1 maType: type: string description: Moving average type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: ema maCrossingValue: type: string description: MA crossing reference enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: sma maCrossingLength: type: number description: Crossing MA length example: 50 maCrossingInterval: type: string description: Crossing MA timeframe enum: - 1m - 3m - 5m - 15m - 30m - 1h - 2h - 4h - 8h - 1d - 1w example: 4h maUUID: type: string description: MA indicator UUID reference example: '123e4567' bbCrossingValue: type: string description: Bollinger Band line to cross enum: - middle - upper - lower example: upper stochSmoothK: type: number description: Stochastic K smoothing example: 3 stochSmoothD: type: number description: Stochastic D smoothing example: 3 stochUpper: type: string description: Stochastic overbought level example: '80' stochLower: type: string description: Stochastic oversold level example: '20' stochRSI: type: number description: Stochastic RSI period example: 14 rsiValue: type: string description: RSI value (K or D line) enum: - k - d example: k rsiValue2: type: string description: Second RSI value enum: - k - d - custom example: d valueInsteadof: type: number description: Custom value instead of price example: 50000 leftBars: type: number description: Bars to check on left example: 5 rightBars: type: number description: Bars to check on right example: 5 srCrossingValue: type: string description: Support or resistance line enum: - support - resistance example: resistance basePeriods: type: number description: Base period for calculation example: 20 pumpPeriods: type: number description: Pump detection periods example: 5 pump: type: number description: Pump threshold value example: 10 interval: type: number description: Calculation interval example: 14 baseCrack: type: number description: Base crack threshold example: 5 indicatorAction: type: string description: Action triggered by indicator enum: - startDeal - closeDeal - startDca - stopBot - riskReward - startBot example: startDeal section: type: string description: Settings section (tp/sl/dca/controller) enum: - tp - sl - dca - controller example: sl psarStart: type: number description: Parabolic SAR start value example: 0.02 psarInc: type: number description: Parabolic SAR increment example: 0.02 psarMax: type: number description: Parabolic SAR maximum example: 0.2 stochRange: type: string description: Stochastic range to check enum: - upper - lower - both - none example: upper minPercFromLast: type: string description: Minimum % from last signal example: '1.0' orderSize: type: string description: Size of each order example: '100' keepConditionBars: type: string description: Bars to keep condition example: '3' voShort: type: number description: Volume oscillator short period example: 5 voLong: type: number description: Volume oscillator long period example: 10 uoFast: type: number description: Ultimate Oscillator fast period example: 7 uoMiddle: type: number description: Ultimate Oscillator middle period example: 14 uoSlow: type: number description: Ultimate Oscillator slow period example: 28 momSource: type: string description: Momentum source price example: close bbwpLookback: type: number description: BBWP lookback period example: 252 ecdTrigger: type: string description: ECD trigger type enum: - bearish - bullish - both example: bullish xOscillator2length: type: number description: Second oscillator length example: 14 xOscillator2Interval: type: string description: Second oscillator timeframe enum: - 1m - 3m - 5m - 15m - 30m - 1h - 2h - 4h - 8h - 1d - 1w example: 1h xOscillator2voLong: type: number description: Second oscillator long period example: 10 xOscillator2voShort: type: number description: Second oscillator short period example: 5 xoUUID: type: string description: Cross oscillator UUID example: '123e4567' mar1length: type: number description: First MA length for ratio example: 20 mar1type: type: string description: First MA type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: ema mar2length: type: number description: Second MA length for ratio example: 50 mar2type: type: string description: Second MA type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: sma bbwMult: type: number description: Bollinger Band width multiplier example: 2 bbwMa: type: string description: BB moving average type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: sma bbwMaLength: type: number description: BB MA length example: 20 macdFast: type: number description: MACD fast period example: 12 macdSlow: type: number description: MACD slow period example: 26 macdMaSource: type: string description: MACD MA source type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: ema macdMaSignal: type: string description: MACD signal line type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: ema divOscillators: type: array description: Oscillators for divergence items: type: object example: [] divType: type: string description: Divergence type enum: - Bullish - Bearish - Hidden Bullish - Hidden Bearish - Any Bullish - Any Bearish example: Bullish divMinCount: type: number description: Minimum divergence count example: 2 factor: type: number description: Supertrend multiplier factor example: 3 atrLength: type: number description: ATR period length example: 10 stCondition: type: string description: Supertrend condition enum: - up - down - upToDown - downToUp example: up pcUp: type: string description: Price change up threshold example: '5' pcDown: type: string description: Price change down threshold example: '5' pcCondition: type: string description: Price change direction enum: - UP - DOWN example: UP pcValue: type: string description: Price change value example: '10' ppHighLeft: type: number description: Pivot high left bars example: 10 ppHighRight: type: number description: Pivot high right bars example: 10 ppLowLeft: type: number description: Pivot low left bars example: 10 ppLowRight: type: number description: Pivot low right bars example: 10 ppMult: type: number description: Pivot point multiplier example: 1 ppValue: type: string description: Pivot point value type enum: - HH - HL - LH - LL - Any High - Any Low - SL - WL - SH - WH - anyL - anyH - BullM - BearM - SBullBoS - SBearBoS - SBullCHoCH - SBearCHoCH - IBullBoS - IBearBoS - IBullCHoCH - IBearCHoCH - IAnyBull - IAnyBear - SAnyBull - SAnyBear - BullAnyBoS - BearAnyBoS - BullAnyCHoCH - BearAnyCHoCH example: HH ppType: type: string description: Pivot point type enum: - Price Based - Event Based - Market Based example: Price Based riskAtrMult: type: string description: ATR multiplier for risk example: '2.0' dynamicArFactor: type: string description: Dynamic AR factor example: '1.5' athLookback: type: number description: All-time high lookback period example: 365 kcMa: type: string description: Keltner Channel MA type enum: - ema - sma - wma - price - dema - tema - vwma - hma - rma example: ema kcRange: type: string description: Keltner Channel range type enum: - ATR - TR - R example: ATR kcRangeLength: type: number description: Keltner Channel range length example: 20 unpnlValue: type: number description: Unrealized PnL threshold example: 100 unpnlCondition: type: string description: Unrealized PnL condition enum: - cd - cu - gt - lt example: gt dcValue: type: string description: Donchian Channel line enum: - basis - lower - upper example: upper obfvgValue: type: string description: Order block/FVG type enum: - bullish - bearish - any example: bullish obfvgRef: type: string description: Order block/FVG reference enum: - high - low - middle example: high sessionDays: type: array items: type: number example: null sessionRule: type: string enum: - in - out lwThreshold: type: string example: null lwMaxDuration: type: string example: null lwValue: type: string enum: - top - bottom - any lwCondition: type: string enum: - onStart - during description: SettingsIndicators configuration UpdateComboBotInput: type: object description: Input schema for updating Combo bot settings properties: name: type: string description: Bot name step: type: string description: Step percentage between DCA orders ordersCount: type: integer description: DCA orders count tpPerc: type: string description: Take profit percent slPerc: type: string description: Stop loss percent profitCurrency: type: string enum: - base - quote description: Profit currency orderSize: type: string description: DCA order qty of the deal. baseOrderSize: type: string description: Base order qty of the deal. baseStep: type: string description: Top price of base minigrid. baseGridLevels: type: string description: Base minigrid levels. gridLevel: type: string description: DCA minigrid levels. orderSizeType: type: string description: Currency reference enum: - base - quote - percFree - percTotal - usd startOrderType: type: string description: Currency reference enum: - limit - market useRiskReduction: type: boolean description: Use risk reduction. Requires riskReductionValue value riskReductionValue: type: string description: Risk reduction value in % useReinvest: type: boolean description: Use reinvest profit. Requires reinvestValue value reinvestValue: type: string description: Reinvest profit value in % skipBalanceCheck: type: boolean description: Skip balance check startCondition: type: string description: Start deal condition enum: - ASAP - Manual maxNumberOfOpenDeals: type: string description: Max number of open deals useStaticPriceFilter: type: boolean description: Use static price filter. Require minOpenDeal or maxOpenDeal minOpenDeal: type: string description: Minimum price for open deal maxOpenDeal: type: string description: Maximum price for open deal useDynamicPriceFilter: type: boolean description: >- Use dynamic price filter. Require dynamicPriceFilterDirection, dynamicPriceFilterOverValue or dynamicPriceFilterUnderValue or both, dynamicPriceFilterPriceType dynamicPriceFilterDirection: type: string description: >- Direction of the price filter. Over require dynamicPriceFilterOverValue field, under require dynamicPriceFilterUnderValue field, overAndUnder require both fields enum: - over - under - overAndUnder dynamicPriceFilterOverValue: type: string description: Over value dynamicPriceFilterUnderValue: type: string description: Over value dynamicPriceFilterPriceType: type: string description: Price sourse enum: - avg - entry useNoOverlapDeals: type: boolean description: Use no overlap deals in dynamic price filter useCooldown: type: boolean description: Use cooldown cooldownAfterDealStart: type: boolean description: >- Use cooldown after deal start. Require cooldownAfterDealStartInterval and cooldownAfterDealStartUnits cooldownAfterDealStartInterval: type: number description: Cooldown after deal start interval cooldownAfterDealStartUnits: type: string description: Cooldown after deal start units enum: - seconds - minutes - hours - days cooldownAfterDealStop: type: boolean description: >- Use cooldown after deal stop. Require cooldownAfterDealStopInterval and cooldownAfterDealStopUnits cooldownAfterDealStopInterval: type: number description: Cooldown after deal stop interval cooldownAfterDealStopUnits: type: string description: Cooldown after deal stop units enum: - seconds - minutes - hours - days useTp: type: boolean description: Use take profit useSl: type: boolean description: Use stop loss useDca: type: boolean description: Use DCA orders useSmartOrders: type: boolean description: Use smart orders activeOrdersCount: type: integer description: Active orders count useActiveMinigrids: type: boolean description: Use active minigrids. comboActiveMinigrids: type: string description: Active minigrids count. comboUseSmartGrids: type: boolean description: Use smart grids. comboSmartGridsCount: type: integer description: Smart grids count. volumeScale: type: string description: Volume scale of DCA orders stepScale: type: string description: Step scale of DCA orders comboTpBase: type: string description: Base SL on user DCA or max DCA. Default - filled. enum: - full - filled UpdateComboDealsInput: type: object properties: ordersCount: type: integer description: DCA orders count step: type: string description: Step percentage between DCA orders tpPerc: type: string description: Take profit percent slPerc: type: string description: Stop loss percent profitCurrency: type: string enum: - base - quote description: Profit currency avgPrice: type: number description: Average price of the deal orderSize: type: string description: DCA order qty of the deal useTp: type: boolean description: Use take profit useSl: type: boolean description: Use stop loss useDca: type: boolean description: Use DCA orders useSmartOrders: type: boolean description: Use smart orders activeOrdersCount: type: integer description: Active orders count volumeScale: type: string description: Volume scale of DCA orders stepScale: type: string description: Step scale of DCA orders dealCloseConditionSL: type: string description: Deal close options. For deal only possible option - tp enum: - tp useMultiSl: type: boolean description: Use multiple SL targets. multiSl array should be provided multiSl: type: array description: Multiple SL targets items: type: object description: Multiple SL target object properties: target: type: string description: Target level in % example: -10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target baseSlOn: type: string description: Base SL on. Default - avg enum: - start - avg trailingSl: type: boolean description: Use trailing SL. Cannot be checked with active moveSL or multiSl moveSL: type: boolean description: >- Use move SL. Cannot be checked with active trailingSl or multiSl. Require moveSLTrigger and moveSLValue moveSLTrigger: type: string description: Move SL trigger in % example: 10 moveSLValue: type: string description: Move SL value in % example: 5 dealCloseCondition: type: string description: Deal close options. For deal only possible option - tp enum: - tp closeByTimer: type: boolean description: Close deal by timer. Require closeByTimerValue and closeByTimerUnits closeByTimerValue: type: integer description: Close deal by timer value closeByTimerUnits: type: string description: Close deal by timer units enum: - seconds - minutes - hours - days useMultiTp: type: boolean description: Use multiple TP targets. multiTp array should be provided multiTp: type: array description: Multiple TP targets items: type: object description: Multiple TP target object properties: target: type: string description: Target level in % example: 10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target trailingTp: type: boolean description: >- Use trailing TP. Cannot be checked with active multiTp. Require trailingTpPerc trailingTpPerc: type: string description: Trailing take profit deviation on % example: 5 dcaCondition: type: string description: >- DCA Type. For deal available options - percentage, custom. Custom required dcaCustom array enum: - percentage - custom dcaCustom: type: array description: DCA custom objects items: type: object description: DCA custom object properties: step: type: string description: From previous order price in % example: 1 size: type: string description: Order amount in orderSizeType currency example: 1 uuid: type: string description: Unique Id of the level UpdateDCABotInput: type: object description: Input schema for updating DCA bot settings properties: pair: type: array description: Trading pairs. In the format {base}_{quote} items: type: string example: BTC_USDT name: type: string description: Bot name step: type: string description: Step percentage between DCA orders ordersCount: type: integer description: DCA orders count tpPerc: type: string description: Take profit percent slPerc: type: string description: Stop loss percent profitCurrency: type: string enum: - base - quote description: Profit currency orderSize: type: string description: DCA order qty of the deal. baseOrderSize: type: string description: Base order qty of the deal. orderSizeType: type: string description: Currency reference enum: - base - quote - percFree - percTotal - usd startOrderType: type: string description: Currency reference enum: - limit - market useRiskReduction: type: boolean description: Use risk reduction. Requires riskReductionValue value riskReductionValue: type: string description: Risk reduction value in % useReinvest: type: boolean description: Use reinvest profit. Requires reinvestValue value reinvestValue: type: string description: Reinvest profit value in % skipBalanceCheck: type: boolean description: Skip balance check startCondition: type: string description: Start deal condition enum: - ASAP - Manual maxNumberOfOpenDeals: type: string description: Max number of open deals useStaticPriceFilter: type: boolean description: Use static price filter. Require minOpenDeal or maxOpenDeal minOpenDeal: type: string description: Minimum price for open deal maxOpenDeal: type: string description: Maximum price for open deal useDynamicPriceFilter: type: boolean description: >- Use dynamic price filter. Require dynamicPriceFilterDirection, dynamicPriceFilterOverValue or dynamicPriceFilterUnderValue or both, dynamicPriceFilterPriceType dynamicPriceFilterDirection: type: string description: >- Direction of the price filter. Over require dynamicPriceFilterOverValue field, under require dynamicPriceFilterUnderValue field, overAndUnder require both fields enum: - over - under - overAndUnder dynamicPriceFilterOverValue: type: string description: Over value dynamicPriceFilterUnderValue: type: string description: Over value dynamicPriceFilterPriceType: type: string description: Price sourse enum: - avg - entry useNoOverlapDeals: type: boolean description: Use no overlap deals in dynamic price filter useCooldown: type: boolean description: Use cooldown cooldownAfterDealStart: type: boolean description: >- Use cooldown after deal start. Require cooldownAfterDealStartInterval and cooldownAfterDealStartUnits cooldownAfterDealStartInterval: type: number description: Cooldown after deal start interval cooldownAfterDealStartUnits: type: string description: Cooldown after deal start units enum: - seconds - minutes - hours - days cooldownAfterDealStop: type: boolean description: >- Use cooldown after deal stop. Require cooldownAfterDealStopInterval and cooldownAfterDealStopUnits cooldownAfterDealStopInterval: type: number description: Cooldown after deal stop interval cooldownAfterDealStopUnits: type: string description: Cooldown after deal stop units enum: - seconds - minutes - hours - days useTp: type: boolean description: Use take profit useSl: type: boolean description: Use stop loss useDca: type: boolean description: Use DCA orders useSmartOrders: type: boolean description: Use smart orders activeOrdersCount: type: integer description: Active orders count volumeScale: type: string description: Volume scale of DCA orders stepScale: type: string description: Step scale of DCA orders dealCloseConditionSL: type: string description: Deal close options. enum: - tp useMultiSl: type: boolean description: Use multiple SL targets. multiSl array should be provided. multiSl: type: array description: Multiple SL targets. items: type: object description: Multiple SL target object properties: target: type: string description: Target level in % example: -10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target baseSlOn: type: string description: Base SL on. Default - avg. enum: - start - avg trailingSl: type: boolean description: Use trailing SL. Cannot be checked with active moveSL or multiSl. moveSL: type: boolean description: >- Use move SL. Cannot be checked with active trailingSl or multiSl. Require moveSLTrigger and moveSLValue. moveSLTrigger: type: string description: Move SL trigger in %. example: 10 moveSLValue: type: string description: Move SL value in %. example: 5 dealCloseCondition: type: string description: Deal close options. For deal only possible option - tp. enum: - tp closeByTimer: type: boolean description: >- Close deal by timer. Require closeByTimerValue and closeByTimerUnits. closeByTimerValue: type: integer description: Close deal by timer value. closeByTimerUnits: type: string description: Close deal by timer units. enum: - seconds - minutes - hours - days useMultiTp: type: boolean description: Use multiple TP targets. multiTp array should be provided. multiTp: type: array description: Multiple TP targets. items: type: object description: Multiple TP target object properties: target: type: string description: Target level in % example: 10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target trailingTp: type: boolean description: >- Use trailing TP. Cannot be checked with active multiTp. Require trailingTpPerc. trailingTpPerc: type: string description: Trailing take profit deviation on %. example: 5 dcaCondition: type: string description: >- DCA Type. For deal available options - percentage, custom. Custom required dcaCustom array. enum: - percentage - custom dcaCustom: type: array description: DCA custom objects. items: type: object description: DCA custom object properties: step: type: string description: From previous order price in % example: 1 size: type: string description: Order amount in orderSizeType currency example: 1 uuid: type: string description: Unique Id of the level UpdateDCADealsInput: type: object properties: ordersCount: type: integer description: DCA orders count step: type: string description: Step percentage between DCA orders tpPerc: type: string description: Take profit percent slPerc: type: string description: Stop loss percent profitCurrency: type: string enum: - base - quote description: Profit currency avgPrice: type: number description: Average price of the deal orderSize: type: string description: DCA order qty of the deal useTp: type: boolean description: Use take profit useSl: type: boolean description: Use stop loss useDca: type: boolean description: Use DCA orders useSmartOrders: type: boolean description: Use smart orders activeOrdersCount: type: integer description: Active orders count volumeScale: type: string description: Volume scale of DCA orders stepScale: type: string description: Step scale of DCA orders dealCloseConditionSL: type: string description: Deal close options. For deal only possible option - tp enum: - tp useMultiSl: type: boolean description: Use multiple SL targets. multiSl array should be provided multiSl: type: array description: Multiple SL targets items: type: object description: Multiple SL target object properties: target: type: string description: Target level in % example: -10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target baseSlOn: type: string description: Base SL on. Default - avg enum: - start - avg trailingSl: type: boolean description: Use trailing SL. Cannot be checked with active moveSL or multiSl moveSL: type: boolean description: >- Use move SL. Cannot be checked with active trailingSl or multiSl. Require moveSLTrigger and moveSLValue moveSLTrigger: type: string description: Move SL trigger in % example: 10 moveSLValue: type: string description: Move SL value in % example: 5 dealCloseCondition: type: string description: Deal close options. For deal only possible option - tp enum: - tp closeByTimer: type: boolean description: Close deal by timer. Require closeByTimerValue and closeByTimerUnits closeByTimerValue: type: integer description: Close deal by timer value closeByTimerUnits: type: string description: Close deal by timer units enum: - seconds - minutes - hours - days useMultiTp: type: boolean description: Use multiple TP targets. multiTp array should be provided multiTp: type: array description: Multiple TP targets items: type: object description: Multiple TP target object properties: target: type: string description: Target level in % example: 10 amount: type: string description: Amount to close in % example: 50 uuid: type: string description: Unique Id of the target trailingTp: type: boolean description: >- Use trailing TP. Cannot be checked with active multiTp. Require trailingTpPerc trailingTpPerc: type: string description: Trailing take profit deviation on % example: 5 dcaCondition: type: string description: >- DCA Type. For deal available options - percentage, custom. Custom required dcaCustom array enum: - percentage - custom dcaCustom: type: array description: DCA custom objects items: type: object description: DCA custom object properties: step: type: string description: From previous order price in % example: 1 size: type: string description: Order amount in orderSizeType currency example: 1 uuid: type: string description: Unique Id of the level Agent: type: object properties: _id: type: string description: MongoDB ObjectId userId: type: string name: type: string role: type: string enum: - portfolio_analyst - risk_monitor - trade_executor - custom icon: type: string nullable: true roleId: type: string nullable: true description: ID of the AgentRolePreset this agent was created from description: type: string nullable: true instructions: type: string exchangeAccountIds: type: array items: type: string botIds: type: array items: type: string llm: type: object properties: provider: type: string enum: - openai - anthropic - gemini - groq model: type: string temperature: type: number nullable: true maxTokens: type: integer nullable: true scope: type: array items: type: string enum: - portfolio - bots - deals - backtest - all toolConfig: type: object properties: permissionLevel: type: string enum: - read - suggest - execute allowedTools: type: array items: type: string riskAppetite: type: string enum: - conservative - moderate - aggressive nullable: true responseLanguage: type: string nullable: true enabled: type: boolean threadId: type: string nullable: true created: type: string format: date-time updated: type: string format: date-time AgentRolePreset: type: object properties: _id: type: string role: type: string enum: - portfolio_analyst - risk_monitor - trade_executor - custom name: type: string description: type: string instructions: type: string icon: type: string nullable: true riskAppetite: type: string enum: - conservative - moderate - aggressive scope: type: array items: type: string enum: - portfolio - bots - deals - backtest - all toolConfig: type: object properties: permissionLevel: type: string enum: - read - suggest - execute allowedTools: type: array items: type: string isSystem: type: boolean description: True for built-in system presets enabled: type: boolean CreateAgentInput: type: object required: - name - role properties: roleId: type: string description: > Optional. ID of a predefined role preset to inherit instructions, scope, toolConfig, and riskAppetite from. Any explicitly supplied fields override the preset's values. name: type: string minLength: 1 maxLength: 100 role: type: string enum: - portfolio_analyst - risk_monitor - trade_executor - custom icon: type: string description: type: string maxLength: 500 instructions: type: string minLength: 10 description: >- Required when roleId is absent; overrides preset instructions when roleId is set. exchangeAccountIds: type: array items: type: string description: Exchange account IDs the agent can access. botIds: type: array items: type: string description: Specific bot IDs the agent operates on. scope: type: array minItems: 1 items: type: string enum: - portfolio - bots - deals - backtest - all description: Required when roleId is absent. toolConfig: type: object properties: permissionLevel: type: string enum: - read - suggest - execute allowedTools: type: array items: type: string description: Required when roleId is absent. riskAppetite: type: string enum: - conservative - moderate - aggressive responseLanguage: type: string default: en schedule: type: object nullable: true properties: enabled: type: boolean cron: type: string description: Cron expression prompt: type: string hitlTimeout: type: integer default: 300 description: Seconds to wait for HITL approval before timing out llmModel: type: string description: >- modelId of the LLM to use (must be in the available-for-agents list). Omit to use the platform default model. example: google/gemini-flash-1.5 UpdateAgentInput: type: object properties: name: type: string role: type: string enum: - portfolio_analyst - risk_monitor - trade_executor - custom icon: type: string description: type: string instructions: type: string exchangeAccountIds: type: array items: type: string botIds: type: array items: type: string scope: type: array items: type: string toolConfig: type: object properties: permissionLevel: type: string allowedTools: type: array items: type: string riskAppetite: type: string enum: - conservative - moderate - aggressive responseLanguage: type: string schedule: type: object nullable: true hitlTimeout: type: integer enabled: type: boolean llmModel: type: string description: >- modelId of the LLM to use (must be in the available-for-agents list). AgentLlmModel: type: object description: An AI model available for use by agents, with its credit pricing. properties: modelId: type: string description: >- Unique model identifier (used as `llmModel` in create/update requests) example: google/gemini-flash-1.5 name: type: string description: Human-readable display name example: Gemini Flash 1.5 creditsPerMillionInput: type: integer description: Credits charged per 1 million input (prompt) tokens example: 12 creditsPerMillionOutput: type: integer description: Credits charged per 1 million output (completion) tokens example: 36 isDefault: type: boolean description: >- True for the admin-designated default model. Pre-select this in the UI when no model has been chosen yet. AgentThread: type: object properties: _id: type: string agentId: type: string userId: type: string created: type: string format: date-time updated: type: string format: date-time AgentMessage: type: object properties: _id: type: string threadId: type: string agentId: type: string role: type: string enum: - user - agent - system - tool content: type: string source: type: string enum: - web - telegram - cron time: type: integer description: Unix timestamp ms toolName: type: string nullable: true runId: type: string nullable: true AgentRun: type: object properties: _id: type: string agentId: type: string userId: type: string threadId: type: string status: type: string enum: - pending - running - hitl_wait - completed - failed - cancelled - skipped startedAt: type: string format: date-time finishedAt: type: string format: date-time nullable: true inputTokens: type: integer outputTokens: type: integer totalTokens: type: integer source: type: string enum: - web - telegram - cron trigger: type: string nullable: true description: Cron expression or Telegram message that triggered the run creditsUsed: type: number error: type: string nullable: true toolCalls: type: array items: type: object properties: toolName: type: string toolInput: type: string description: JSON-encoded tool arguments toolOutput: type: string nullable: true status: type: string enum: - completed - error - hitl_approved - hitl_denied time: type: integer description: Unix timestamp ms AgentHitlRequest: type: object description: >- A Human-In-The-Loop approval request raised when an agent attempts a high-risk tool call. properties: _id: type: string description: MongoDB ObjectId runId: type: string agentId: type: string userId: type: string threadId: type: string toolName: type: string toolInput: type: object additionalProperties: true description: Arguments the agent passed to the tool toolCallId: type: string description: >- OpenAI tool_call_id — ties this HITL to the specific call in the assistant message description: type: string nullable: true riskLevel: type: string enum: - low - medium - high status: type: string enum: - pending - approved - denied - timeout expiresAt: type: string format: date-time resolvedAt: type: string format: date-time nullable: true ResolveHitlInput: type: object required: - decision properties: decision: type: string enum: - approved - denied description: Whether to approve or deny the pending HITL tool call RunRequest: type: object required: - prompt properties: prompt: type: string minLength: 1 description: The user message to send to the agent RunStreamUpdate: type: object description: Payload carried by `run_update` SSE events. properties: status: type: string enum: - pending - running - hitl_wait - completed - failed - cancelled - skipped inputTokens: type: integer outputTokens: type: integer totalTokens: type: integer error: type: string nullable: true hitlId: type: string nullable: true description: Present when status is hitl_wait — the pending HITL request ID AgentBacktestPair: type: object required: - exchange - symbol - baseAsset - quoteAsset - marketType - makerFee - takerFee properties: exchange: type: string symbol: type: string baseAsset: type: string quoteAsset: type: string marketType: type: string enum: - spot - futures coinm: type: boolean nullable: true description: Inverse / coin-margined futures contractSize: type: number nullable: true description: >- Contract size in QUOTE currency for inverse futures (e.g. 100 for Binance BTCUSD perp). Defaults to 1 — leave unset for spot/linear. makerFee: type: number takerFee: type: number AgentBacktestExchangeConfig: type: object required: - exchange - initialBalances properties: exchange: type: string initialBalances: type: object additionalProperties: type: number description: asset → quantity AgentBacktestOrder: type: object properties: id: type: string dealId: type: string exchange: type: string symbol: type: string baseAsset: type: string quoteAsset: type: string marketType: type: string enum: - spot - futures coinm: type: boolean nullable: true side: type: string enum: - buy - sell type: type: string enum: - market - limit price: type: number nullable: true qty: type: number notional: type: number nullable: true leverage: type: number nullable: true status: type: string enum: - open - filled - canceled createdAt: type: number filledAt: type: number nullable: true filledPrice: type: number nullable: true filledQty: type: number nullable: true AgentBacktestPosition: type: object properties: id: type: string exchange: type: string symbol: type: string baseAsset: type: string quoteAsset: type: string marketType: type: string enum: - spot - futures coinm: type: boolean nullable: true side: type: string enum: - long - short qty: type: number entryPrice: type: number leverage: type: number nullable: true marginUsed: type: number nullable: true unrealizedPnl: type: number nullable: true liquidationPrice: type: number nullable: true liquidated: type: boolean nullable: true openedAt: type: number AgentBacktestTrade: type: object properties: tradeId: type: string orderId: type: string dealId: type: string exchange: type: string symbol: type: string baseAsset: type: string quoteAsset: type: string marketType: type: string enum: - spot - futures coinm: type: boolean nullable: true side: type: string enum: - buy - sell qty: type: number price: type: number fee: type: number nullable: true pnl: type: number nullable: true leverage: type: number nullable: true time: type: number AgentBacktestEquityPoint: type: object properties: time: type: number equity: type: number AgentBacktest: type: object properties: _id: type: string agentId: type: string userId: type: string name: type: string status: type: string enum: - created - queued - configuring - paused - playing - finished startDate: type: string format: date-time endDate: type: string format: date-time nullable: true currentClock: type: string format: date-time interval: type: string speed: type: number startPrompt: type: string strategyNotes: type: string nullable: true minScheduleInterval: type: number nullable: true totalInputTokens: type: number nullable: true totalOutputTokens: type: number nullable: true totalCreditsUsed: type: number nullable: true cron: type: string nullable: true threadId: type: string exchanges: type: array items: $ref: '#/components/schemas/AgentBacktestExchangeConfig' pairs: type: array items: $ref: '#/components/schemas/AgentBacktestPair' balances: type: object description: exchange → asset → { free, locked } additionalProperties: type: object additionalProperties: type: object properties: free: type: number locked: type: number orders: type: array items: $ref: '#/components/schemas/AgentBacktestOrder' positions: type: array items: $ref: '#/components/schemas/AgentBacktestPosition' trades: type: array items: $ref: '#/components/schemas/AgentBacktestTrade' equityCurve: type: array items: $ref: '#/components/schemas/AgentBacktestEquityPoint' CreateAgentBacktestInput: type: object required: - name - startDate - interval - exchanges - pairs properties: name: type: string startDate: type: string format: date-time endDate: type: string format: date-time nullable: true interval: type: string speed: type: number startPrompt: type: string minScheduleInterval: type: number cron: type: string exchanges: type: array items: $ref: '#/components/schemas/AgentBacktestExchangeConfig' pairs: type: array items: $ref: '#/components/schemas/AgentBacktestPair' UpdateAgentBacktestInput: type: object properties: name: type: string startDate: type: string format: date-time endDate: type: string format: date-time interval: type: string speed: type: number startPrompt: type: string strategyNotes: type: string minScheduleInterval: type: number cron: type: string exchanges: type: array items: $ref: '#/components/schemas/AgentBacktestExchangeConfig' pairs: type: array items: $ref: '#/components/schemas/AgentBacktestPair' AgentBacktestResponse: type: object properties: status: type: string reason: type: string nullable: true data: type: object properties: result: $ref: '#/components/schemas/AgentBacktest' AgentBacktestListResponse: type: object properties: status: type: string reason: type: string nullable: true data: type: object properties: results: type: array items: $ref: '#/components/schemas/AgentBacktest' AgentBacktestStatusResponse: type: object properties: status: type: string reason: type: string nullable: true data: type: object properties: status: type: string enum: - created - queued - configuring - paused - playing - finished responses: BadRequest: description: Bad request - invalid parameters content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: 'Invalid fields parameter: unknown_field' Unauthorized: description: Unauthorized - missing or invalid authentication content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: Invalid signature Forbidden: description: Forbidden - insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' NotFound: description: Not found - the requested resource does not exist content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: Bot not found paths: /api/v2/backtest/combo/requests/{id}: get: summary: Get Combo Backtest Request by ID description: | Retrieve a single Combo backtest request by its MongoDB ObjectId. The request must belong to the authenticated user. tags: - Backtest operationId: getComboBacktestRequestById parameters: - name: id in: path required: true description: MongoDB ObjectId of the backtest request schema: type: string example: 69a04ceccf441b9c0d60dcd7 - $ref: '#/components/parameters/FieldsParam' responses: '200': description: Combo backtest request content: application/json: schema: $ref: '#/components/schemas/BacktestRequestSingleResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/combo/requests: get: summary: Get Combo Backtest Requests description: > Retrieve a paginated list of Combo backtest requests for the current user, sorted from newest to oldest (10 per page). Supports the same field selection as the DCA variant: use `backtest.*` field prefixes to include fields from the linked backtest result. tags: - Backtest operationId: getComboBacktestRequests parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' responses: '200': description: Paginated Combo backtest requests content: application/json: schema: $ref: '#/components/schemas/BacktestRequestListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/combo/details: get: summary: Get Combo Bot by ID description: | Retrieve a single Combo bot by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/bots/combo`. tags: - Bots - Combo operationId: getComboBotById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: botId in: query required: true description: Bot MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single Combo bot object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/ComboBot' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/bots/combo: get: summary: Get Combo Bots description: > Retrieve a list of Combo (Long/Short) bots with optional field selection. **Field Presets:** - `minimal`: _id, uuid, settings.name, status, exchange, exchangeUUID, paperContext - `standard`: minimal + settings.pair, profit.*, deals.*, createdAt, updatedAt - `extended`: standard + settings configuration, cost, workingTimeNumber, profitToday, dealsStatsForBot - `full`: All available fields tags: - Bots - Combo operationId: getComboBots parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by bot status schema: type: string enum: - open - closed - range - error - archive - monitoring example: open responses: '200': description: Successful response with Combo bots list content: application/json: schema: $ref: '#/components/schemas/ComboBotListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create Combo Bot description: | Create a new Combo (Long/Short) bot with specified settings. Requires write permission of API keys. tags: - Bots - Combo operationId: createComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateComboBotInput' example: pair: - BTC_USDT exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 vars: [] name: New Combo Bot strategy: LONG baseOrderSize: '500' orderSize: '500' orderSizeType: quote startOrderType: market startCondition: ASAP useDca: true step: '5' ordersCount: 5 activeOrdersCount: 1 volumeScale: '1' stepScale: '1' minimumDeviation: '1' dcaCondition: percentage dcaCustom: [] gridLevel: '5' newBalance: false feeOrder: true useTp: false tpPerc: '5' useSl: false slPerc: '-25' maxNumberOfOpenDeals: '1' useStaticPriceFilter: false minOpenDeal: '' maxOpenDeal: '' useDynamicPriceFilter: false dynamicPriceFilterDirection: under dynamicPriceFilterOverValue: '5' dynamicPriceFilterUnderValue: '5' dynamicPriceFilterPriceType: entry useCooldown: false cooldownAfterDealStart: false cooldownAfterDealStartInterval: 1 cooldownAfterDealStartUnits: minutes cooldownAfterDealStop: false cooldownAfterDealStopInterval: 1 cooldownAfterDealStopUnits: minutes useSmartOrders: false skipBalanceCheck: false limitTimeout: '20' useLimitTimeout: false marginType: isolated leverage: 1 indicators: [] indicatorGroups: [] responses: '200': description: Bot created successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439011 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/deals/combo/details: get: summary: Get Combo Deal by ID description: | Retrieve a single Combo deal by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/deals/combo`. tags: - Deals - Combo operationId: getComboDealById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: dealId in: query required: true description: Deal MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single Combo deal object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/Deal' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/deals/combo: get: summary: Get Combo Deals description: > Retrieve a list of Combo deals with optional field selection. **Query Parameters:** - `status`: Filter by status (`open`, `closed`, `start`, `error`, `canceled`) - `botId`: Filter by bot UUID - `paperContext`: Filter by paper/real trading context **Field Presets:** - `minimal`: _id, botId, status, symbol.symbol, profit.*, createTime - `standard`: minimal + exchange info, avgPrice, lastPrice, levels, cost, value, timestamps - `extended`: standard + settings, balances, feePaid, usage, stats, strategy - `full`: All available fields tags: - Deals - Combo operationId: getComboDeals parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by deal status schema: type: string enum: - open - closed - start - error - canceled - name: botId in: query required: false description: Filter by bot UUID schema: type: string format: uuid responses: '200': description: Successful response with Combo deals list content: application/json: schema: $ref: '#/components/schemas/DealListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/bots/dca/details: get: summary: Get DCA Bot by ID description: | Retrieve a single DCA bot by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/bots/dca`. tags: - Bots - DCA operationId: getDCABotById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: botId in: query required: true description: Bot MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single DCA bot object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/DCABot' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/bots/dca: get: summary: Get DCA Bots description: > Retrieve a list of DCA (Dollar Cost Averaging) bots with optional field selection. **Field Presets:** - `minimal`: _id, uuid, settings.name, status, exchange, exchangeUUID, paperContext - `standard`: minimal + settings.pair, profit.*, deals.*, createdAt, updatedAt - `extended`: standard + settings.baseOrderSize, cost, workingTimeNumber, profitToday, statusReason - `full`: All available fields **Performance:** Using `minimal` reduces response size by ~85%, `standard` by ~70% tags: - Bots - DCA operationId: getDCABots parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by bot status schema: type: string enum: - open - closed - range - error - archive - monitoring example: open responses: '200': description: Successful response with DCA bots list content: application/json: schema: $ref: '#/components/schemas/DCABotListResponse' examples: minimal: summary: Minimal preset response value: status: OK reason: null data: - _id: 507f1f77bcf86cd799439011 uuid: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Long DCA status: open exchange: binance exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 paperContext: false meta: page: 1 total: 42 count: 42 onPage: 1 fields: - _id - uuid - settings.name - status - exchange - exchangeUUID - paperContext standard: summary: Standard preset response (default) value: status: OK reason: null data: - _id: 507f1f77bcf86cd799439011 uuid: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Long DCA pair: - BTC_USDT profitCurrency: quote status: open exchange: binance exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 paperContext: false profit: total: 0.025 totalUsd: 1250.5 deals: all: 42 active: 3 created: '2024-01-15T10:30:00Z' updated: '2024-01-20T14:22:33Z' meta: page: 1 total: 42 count: 42 onPage: 1 fields: - _id - uuid - settings.name - settings.pair - settings.profitCurrency - status - exchange - exchangeUUID - paperContext - profit.total - profit.totalUsd - deals.all - deals.active - created - updated custom: summary: Custom fields selection value: status: OK reason: null data: - uuid: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Long DCA profit: totalUsd: 1250.5 meta: page: 1 total: 42 count: 42 onPage: 1 fields: - uuid - settings.name - profit.totalUsd '400': description: Bad request - invalid fields parameter content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: 'Invalid fields parameter: unknown_field' '401': description: Unauthorized - missing or invalid authentication content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: Invalid signature '403': description: Forbidden - insufficient permissions content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' post: summary: Create DCA Bot description: | Create a new DCA (Dollar Cost Averaging) bot with specified settings. Requires write permission of API keys. tags: - Bots - DCA operationId: createDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateDCABotInput' example: pair: - BTC_USDT exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 vars: [] name: New Bot strategy: LONG profitCurrency: quote orderFixedIn: quote baseOrderSize: '10' orderSize: '10' orderSizeType: quote startOrderType: limit startCondition: ASAP useDca: true step: '1' ordersCount: 5 activeOrdersCount: 1 volumeScale: '1' stepScale: '1' minimumDeviation: '1' dcaCondition: percentage dcaCustom: [] useTp: true tpPerc: '1' useMultiTp: false multiTp: [] trailingTp: false trailingTpPerc: '0.3' useSl: false slPerc: '-10' baseSlOn: avg useMultiSl: false multiSl: [] trailingSl: false moveSL: false moveSLTrigger: '0.5' moveSLValue: '0.2' maxNumberOfOpenDeals: '1' dealCloseCondition: tp dealCloseConditionSL: tp closeByTimer: false closeByTimerValue: 10 closeByTimerUnits: minutes useStaticPriceFilter: false minOpenDeal: '' maxOpenDeal: '' useDynamicPriceFilter: false dynamicPriceFilterDirection: under dynamicPriceFilterOverValue: '5' dynamicPriceFilterUnderValue: '5' dynamicPriceFilterPriceType: entry useCooldown: false cooldownAfterDealStart: false cooldownAfterDealStartInterval: 1 cooldownAfterDealStartUnits: minutes cooldownAfterDealStop: false cooldownAfterDealStopInterval: 1 cooldownAfterDealStopUnits: minutes useSmartOrders: false skipBalanceCheck: false limitTimeout: '20' useLimitTimeout: false marginType: isolated leverage: 1 indicators: [] indicatorGroups: [] responses: '200': description: Bot created successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439011 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/deals/dca/details: get: summary: Get DCA Deal by ID description: | Retrieve a single DCA deal by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/deals/dca`. tags: - Deals - DCA operationId: getDCADealById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: dealId in: query required: true description: Deal MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single DCA deal object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/Deal' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/deals/dca: get: summary: Get DCA Deals description: > Retrieve a list of DCA deals with optional field selection. **Query Parameters:** - `status`: Filter by status (`open`, `closed`, `start`, `error`, `canceled`) - `botId`: Filter by bot UUID - `paperContext`: Filter by paper/real trading context **Field Presets:** - `minimal`: _id, botId, status, symbol.symbol, profit.*, createTime - `standard`: minimal + exchange info, avgPrice, lastPrice, levels, cost, value, timestamps - `extended`: standard + settings, balances, feePaid, usage, stats, strategy - `full`: All available fields tags: - Deals - DCA operationId: getDCADeals parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by deal status schema: type: string enum: - open - closed - start - error - canceled - name: botId in: query required: false description: Filter by bot UUID schema: type: string format: uuid responses: '200': description: Successful response with DCA deals list content: application/json: schema: $ref: '#/components/schemas/DealListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/backtest/dca/requests/{id}: get: summary: Get DCA Backtest Request by ID description: > Retrieve a single DCA backtest request by its MongoDB ObjectId. The request must belong to the authenticated user. Use `backtest.*` field prefixes to include fields from the linked backtest result. tags: - Backtest operationId: getDcaBacktestRequestById parameters: - name: id in: path required: true description: MongoDB ObjectId of the backtest request schema: type: string example: 69a04ceccf441b9c0d60dcd7 - $ref: '#/components/parameters/FieldsParam' responses: '200': description: DCA backtest request content: application/json: schema: $ref: '#/components/schemas/BacktestRequestSingleResponse' example: status: OK reason: null data: _id: 69a04ceccf441b9c0d60dcd7 status: success type: dca exchange: binance exchangeUUID: dc6679c4-1e33-43b8-80d7-a4954c5234ce symbols: - pair: BTCUSDT baseAsset: BTC quoteAsset: USDT cost: 2 backtestId: 09f94e16-fdbd-4196-b7fe-969a683b94c4 statusReason: null statusHistory: - status: pending time: 1772113132925 - status: success time: 1772113149686 updated: '2026-02-26T13:39:09.686Z' created: '2026-02-26T13:38:52.929Z' backtest: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/dca/requests: get: summary: Get DCA Backtest Requests description: > Retrieve a paginated list of DCA backtest requests for the current user, sorted from newest to oldest (10 per page). **Field selection:** - Fields without a prefix are applied to the request document. - Fields prefixed with `backtest.` (e.g. `backtest.financial`, `backtest.settings`) are applied to the linked backtest result and returned under the `backtest` key. - If no `fields` param is set, all request fields and the full backtest result are returned. - If fields are specified **without** any `backtest.*` field, the `backtest` key is omitted. **Field presets:** - `minimal`: _id, status, type, exchange, symbols, created - `standard`: minimal + exchangeUUID, cost, backtestId, statusReason, updated - `extended`: standard + statusHistory, payload - `full`: All fields tags: - Backtest operationId: getDcaBacktestRequests parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' responses: '200': description: Paginated DCA backtest requests content: application/json: schema: $ref: '#/components/schemas/BacktestRequestListResponse' examples: standard: summary: Standard preset value: status: OK reason: null data: - _id: 69a04ceccf441b9c0d60dcd7 status: success type: dca exchange: binance exchangeUUID: dc6679c4-1e33-43b8-80d7-a4954c5234ce symbols: - pair: BTCUSDT baseAsset: BTC quoteAsset: USDT cost: 2 backtestId: 09f94e16-fdbd-4196-b7fe-969a683b94c4 statusReason: null updated: '2026-02-26T13:39:09.686Z' created: '2026-02-26T13:38:52.929Z' backtest: null meta: page: 1 total: 3 count: 30 onPage: 10 fields: - _id - status - type - exchange - exchangeUUID - symbols - cost - backtestId - statusReason - updated - created '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/discovery/bots/{botType}: get: summary: Get schema definition for a single bot type description: > Returns the full schema for the given bot type. Pass `?section=` to retrieve only a single section (e.g. `?section=take_profit`). tags: - Discovery operationId: getDiscoveryBot security: [] parameters: - name: botType in: path required: true schema: type: string enum: - dca - combo - grid - name: section in: query required: false description: >- If provided, returns only the matching section instead of the full schema. schema: type: string example: take_profit responses: '200': description: Bot schema definition (or single section when ?section= is used) content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: oneOf: - $ref: '#/components/schemas/BotSchemaDefinition' - $ref: '#/components/schemas/SectionDefinition' '404': $ref: '#/components/responses/NotFound' /api/v2/discovery/bots/{botType}/sections: get: summary: List sections for a bot type description: > Returns a lightweight summary of every section for the given bot type: `id`, `name`, `description`, and `fieldCount`. Use this to discover available section ids before requesting a specific one with `GET /api/v2/discovery/bots/{botType}?section={id}`. tags: - Discovery operationId: getDiscoveryBotSections security: [] parameters: - name: botType in: path required: true schema: type: string enum: - dca - combo - grid responses: '200': description: Section summaries content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: array items: $ref: '#/components/schemas/SectionSummary' '404': $ref: '#/components/responses/NotFound' /api/v2/discovery/bots: get: summary: List all bot schema definitions description: > Returns schema definitions for all bot types (dca, combo, grid). Each definition contains sections; each section contains fields with type, validators, constraints, default value and an example. Use this endpoint to understand what fields a bot creation/update payload accepts. tags: - Discovery operationId: getDiscoveryBots security: [] responses: '200': description: Bot schema definitions content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: array items: $ref: '#/components/schemas/BotSchemaDefinition' /api/v2/discovery/indicators/{type}: get: summary: Get full field definition for an indicator type description: > Returns the complete field definition for a single indicator type, including core fields (shared by all indicators) and type-specific fields. Pass `?exchange=` to restrict the `indicatorInterval` enum in `coreFields` to only the intervals supported by that exchange. tags: - Discovery operationId: getDiscoveryIndicator security: [] parameters: - name: type in: path required: true schema: type: string example: RSI - name: exchange in: query required: false description: >- When provided, the `indicatorInterval` field enum in `coreFields` is filtered to only include intervals supported by the given exchange (e.g. `binance`, `bybit`, `kucoin`). schema: type: string example: binance responses: '200': description: Indicator definition with core and type-specific fields content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/IndicatorDefinition' '404': $ref: '#/components/responses/NotFound' /api/v2/discovery/indicators: get: summary: List all indicator types description: > Returns a summary of every supported indicator type: its type key, display name, description, supported actions and sections. Use `GET /api/v2/discovery/indicators/{type}` to get full field definitions. Filter by `?action=` to narrow to indicators usable in a specific context. Pass `?exchange=` to include a `supportedIntervals` field on each item. tags: - Discovery operationId: getDiscoveryIndicators security: [] parameters: - name: action in: query required: false description: >- Filter indicators to those whose `supportedActions` list includes this value (e.g. `startDca`, `closeDeal`, `stopBot`). schema: type: string example: startDca - name: exchange in: query required: false description: >- When provided, each summary item will include a `supportedIntervals` array listing the candlestick intervals available on that exchange (e.g. `binance`, `bybit`, `kucoin`). schema: type: string example: binance responses: '200': description: Indicator summary list content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: array items: $ref: '#/components/schemas/IndicatorSummary' /api/v2/backtest/grid/requests/{id}: get: summary: Get Grid Backtest Request by ID description: | Retrieve a single Grid backtest request by its MongoDB ObjectId. The request must belong to the authenticated user. tags: - Backtest operationId: getGridBacktestRequestById parameters: - name: id in: path required: true description: MongoDB ObjectId of the backtest request schema: type: string example: 69a04ceccf441b9c0d60dcd7 - $ref: '#/components/parameters/FieldsParam' responses: '200': description: Grid backtest request content: application/json: schema: $ref: '#/components/schemas/BacktestRequestSingleResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/grid/requests: get: summary: Get Grid Backtest Requests description: > Retrieve a paginated list of Grid backtest requests for the current user, sorted from newest to oldest (10 per page). Supports the same field selection as the DCA variant: use `backtest.*` field prefixes to include fields from the linked backtest result. tags: - Backtest operationId: getGridBacktestRequests parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' responses: '200': description: Paginated Grid backtest requests content: application/json: schema: $ref: '#/components/schemas/BacktestRequestListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/grid/details: get: summary: Get Grid Bot by ID description: | Retrieve a single Grid bot by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/bots/grid`. tags: - Bots - Grid operationId: getGridBotById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: botId in: query required: true description: Bot MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single Grid bot object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/GridBot' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/bots/grid: get: summary: Get Grid Bots description: > Retrieve a list of Grid bots with optional field selection. **Field Presets:** - `minimal`: _id, uuid, settings.name, status, exchange, exchangeUUID, paperContext - `standard`: minimal + settings.symbol, profit.*, levels.*, createdAt, updatedAt - `extended`: standard + grid configuration (gridLevels, lowerPrice, upperPrice), cost, prices - `full`: All available fields tags: - Bots - Grid operationId: getGridBots parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by bot status schema: type: string enum: - open - closed - range - error - archive - monitoring example: open responses: '200': description: Successful response with Grid bots list content: application/json: schema: $ref: '#/components/schemas/GridBotListResponse' examples: standard: summary: Standard preset for Grid bots value: status: OK reason: null data: - _id: 507f1f77bcf86cd799439011 uuid: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Grid 30k-35k symbol: BTCUSDT status: open exchange: binance exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 paperContext: false profit: total: 0.15 totalUsd: 4500 levels: active: 8 all: 10 created: '2024-01-15T10:30:00Z' updated: '2024-01-20T14:22:33Z' meta: page: 1 total: 15 count: 15 onPage: 1 fields: - _id - uuid - settings.name - settings.symbol - status - exchange - exchangeUUID - paperContext - profit.total - profit.totalUsd - levels.active - levels.all - created - updated '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create Grid Bot description: | Create a new Grid bot with specified settings. Requires write permission of API keys. tags: - Bots - Grid operationId: createGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateGridBotInput' example: pair: BTC_USDT exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 topPrice: 50000 lowPrice: 40000 budget: 10000 levels: 10 gridStep: 1 gridType: geometric ordersInAdvance: 6 useOrderInAdvance: true sellDisplacement: 0 name: Grid Bot - BTC profitCurrency: quote orderFixedIn: quote feeOrder: true useStartPrice: false marginType: isolated leverage: 1 skipBalanceCheck: false responses: '200': description: Bot created successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439011 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/screener: get: summary: Get Crypto Screener Data description: > Retrieve crypto screening data with market metrics and optional field selection. **Query Parameters:** - `category`: Filter by category (e.g., "Layer 1", "DeFi") - `minMarketCap`: Minimum market cap filter - `maxMarketCap`: Maximum market cap filter - `minVolume`: Minimum 24h volume filter - `sort`: Sort field (default: marketCapRank) - `order`: Sort order (`asc` or `desc`, default: asc) **Field Presets:** - `minimal`: symbol, name, currentPrice, priceChangePercentage24h, totalVolume, marketCap, marketCapRank - `standard`: minimal + 1h/7d price changes, volume change, market cap change, volatility, liquidity, category - `extended`: standard + 30d/1y changes, ATH/ATL data, multi-day volatility, exchanges, sparkline - `full`: All available fields **Note:** Requires active subscription with screener access. tags: - General operationId: getScreenerData parameters: - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: category in: query required: false description: Filter by coin category schema: type: string example: Layer 1 - name: minMarketCap in: query required: false description: Minimum market capitalization schema: type: number example: 1000000000 - name: maxMarketCap in: query required: false description: Maximum market capitalization schema: type: number - name: minVolume in: query required: false description: Minimum 24h trading volume schema: type: number example: 10000000 - name: sort in: query required: false description: Sort field schema: type: string default: marketCapRank enum: - marketCapRank - currentPrice - priceChangePercentage24h - totalVolume - marketCap - name: order in: query required: false description: Sort order schema: type: string default: asc enum: - asc - desc responses: '200': description: Successful response with screener data content: application/json: schema: $ref: '#/components/schemas/ScreenerListResponse' examples: minimal: summary: Minimal preset for screener value: status: OK reason: null data: - symbol: BTC name: Bitcoin currentPrice: 43250.5 priceChangePercentage24h: 2.5 totalVolume: 28500000000 marketCap: 850000000000 marketCapRank: 1 - symbol: ETH name: Ethereum currentPrice: 2450.75 priceChangePercentage24h: 3.2 totalVolume: 15200000000 marketCap: 295000000000 marketCapRank: 2 meta: page: 1 total: 500 count: 500 onPage: 2 fields: - symbol - name - currentPrice - priceChangePercentage24h - totalVolume - marketCap - marketCapRank standard: summary: Standard preset with additional metrics value: status: OK reason: null data: - symbol: BTC name: Bitcoin currentPrice: 43250.5 priceChangePercentage24h: 2.5 totalVolume: 28500000000 marketCap: 850000000000 marketCapRank: 1 priceChangePercentage1h: 0.5 priceChangePercentage7d: 8.2 volumeChange24h: 15.3 marketCapChangePercentage24h: 2.8 volatility1d: 0.025 liquidityScore: 95 category: Layer 1 meta: page: 1 total: 500 count: 500 onPage: 1 fields: - symbol - name - currentPrice - priceChangePercentage24h - priceChangePercentage1h - priceChangePercentage7d - totalVolume - volumeChange24h - marketCap - marketCapChangePercentage24h - marketCapRank - volatility1d - liquidityScore - category '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': description: Forbidden - requires active subscription with screener access content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' example: status: NOTOK reason: Screener access requires active subscription /api/v2/deals/terminal/details: get: summary: Get Terminal Deal by ID description: > Retrieve a single Terminal deal by its MongoDB ObjectId or UUID. Supports the same field selection presets as `GET /api/v2/deals/terminal`. tags: - Terminal operationId: getTerminalDealById parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - name: dealId in: query required: true description: Deal MongoDB ObjectId or UUID schema: type: string example: 507f1f77bcf86cd799439011 responses: '200': description: Single Terminal deal object content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: $ref: '#/components/schemas/Deal' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/deals/terminal: get: summary: Get Terminal Deals description: > Retrieve a list of Terminal deals with optional field selection. Terminal deals are one-time trades. **Query Parameters:** - `status`: Filter by status (`open`, `closed`, `start`, `error`, `canceled`) - `botId`: Filter by bot UUID - `paperContext`: Filter by paper/real trading context **Field Presets:** - `minimal`: _id, botId, status, symbol.symbol, profit.*, createTime - `standard`: minimal + exchange info, avgPrice, lastPrice, levels, cost, value, timestamps - `extended`: standard + settings, balances, feePaid, usage, stats, strategy - `full`: All available fields tags: - Terminal operationId: getTerminalDeals parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PageParam' - name: status in: query required: false description: Filter by deal status schema: type: string enum: - open - closed - start - error - canceled - name: botId in: query required: false description: Filter by bot ID schema: type: string responses: '200': description: Successful response with Terminal deals list content: application/json: schema: $ref: '#/components/schemas/DealListResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create Terminal Deal description: | Create a new terminal deal (one-time trade). Requires write permission of API keys. tags: - Terminal operationId: createTerminalDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateTerminalDealInput' example: exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 pair: BTC_USDT orderSize: '50' orderSizeType: quote terminalDealType: smart responses: '200': description: Terminal deal created successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439012 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/user/balances: get: summary: Get Balances description: > Retrieve user balances across all exchanges with optional field selection. **Query Parameters:** - `exchangeId`: Filter by exchange connection ID - `asset`: Filter by specific asset (e.g., BTC, USDT) - `assets`: Filter by multiple assets (comma-separated) - `paperContext`: Filter by paper/real trading context **Field Presets:** - `minimal`: asset, free, locked, exchangeUUID - `standard`: minimal + exchange, paperContext - `full`: All available fields (same as standard for balances) tags: - User operationId: getUserBalances parameters: - $ref: '#/components/parameters/FieldsParam' - $ref: '#/components/parameters/PaperContextHeader' - name: exchangeId in: query required: false description: >- Filter by exchange connection ID (if not provided, all exchanges will be included) schema: type: string format: uuid example: 650e8400-e29b-41d4-a716-446655440001 - name: asset in: query required: false description: Filter by specific asset symbol schema: type: string example: BTC - name: assets in: query required: false description: Filter by multiple assets (comma-separated list) schema: type: string example: BTC,USDT,ETH responses: '200': description: Successful response with user balances content: application/json: schema: $ref: '#/components/schemas/BalanceListResponse' examples: standard: summary: Standard preset for balances value: status: OK reason: null data: - asset: BTC free: '0.5' locked: '0.1' exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 exchange: binance paperContext: null - asset: USDT free: '10000' locked: '2500' exchangeUUID: 650e8400-e29b-41d4-a716-446655440001 exchange: binance paperContext: null meta: page: 1 total: 25 count: 25 onPage: 2 fields: - asset - free - locked - exchangeUUID - exchange - paperContext '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/exchanges: get: summary: Get Supported Exchanges description: | A list of supported exchanges tags: - General operationId: getUserExchanges responses: '200': description: Successful response with user exchanges content: application/json: schema: $ref: '#/components/schemas/ExchangeGeneralListResponse' example: status: OK reason: null data: - code: binance market: spot - code: binanceUsdm market: futures type: linear '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/user/exchanges: get: summary: Get Exchanges description: Retrieve user's connected exchanges with optional filtering tags: - User operationId: getUserExchanges parameters: - $ref: '#/components/parameters/PaperContextHeader' responses: '200': description: Successful response with user exchanges content: application/json: schema: $ref: '#/components/schemas/ExchangeListResponse' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/user/global-vars: get: summary: Get Global Variables description: > Retrieve user's global variables with pagination. **Query Parameters:** - `page`: Page number (default: 1) Global variables are user-defined values that can be referenced in bot configurations. tags: - User operationId: getUserGlobalVariables parameters: - name: page in: query required: false description: Page number for pagination schema: type: integer minimum: 1 default: 1 example: 1 responses: '200': description: Successful response with global variables content: application/json: schema: $ref: '#/components/schemas/GlobalVariableListResponse' example: status: OK reason: null data: - _id: 650e8400-e29b-41d4-a716-446655440001 name: myVariable type: text value: '100' userId: 650e8400-e29b-41d4-a716-446655440002 botAmount: 5 createdAt: '2024-01-01T00:00:00Z' updatedAt: '2024-01-01T00:00:00Z' - _id: 650e8400-e29b-41d4-a716-446655440003 name: stopLossPercent type: float value: '5.5' userId: 650e8400-e29b-41d4-a716-446655440002 botAmount: 12 createdAt: '2024-01-01T00:00:00Z' updatedAt: '2024-01-01T00:00:00Z' meta: page: 1 total: 1 count: 2 onPage: 2 '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' post: summary: Create Global Variable description: > Create a new global variable. The value type must match the specified type: - `int`: Value must be a valid integer - `float`: Value must be a valid float number - `text`: Value can be any string Requires write permission of API keys. tags: - User operationId: createGlobalVariable requestBody: required: true content: application/json: schema: type: object required: - name - type - value properties: name: type: string description: Variable name example: myStopLoss type: type: string enum: - text - int - float description: Variable type example: float value: type: string description: >- Variable value (always sent as string, validated based on type) example: '5.5' responses: '200': description: Global variable created successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: id: type: string description: ID of the created variable example: 650e8400-e29b-41d4-a716-446655440001 name: type: string example: myStopLoss type: type: string enum: - text - int - float example: float value: type: string example: '5.5' botAmount: type: integer description: Number of bots using this variable example: 0 '400': description: Validation error content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Value must be a valid float number '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/deals/dca/add-funds: post: summary: Add Funds to Deal description: | Add additional funds to an active DCA deal. Requires write permission of API keys. tags: - Deals - DCA operationId: addFundsToDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - in: query name: dealId required: false description: ID of the deal to add funds to. Either deal ID or bot ID required schema: type: string example: 507f1f77bcf86cd799439012 - in: query name: botId required: false description: ID of the bot to add funds to. Either deal ID or bot ID required schema: type: string example: 507f1f77bcf86cd799439013 requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/AddFundsSchema' responses: '200': description: Funds added successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Deal not found /api/v2/deals/terminal/{dealId}/add-funds: post: summary: Add Funds to Terminal Deal description: | Add additional funds to an active terminal deal. Requires write permission of API keys. tags: - Terminal operationId: addFundsToTerminalDeal parameters: - name: dealId in: path required: true description: ID of the terminal deal schema: type: string example: 507f1f77bcf86cd799439012 requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/AddFundsSchema' responses: '200': description: Funds added successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Validation error or deal not found '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Terminal deal not found '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/combo/{botId}/clone: post: summary: Clone Combo Bot description: | Clone an existing bot with optional settings overrides. Requires write permission of API keys. tags: - Bots - Combo operationId: cloneComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: false description: Optional settings to override from the source bot content: application/json: schema: allOf: - $ref: '#/components/schemas/UpdateComboBotInput' example: name: Cloned Combo Bot orderSize: '300' pair: - ETH_USDT responses: '200': description: Bot cloned successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439013 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/dca/{botId}/clone: post: summary: Clone DCA Bot description: | Clone an existing bot with optional settings overrides. Requires write permission of API keys. tags: - Bots - DCA operationId: cloneDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: false description: Optional settings to override from the source bot content: application/json: schema: allOf: - $ref: '#/components/schemas/UpdateDCABotInput' example: name: Cloned BTC DCA Bot orderSize: '200' ordersCount: 10 responses: '200': description: Bot cloned successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439013 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/grid/{botId}/clone: post: summary: Clone Grid Bot description: | Clone an existing bot with optional settings overrides. Requires write permission of API keys. tags: - Bots - Grid operationId: cloneGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: false description: Optional settings to override from the source bot content: application/json: schema: allOf: - $ref: '#/components/schemas/CreateGridBotInput' example: name: Cloned Grid Bot topPrice: 60000 lowPrice: 30000 budget: 20000 responses: '200': description: Bot cloned successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: object properties: botId: type: string example: 507f1f77bcf86cd799439013 '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/backtest/combo/estimate-cost: post: summary: Estimate Combo Bot Backtest Cost description: > Estimate the cost in credits for a Combo server side backtest before submitting. This endpoint calculates the expected credit cost based on the backtest configuration, symbol count, timeframe, and date range. Requires write permission of API keys. tags: - Backtest operationId: estimateComboServerSideBacktestCost parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Combo backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/ComboBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Combo Strategy pair: - BTC_USDT dcaSettings: baseOrderSize: '100' safetyOrderSize: '150' maxSafetyOrders: 5 from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: Combo backtest cost estimated successfully content: application/json: schema: $ref: '#/components/schemas/BacktestCostEstimate' examples: sufficient_credits: summary: User has sufficient credits value: status: OK reason: null data: estimatedCredits: 3 availableCredits: 10000 allowed: true insufficient_credits: summary: User has insufficient credits value: status: OK reason: null data: estimatedCredits: 20 availableCredits: 8 allowed: false '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/dca/estimate-cost: post: summary: Estimate DCA Bot Backtest Cost description: > Estimate the cost in credits for a DCA server side backtest before submitting. This endpoint calculates the expected credit cost based on the backtest configuration, symbol count, timeframe, and date range. Requires write permission of API keys. tags: - Backtest operationId: estimateDcaServerSideBacktestCost parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: DCA backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/DCABacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC DCA Strategy pair: - BTC_USDT from: 1640995200000 to: 1672531199000 interval: 1h examples: sufficient_credits: summary: User has sufficient credits value: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC DCA Strategy pair: - BTC_USDT from: 1640995200000 to: 1672531199000 interval: 1h insufficient_credits: summary: User has insufficient credits value: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC DCA Strategy pair: - BTC_USDT - ETH/USDT - ADA/USDT from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: DCA backtest cost estimated successfully content: application/json: schema: $ref: '#/components/schemas/BacktestCostEstimate' examples: sufficient_credits: summary: User has sufficient credits value: status: OK reason: null data: estimatedCredits: 2 availableCredits: 10000 allowed: true insufficient_credits: summary: User has insufficient credits value: status: OK reason: null data: estimatedCredits: 15 availableCredits: 5 allowed: false '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/grid/estimate-cost: post: summary: Estimate Grid Bot Backtest Cost description: > Estimate the cost in credits for a Grid server side backtest before submitting. This endpoint calculates the expected credit cost based on the backtest configuration, symbol count, timeframe, and date range. Requires write permission of API keys. tags: - Backtest operationId: estimateGridServerSideBacktestCost parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Grid backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/GridBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Grid Strategy pair: - BTC_USDT gridType: ARITHMETIC upperPrice: '50000' lowerPrice: '30000' levels: 20 investment: '1000' from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: Grid backtest cost estimated successfully content: application/json: schema: $ref: '#/components/schemas/BacktestCostEstimate' examples: sufficient_credits: summary: User has sufficient credits value: status: OK reason: null data: estimatedCredits: 1 availableCredits: 10000 allowed: true insufficient_credits: summary: User has insufficient credits value: status: OK reason: null data: estimatedCredits: 12 availableCredits: 3 allowed: false '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/deals/dca/reduce-funds: post: summary: Reduce Funds from Deal description: | Reduce funds from an active DCA deal. Requires write permission of API keys. tags: - Deals - DCA operationId: reduceFundsFromDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - in: query name: dealId required: false description: ID of the deal to add funds to. Either deal ID or bot ID required schema: type: string example: 507f1f77bcf86cd799439012 - in: query name: botId required: false description: ID of the bot to add funds to. Either deal ID or bot ID required schema: type: string example: 507f1f77bcf86cd799439013 requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/AddFundsSchema' responses: '200': description: Funds reduced successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Deal not found /api/v2/deals/terminal/{dealId}/reduce-funds: post: summary: Reduce Funds from Terminal Deal description: | Reduce funds from an active terminal deal. Requires write permission of API keys. tags: - Terminal operationId: reduceFundsFromTerminalDeal parameters: - name: dealId in: path required: true description: ID of the terminal deal schema: type: string example: 507f1f77bcf86cd799439012 requestBody: required: true content: application/json: schema: allOf: - $ref: '#/components/schemas/AddFundsSchema' responses: '200': description: Funds reduced successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Validation error or deal not found '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Terminal deal not found '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/combo/request: post: summary: Request Combo Bot Server Side Backtest description: > Submit a Combo server side backtest request to test strategies against historical data. The request will be queued and processed asynchronously. Credits will be deducted from the user account. Requires write permission of API keys. tags: - Backtest operationId: requestComboServerSideBacktest parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Combo backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/ComboBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Combo Strategy pair: - BTC_USDT dcaSettings: baseOrderSize: '100' safetyOrderSize: '150' maxSafetyOrders: 5 gridSettings: triggerPerc: '1.5' levels: 10 from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: Combo backtest request submitted successfully content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': description: Invalid Combo backtest configuration or insufficient credits content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/combo/request/sync: post: summary: Request Combo Backtest (Synchronous) description: > Identical to `POST /api/v2/backtest/combo/request` but **holds the connection open** and waits for the backtest to finish before responding. The server polls the database every 10 seconds. Two possible outcomes: - **Completed within 1 hour** — returns the full backtest request object, identical to `GET /api/v2/backtest/dca/requests/{id}`. Supports the same `fields` / `backtest.*` field selection. - **1-hour timeout exceeded** — returns `{ requestId, message }` so the client can poll `GET /api/v2/backtest/dca/requests/{id}` manually when ready. If the backtest fails, credits are already unlocked server-side. Requires write permission of API keys. tags: - Backtest operationId: requestComboServerSideBacktestSync parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Combo backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/ComboBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Combo Strategy pair: - BTC_USDT dcaSettings: baseOrderSize: '100' safetyOrderSize: '150' maxSafetyOrders: 5 gridSettings: triggerPerc: '1.5' levels: 10 from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: > Backtest completed — returns the full request record. If the timeout was exceeded, returns `{ requestId, message }` instead. content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/dca/request: post: summary: Request DCA Bot Server Side Backtest description: > Submit a DCA server side backtest request to test strategies against historical data. The request will be queued and processed asynchronously. Credits will be deducted from the user account. Requires write permission of API keys. tags: - Backtest operationId: requestDcaServerSideBacktest parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: DCA backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/DCABacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC DCA Strategy pair: - BTC_USDT strategy: LONG baseOrderSize: '100' tpPerc: '2.5' from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: DCA backtest request submitted successfully content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': description: Invalid DCA backtest configuration or insufficient credits content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/dca/request/sync: post: summary: Request DCA Backtest (Synchronous) description: > Identical to `POST /api/v2/backtest/dca/request` but **holds the connection open** and waits for the backtest to finish before responding. The server polls the database every 10 seconds. Two possible outcomes: - **Completed within 1 hour** — returns the full backtest request object, identical to `GET /api/v2/backtest/dca/requests/{id}`. Supports the same `fields` / `backtest.*` field selection. - **1-hour timeout exceeded** — returns `{ requestId, message }` so the client can poll `GET /api/v2/backtest/dca/requests/{id}` manually when ready. If the backtest fails, credits are already unlocked server-side. Requires write permission of API keys. tags: - Backtest operationId: requestDcaServerSideBacktestSync parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: DCA backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/DCABacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC DCA Strategy pair: - BTC_USDT strategy: LONG baseOrderSize: '100' tpPerc: '2.5' from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: > Backtest completed — returns the full request record (same as GET-by-id). If the timeout was exceeded, returns `{ requestId, message }` instead. content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/grid/request: post: summary: Request Grid Bot Server Side Backtest description: > Submit a Grid server side backtest request to test strategies against historical data. The request will be queued and processed asynchronously. Credits will be deducted from the user account. Requires write permission of API keys. tags: - Backtest operationId: requestGridServerSideBacktest parameters: - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Grid backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/GridBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Grid Strategy pair: - BTC_USDT topPrice: '50000' lowPrice: '30000' levels: 20 budget: '1000' from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: Grid backtest request submitted successfully content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': description: Invalid Grid backtest configuration or insufficient credits content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/backtest/grid/request/sync: post: summary: Request Grid Backtest (Synchronous) description: > Identical to `POST /api/v2/backtest/grid/request` but **holds the connection open** and waits for the backtest to finish before responding. The server polls the database every 10 seconds. Two possible outcomes: - **Completed within 1 hour** — returns the full backtest request object, identical to `GET /api/v2/backtest/dca/requests/{id}`. Supports the same `fields` / `backtest.*` field selection. - **1-hour timeout exceeded** — returns `{ requestId, message }` so the client can poll `GET /api/v2/backtest/dca/requests/{id}` manually when ready. If the backtest fails, credits are already unlocked server-side. Requires write permission of API keys. tags: - Backtest operationId: requestGridServerSideBacktestSync parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/FieldsParam' requestBody: required: true content: application/json: schema: type: object required: - payload properties: payload: type: object description: Grid backtest payload without type field (specified in URL) allOf: - $ref: '#/components/schemas/BacktestPayload' - type: object properties: data: $ref: '#/components/schemas/GridBacktestPayload' example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: BTC Grid Strategy pair: - BTC_USDT topPrice: '50000' lowPrice: '30000' levels: 20 budget: '1000' from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: > Backtest completed — returns the full request record. If the timeout was exceeded, returns `{ requestId, message }` instead. content: application/json: schema: $ref: '#/components/schemas/BacktestResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/combo/{botId}/restore: post: summary: Restore Combo Bot description: | Restore an archived bot back to active status. Requires write permission of API keys. tags: - Bots - Combo operationId: restoreComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot restored successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/dca/{botId}/restore: post: summary: Restore DCA Bot description: | Restore an archived bot back to active status. Requires write permission of API keys. tags: - Bots - DCA operationId: restoreDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot restored successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/grid/{botId}/restore: post: summary: Restore Grid Bot description: | Restore an archived bot back to active status. Requires write permission of API keys. tags: - Bots - Grid operationId: restoreGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot restored successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/combo/{botId}/start: post: summary: Start Combo Bot description: | Start a stopped or paused bot. Requires write permission of API keys. tags: - Bots - Combo operationId: startComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot started successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/deals/combo/{botId}/start: post: summary: Start New Combo Deal description: | Start a new Combo deal from a bot. Requires write permission of API keys. tags: - Deals - Combo operationId: startComboDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Deal started successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: string example: Deal started '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/dca/{botId}/start: post: summary: Start DCA Bot description: | Start a stopped or paused bot. Requires write permission of API keys. tags: - Bots - DCA operationId: startDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot started successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/deals/dca/{botId}/start: post: summary: Start New DCA Deal description: | Start a new DCA deal from a bot. Requires write permission of API keys. tags: - Deals - DCA operationId: startDCADeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' - name: symbol in: query required: false description: Symbol, used if bot supports multicoins. Format {base}_{quote} schema: type: string example: BTC_USDT responses: '200': description: Deal started successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null data: type: string example: Deal started '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/grid/{botId}/start: post: summary: Start Grid Bot description: | Start a stopped or paused bot. Requires write permission of API keys. tags: - Bots - Grid operationId: startGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot started successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/combo/{botId}/stop: post: summary: Stop Combo Bot description: | Stop an active bot. The bot will be paused and can be restarted later. Requires write permission of API keys. tags: - Bots - Combo operationId: stopComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot stopped successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/dca/{botId}/stop: post: summary: Stop DCA Bot description: | Stop an active bot. The bot will be paused and can be restarted later. Requires write permission of API keys. tags: - Bots - DCA operationId: stopDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot stopped successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/grid/{botId}/stop: post: summary: Stop Grid Bot description: | Stop an active bot. The bot will be paused and can be restarted later. Requires write permission of API keys. tags: - Bots - Grid operationId: stopGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot stopped successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/backtest/{botType}/validate: post: summary: Validate bot settings without creating a bot or backtest description: > Runs the **exact same validation** as `POST /api/v2/bots/{botType}` but does **not** create a bot, DB record, or dispatch to the backtest queue. Validation steps performed (in order): 1. Bot type check (`dca`, `combo`, `grid`) 2. Exchange / paper-context / user lookup (`validateBotCreationContext`) 3. Default-settings merge (same defaults as the create endpoint) 4. Full semantic field validation (`validateCreateDCABotInput` / `validateCreateComboBotInput` / `validateCreateGridBotInput`) On success the response includes the **normalised settings object** that would be passed to the backtest — useful for confirming exactly what the platform would use after defaults are applied. This endpoint is designed for the AI-agent workflow: **discover schema → build settings → validate → submit backtest** Requires write permission of API keys. tags: - Backtest operationId: validateBacktestPayload parameters: - name: botType in: path required: true description: Type of bot to validate schema: type: string enum: - dca - combo - grid example: dca - $ref: '#/components/parameters/PaperContextHeader' requestBody: required: true description: >- Same body shape as `POST /api/v2/backtest/{botType}/request`. The `settings` object inside `payload.data` is the bot configuration to validate. content: application/json: schema: type: object required: - payload properties: payload: type: object required: - data properties: data: type: object required: - exchange - exchangeUUID - settings properties: exchange: type: string description: Exchange identifier example: binance exchangeUUID: type: string format: uuid description: UUID of the exchange account to validate against example: 550e8400-e29b-41d4-a716-446655440000 settings: type: object description: >- Bot settings to validate. Must include at minimum `pair` (array). All other fields are optional and will be filled with defaults. required: - pair properties: pair: type: array items: type: string description: Trading pair(s) in BASE_QUOTE format example: - BTC_USDT additionalProperties: true from: type: integer description: >- Backtest start timestamp (ms) — optional for validation example: 1640995200000 to: type: integer description: >- Backtest end timestamp (ms) — optional for validation example: 1672531199000 interval: type: string description: Chart interval — optional for validation example: 1h example: payload: data: exchange: binance exchangeUUID: 550e8400-e29b-41d4-a716-446655440000 settings: name: My DCA Bot pair: - BTC_USDT strategy: LONG from: 1640995200000 to: 1672531199000 interval: 1h responses: '200': description: >- Settings are valid — returns the normalised settings that would be submitted content: application/json: schema: allOf: - $ref: '#/components/schemas/APIResponse' - type: object properties: data: type: object required: - valid - botType - settings properties: valid: type: boolean example: true botType: type: string example: dca settings: type: object description: >- Normalised bot settings after defaults are applied. This is the exact object that would be passed to the backtest. example: status: OK reason: null data: valid: true botType: dca settings: exchange: binance pair: - BTCUSDT strategy: LONG baseOrderSize: '100' takeProfit: '2' '400': description: Validation failed content: application/json: schema: type: object properties: status: type: string example: NOTOK reason: type: string example: Validation error errors: type: array description: >- Field-level validation errors (same format as bot create endpoints) items: type: object properties: field: type: string message: type: string examples: invalid_bot_type: summary: Invalid bot type value: status: NOTOK reason: Invalid bot type. Must be dca, combo, or grid errors: null field_errors: summary: Field-level validation errors value: status: NOTOK reason: Validation error errors: - field: takeProfit message: Must be greater than 0 - field: baseOrderSize message: Must be a positive number missing_exchange: summary: Exchange not found value: status: NOTOK reason: Exchange not found errors: null '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/dca/{botId}/pairs: put: summary: Change DCA Bot Trading Pairs description: | Change the trading pairs for a DCA bot. Requires write permission of API keys. tags: - Bots - DCA operationId: changeDCABotPairs parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: true content: application/json: schema: type: object required: - pair properties: pair: type: array items: type: string description: List of trading pairs example: - BTC_USDT - ETH_USDT responses: '200': description: Trading pairs updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/bots/combo/{botId}: put: summary: Update Combo Bot description: | Update an existing Combo bot's settings. Requires write permission of API keys. tags: - Bots - Combo operationId: updateComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateComboBotInput' example: name: Updated ETH Combo Bot orderSize: '250' responses: '200': description: Bot updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found delete: summary: Archive Combo Bot description: > Archive a Combo bot. Archived bots are moved to the archive and no longer active. Requires write permission of API keys. tags: - Bots - Combo operationId: archiveComboBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot archived successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/deals/combo/{dealId}: put: summary: Update Combo Deal description: | Update settings for an active Combo deal. Requires write permission of API keys. tags: - Deals - Combo operationId: updateComboDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' requestBody: required: true description: Partial deal settings to update content: application/json: schema: allOf: - $ref: '#/components/schemas/UpdateComboDealsInput' responses: '200': description: Deal updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Deal not found delete: summary: Close Combo Deal description: | Close an active Combo deal with specified close type. Requires write permission of API keys. tags: - Deals - Combo operationId: closeComboDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' - name: type in: query required: true description: Close type schema: type: string enum: - cancel - closeByLimit - closeByMarket - leave example: closeByMarket responses: '200': description: DCA deal closed successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Invalid parameters or deal not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Invalid close type data: type: null '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/dca/{botId}: put: summary: Update DCA Bot description: | Update an existing DCA bot's settings. Requires write permission of API keys. tags: - Bots - DCA operationId: updateDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateDCABotInput' example: name: Updated BTC DCA Bot orderSize: '150' ordersCount: 7 responses: '200': description: Bot updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found delete: summary: Archive DCA Bot description: > Archive a DCA bot. Archived bots are moved to the archive and no longer active. Requires write permission of API keys. tags: - Bots - DCA operationId: archiveDCABot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot archived successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/deals/dca/{dealId}: put: summary: Update DCA Deal description: | Update settings for an active DCA deal. Requires write permission of API keys. tags: - Deals - DCA operationId: updateDCADeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' requestBody: required: true description: Partial deal settings to update content: application/json: schema: allOf: - $ref: '#/components/schemas/UpdateDCADealsInput' responses: '200': description: Deal updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Deal not found delete: summary: Close DCA Deal description: | Close an active DCA deal with specified close type. Requires write permission of API keys. tags: - Deals - DCA operationId: closeDCADeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' - name: type in: query required: true description: Close type schema: type: string enum: - cancel - closeByLimit - closeByMarket - leave example: closeByMarket responses: '200': description: DCA deal closed successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Invalid parameters or deal not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Invalid close type data: type: null '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/user/global-vars/{id}: put: summary: Update Global Variable description: > Update an existing global variable. You can update name, type, and/or value. When changing the value, it must match the type (either existing or new if type is also being updated). Requires write permission of API keys. tags: - User operationId: updateGlobalVariable parameters: - name: id in: path required: true description: Variable ID schema: type: string example: 650e8400-e29b-41d4-a716-446655440001 requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: New variable name (optional) example: updatedName type: type: string enum: - text - int - float description: New variable type (optional) example: int value: type: string description: New variable value (optional, must match type) example: '10' responses: '200': description: Global variable updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Validation error content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Value must be a valid integer '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Variable not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Variable not found '500': $ref: '#/components/responses/InternalServerError' delete: summary: Delete Global Variable description: > Delete a global variable. The variable must not be used by any bots (botAmount must be 0). Requires write permission of API keys. tags: - User operationId: deleteGlobalVariable parameters: - name: id in: path required: true description: Variable ID schema: type: string example: 650e8400-e29b-41d4-a716-446655440001 responses: '200': description: Global variable deleted successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Variable is used by bots content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: >- Variable is used in 5 bot(s). Please remove it from all bots before deleting. '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Variable not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Variable not found '500': $ref: '#/components/responses/InternalServerError' /api/v2/deals/terminal/{dealId}: put: summary: Update Terminal Deal Settings description: > Update settings for an active terminal deal. Only deals that are not closed or canceled can be updated. Requires write permission of API keys. tags: - Terminal operationId: updateTerminalDealSettings parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' requestBody: required: true description: Partial deal settings to update content: application/json: schema: allOf: - $ref: '#/components/schemas/UpdateDCADealsInput' responses: '200': description: Terminal deal settings updated successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Validation error or deal not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Terminal deal not found '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Terminal deal not found '500': $ref: '#/components/responses/InternalServerError' delete: summary: Close Terminal Deal description: | Close an active terminal deal with specified close type. Requires write permission of API keys. tags: - Terminal operationId: closeTerminalDeal parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/DealIdParam' - name: type in: query required: true description: Close type schema: type: string enum: - cancel - closeByLimit - closeByMarket - leave example: closeByMarket responses: '200': description: Terminal deal closed successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': description: Invalid parameters or deal not found content: application/json: schema: type: object properties: status: type: string enum: - NOTOK example: NOTOK reason: type: string example: Invalid close type data: type: null '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/InternalServerError' /api/v2/bots/grid/{botId}: delete: summary: Archive Grid Bot description: > Archive a Grid bot. Archived bots are moved to the archive and no longer active. Requires write permission of API keys. tags: - Bots - Grid operationId: archiveGridBot parameters: - $ref: '#/components/parameters/PaperContextHeader' - $ref: '#/components/parameters/BotIdParam' responses: '200': description: Bot archived successfully content: application/json: schema: type: object properties: status: type: string enum: - OK example: OK reason: type: string nullable: true example: null '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': description: Bot not found /api/v2/agents/models: get: summary: List Available LLM Models description: >- Returns the AI models that have been enabled for agents by the administrator, including their credit pricing. The model with `isDefault: true` should be pre-selected in the UI. If no model is supplied when creating an agent the backend will use the default model. tags: - Agents operationId: listAgentModels responses: '200': description: List of available models with credit pricing content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: models: type: array items: $ref: '#/components/schemas/AgentLlmModel' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/agents/roles: get: summary: List Role Presets description: Returns all enabled predefined agent role presets. tags: - Agents operationId: listAgentRolePresets responses: '200': description: List of role presets content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: results: type: array items: $ref: '#/components/schemas/AgentRolePreset' '401': $ref: '#/components/responses/Unauthorized' /api/v2/agents: get: summary: List Agents description: Returns all AI agents owned by the authenticated user. tags: - Agents operationId: listAgents responses: '200': description: List of agents content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: results: type: array items: $ref: '#/components/schemas/Agent' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' post: summary: Create Agent description: Creates a new AI agent for the authenticated user. tags: - Agents operationId: createAgent requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAgentInput' responses: '200': description: Agent created content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: result: $ref: '#/components/schemas/Agent' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /api/v2/agents/{agentId}: get: summary: Get Agent tags: - Agents operationId: getAgent parameters: - $ref: '#/components/parameters/AgentIdParam' responses: '200': description: Agent details content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: result: $ref: '#/components/schemas/Agent' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' put: summary: Update Agent tags: - Agents operationId: updateAgent parameters: - $ref: '#/components/parameters/AgentIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateAgentInput' responses: '200': description: Updated agent content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: result: $ref: '#/components/schemas/Agent' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: summary: Delete Agent tags: - Agents operationId: deleteAgent parameters: - $ref: '#/components/parameters/AgentIdParam' responses: '200': description: Agent deleted content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: deleted: type: boolean '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/{agentId}/thread: get: summary: Get or Create Thread description: >- Returns the persistent conversation thread for an agent, creating one if it does not exist yet. tags: - Agents operationId: getAgentThread parameters: - $ref: '#/components/parameters/AgentIdParam' responses: '200': description: Thread details content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: result: $ref: '#/components/schemas/AgentThread' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/{agentId}/messages: get: summary: List Thread Messages tags: - Agents operationId: listAgentMessages parameters: - $ref: '#/components/parameters/AgentIdParam' - name: page in: query schema: type: integer minimum: 1 default: 1 - name: limit in: query schema: type: integer minimum: 1 maximum: 200 default: 50 responses: '200': description: Paginated messages content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: results: type: array items: $ref: '#/components/schemas/AgentMessage' total: type: integer page: type: integer '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/{agentId}/run: post: summary: Submit Prompt / Create Run description: >- Submits a user prompt to the agent and creates a new run. Execution is asynchronous — the response returns a `runId` immediately. Use the SSE stream endpoint or poll `/runs` to track progress. tags: - Agents operationId: createAgentRun parameters: - $ref: '#/components/parameters/AgentIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RunRequest' responses: '202': description: Run created — execution is asynchronous content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: runId: type: string '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/{agentId}/runs: get: summary: List Agent Runs tags: - Agents operationId: listAgentRuns parameters: - $ref: '#/components/parameters/AgentIdParam' - name: page in: query schema: type: integer minimum: 1 default: 1 - name: limit in: query schema: type: integer minimum: 1 maximum: 100 default: 20 responses: '200': description: Paginated runs content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: results: type: array items: $ref: '#/components/schemas/AgentRun' total: type: integer page: type: integer '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/hitl/{hitlId}/resolve: post: summary: Resolve HITL Request description: >- Approve or deny a pending Human-In-The-Loop request, resuming the paused agent run. tags: - Agents operationId: resolveHitl parameters: - $ref: '#/components/parameters/HitlIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ResolveHitlInput' responses: '200': description: HITL request resolved content: application/json: schema: type: object properties: status: type: string enum: - OK data: type: object properties: hitl: $ref: '#/components/schemas/AgentHitlRequest' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' /api/v2/agents/{agentId}/backtests: get: summary: List Agent Backtests description: Lists all (non-deleted) backtests for an agent. tags: - Agents operationId: listAgentBacktests parameters: - $ref: '#/components/parameters/AgentIdParam' responses: '200': description: List of backtests content: application/json: schema: $ref: '#/components/schemas/AgentBacktestListResponse' '401': $ref: '#/components/responses/Unauthorized' post: summary: Create Agent Backtest description: > Creates a new backtest for an agent. Allocates a dedicated thread bound to the backtest and seeds it with the start prompt. tags: - Agents operationId: createAgentBacktest parameters: - $ref: '#/components/parameters/AgentIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/CreateAgentBacktestInput' responses: '201': description: Backtest created content: application/json: schema: $ref: '#/components/schemas/AgentBacktestResponse' '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /api/v2/agents/backtests/{backtestId}: get: summary: Get Agent Backtest description: Fetches a single backtest with full state. tags: - Agents operationId: getAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' responses: '200': description: The backtest content: application/json: schema: $ref: '#/components/schemas/AgentBacktestResponse' '404': $ref: '#/components/responses/NotFound' put: summary: Update Agent Backtest description: > Updates a backtest's configuration. Only allowed while status is `configuring` or `paused`. tags: - Agents operationId: updateAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UpdateAgentBacktestInput' responses: '200': description: Backtest updated content: application/json: schema: $ref: '#/components/schemas/AgentBacktestResponse' '400': $ref: '#/components/responses/BadRequest' delete: summary: Delete Agent Backtest description: Soft-deletes a backtest. Refused while playing. tags: - Agents operationId: deleteAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' responses: '200': description: Deleted content: application/json: schema: type: object properties: status: type: string reason: type: string nullable: true data: type: object properties: deleted: type: boolean /api/v2/agents/backtests/{backtestId}/play: post: summary: Play Agent Backtest description: > Starts (or resumes) the play loop. Refused unless status is `configuring` or `paused`. tags: - Agents operationId: playAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' responses: '200': description: Status flipped to `playing` content: application/json: schema: $ref: '#/components/schemas/AgentBacktestStatusResponse' /api/v2/agents/backtests/{backtestId}/pause: post: summary: Pause Agent Backtest description: Pauses a playing backtest. tags: - Agents operationId: pauseAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' responses: '200': description: Status flipped to `paused` content: application/json: schema: $ref: '#/components/schemas/AgentBacktestStatusResponse' /api/v2/agents/backtests/{backtestId}/speed: post: summary: Set Backtest Speed description: | Updates playback speed. `1` = realtime, `N` = N× realtime, `0` = max. tags: - Agents operationId: setAgentBacktestSpeed parameters: - $ref: '#/components/parameters/BacktestIdParam' requestBody: required: true content: application/json: schema: type: object required: - speed properties: speed: type: number minimum: 0 responses: '200': description: Speed updated content: application/json: schema: type: object properties: status: type: string data: type: object properties: speed: type: number /api/v2/agents/backtests/{backtestId}/step: post: summary: Step Agent Backtest description: > Manually advances a paused backtest by one agent run. Optional `prompt` is delivered to the agent as a user message. tags: - Agents operationId: stepAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' requestBody: required: false content: application/json: schema: type: object properties: prompt: type: string nullable: true responses: '202': description: Run queued content: application/json: schema: type: object properties: status: type: string data: type: object properties: runId: type: string /api/v2/agents/backtests/{backtestId}/reset: post: summary: Reset Agent Backtest description: | Wipes the ledger back to the initial state. Refused while playing. tags: - Agents operationId: resetAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' responses: '200': description: Backtest reset content: application/json: schema: $ref: '#/components/schemas/AgentBacktestResponse' /api/v2/agents/backtests/{backtestId}/rewind: post: summary: Rewind Agent Backtest description: > Rewinds the sim clock to `toClock`. Truncates any trade or equity point after the target. Destructive — refused while playing. tags: - Agents operationId: rewindAgentBacktest parameters: - $ref: '#/components/parameters/BacktestIdParam' requestBody: required: true content: application/json: schema: type: object required: - toClock properties: toClock: type: string format: date-time responses: '200': description: Backtest rewound content: application/json: schema: $ref: '#/components/schemas/AgentBacktestResponse' /api/v2/agents/run/{runId}/stream: get: summary: Stream Run Events (SSE) description: > Server-Sent Events stream for a single agent run. Emits events every second until the run reaches a terminal state (completed, failed, or cancelled). Each SSE line has the form `event: \ndata: \n\n`. tags: - Agents operationId: streamAgentRun parameters: - $ref: '#/components/parameters/RunIdParam' responses: '200': description: SSE event stream content: text/event-stream: schema: type: string description: > **Event types:** - `run_update` — emitted every second; data is `RunStreamUpdate` - `message` — new agent message appended to the thread; data is `AgentMessage` - `done` — run reached terminal state; data is `{ "status": "" }` - `error` — unrecoverable streaming error; data is `{ "message": "..." }` '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' security: - ApiKeyAuth: [] SecretAuth: [] tags: - name: Bots - DCA description: DCA bot management endpoints - name: Bots - Combo description: Combo bot management endpoints - name: Bots - Grid description: Grid bot management endpoints - name: Backtest description: Server side backtest endpoints for strategy testing - name: Deals - DCA description: DCA deal management endpoints - name: Deals - Combo description: Combo deal management endpoints - name: Terminal description: Terminal deal management endpoints - name: User description: User account information (balances, exchanges) - name: General description: General endpoints (supported exchanges, screener data) - name: Discovery description: >- Schema discovery endpoints for AI agents and integrations. No authentication required. - name: Agents description: >- AI agent management — create, configure, and monitor autonomous trading agents