Download OpenAPI specification:Download
API for managing trading bots, signals, and users. Integrate HaasOnline's advanced trading automation into your exchange platform.
Simulates a trading bot against historical market data to evaluate performance before risking real funds.
How it works:
Performance metrics include:
Time range limits:
Backtest configuration:
Backtest configuration including bot type, settings, and time range
| userId | string or null User ID who owns the backtest |
| type | string (WhiteLabelScriptType) Enum: "spot_grid" "futures_grid" "spot_dollar_cost_averaging" "futures_dollar_cost_averaging" "webhook" Type of trading bot script |
| exchangeId | string or null Exchange ID (must match user's exchange) |
| settings | any or null Bot settings/configuration |
| startUnix | integer <int32> Backtest start time (Unix timestamp in seconds) |
| endUnix | integer <int32> Backtest end time (Unix timestamp in seconds) |
{- "userId": "user_abc123",
- "type": "spot_grid",
- "exchangeId": "BINANCE",
- "settings": {
- "market": "BTC-USDT",
- "amount": 1000,
- "grid_levels": 10,
- "grid_range": 5,
- "stop_loss": -10
}, - "startUnix": 1704067200,
- "endUnix": 1706745600
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "backtestId": "a3f7e9c1-4b2d-4e8f-9a1c-3d5e7f9b1c2d",
- "serviceId": "script-execution-01",
- "message": "Backtest started successfully. Use GET /bots/backtest/{id}/status to track progress."
}
}Retrieves the current execution status and progress of a running or completed backtest.
Backtest states:
loading_script: Loading bot script and validating configurationloading_data: Loading historical price data from databaseexecuting: Running simulation (progress indicates percentage complete)completed: Backtest finished successfully, results availablefailed: Backtest encountered an error (check message for details)cancelled: Backtest was cancelled by userPolling recommendations:
| backtestId required | string Backtest identifier returned from POST /bots/backtest |
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "backtestId": "a3f7e9c1-4b2d-4e8f-9a1c-3d5e7f9b1c2d",
- "state": "executing",
- "progress": 67,
- "message": "Processing historical data...",
- "serviceId": "script-execution-01"
}
}Retrieves comprehensive backtest results including performance metrics, statistics, and logs.
Only available when backtest state is 'completed'.
Results include:
Summary:
Performance metrics:
Order statistics:
Position statistics:
Execution logs:
Interpreting results:
| backtestId required | string Backtest identifier |
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "backtestId": "a3f7e9c1-4b2d-4e8f-9a1c-3d5e7f9b1c2d",
- "startUnix": 1704067200,
- "endUnix": 1706745600,
- "executionStart": 1709856000,
- "executionEnd": 1709856045,
- "market": "BINANCE:BTC-USDT",
- "summary": {
- "realizedProfit": 245.67,
- "profitCurrency": "USDT",
- "roi": 24.57,
- "feeCosts": 12.34,
- "grossProfit": 258.01,
- "priceChange": 8.5
}, - "performance": {
- "profitFactor": 2.34,
- "sharpeRatio": 1.87,
- "sortinoRatio": 2.15,
- "maxDrawdown": -45.23,
- "maxDrawdownPercent": -4.52,
- "winPercentage": 0.68,
- "biggestWin": 89.45,
- "biggestLoss": -32.18,
- "highestProfit": 312.45,
- "lowestProfit": -12.67
}, - "orders": {
- "total": 156,
- "filled": 142,
- "partiallyFilled": 8,
- "averageOpenTime": 3600
}, - "positions": {
- "closedPositions": 78,
- "winningPositions": 53,
- "losingPositions": 25,
- "averageProfit": 3.15,
- "averageMargin": 100
}, - "logs": [
- "1704067200 ||| 0 ||| Backtest started",
- "1704067260 ||| 1 ||| Placed BUY order at 42500.00",
- "1704067320 ||| 1 ||| Order filled at 42495.50",
- "1704067380 ||| 1 ||| Placed SELL order at 42750.00",
- "1704067440 ||| 1 ||| Order filled at 42755.00",
- "1704067500 ||| 0 ||| Position closed. Profit: +2.50 USDT"
]
}
}Retrieves the complete execution log from a backtest run as structured log entries.
Only available when backtest state is 'completed'.
Each log entry includes:
lineNumber: Sequential line numbertimestamp: Unix timestamp when log was createdseverity: Log level ("info", "trade", "warning", "error", "custom")color: RGBA color value for custom severity logsmessage: Cleaned log message contentLog contents include:
Use cases:
Note: Unlike the /results endpoint which returns only the first 50 log entries, this endpoint returns the complete log history for detailed analysis.
| backtestId required | string Backtest identifier |
{- "isSuccess": true,
- "code": 0,
- "message": "string",
- "data": [
- {
- "lineNumber": 0,
- "timestamp": 0,
- "severity": "error",
- "color": "rgba(128, 128, 128, 1.00)",
- "message": "string"
}
]
}Retrieves all positions opened during the backtest simulation with complete order details.
Only available when backtest state is 'completed'.
Each position includes:
Use cases:
| backtestId required | string Backtest identifier |
{- "isSuccess": true,
- "code": 0,
- "message": "string",
- "data": [
- {
- "pg": "string",
- "g": "string",
- "ac": "string",
- "ma": "string",
- "le": 0,
- "d": 0,
- "mt": 1500,
- "pl": "string",
- "al": "string",
- "pd": 0,
- "ad": 0,
- "ot": 0,
- "ct": 0,
- "ic": true,
- "ap": 0,
- "t": 0,
- "av": 0,
- "io": 0,
- "eno": [
- {
- "paid": "string",
- "pa": 0,
- "id": "string",
- "eid": "string",
- "ot": 0,
- "ct": 0,
- "to": 0,
- "d": 0,
- "t": 500,
- "p": 0,
- "tp": 0,
- "ep": 0,
- "a": 0,
- "af": 0,
- "fe": 0,
- "fc": "string",
- "m": 0,
- "pr": 0,
- "r": 0,
- "cr": 0,
- "n": "string"
}
], - "exo": [
- {
- "paid": "string",
- "pa": 0,
- "id": "string",
- "eid": "string",
- "ot": 0,
- "ct": 0,
- "to": 0,
- "d": 0,
- "t": 500,
- "p": 0,
- "tp": 0,
- "ep": 0,
- "a": 0,
- "af": 0,
- "fe": 0,
- "fc": "string",
- "m": 0,
- "pr": 0,
- "r": 0,
- "cr": 0,
- "n": "string"
}
], - "cp": 0,
- "fe": 0,
- "rp": 0,
- "up": 0,
- "roi": 0,
- "hpip": 0,
- "lpip": 0
}
]
}Cancels a running backtest simulation.
Behavior:
Use cases:
| backtestId required | string Backtest identifier to cancel |
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Retrieves a paginated list of all trading bots across all users in your partner account.
Pagination parameters
| limit | integer <int32> Maximum number of bots to return per page. Use -1 for default (10,000). Valid range: -1 or 1-10,000. |
| nextPageId | string or null Opaque pagination token from previous response. Omit for first page. |
{- "limit": 5,
- "nextPageId": ""
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "items": [
- {
- "userId": "816f438e-4b30-45bd-9785-f7bcca944db8",
- "botId": "18c561aa5a9c4e54af24fb8c21a2040a",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766081300,
- "type": "spot_grid",
- "exchangeId": "BITMEXSPOT",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEXSPOT_ETH_USDT_"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}, - {
- "userId": "4bf8ec12-fa28-442b-b1c1-e67dd31864dd",
- "botId": "bedc8bb485514565b64a728fc0886a95",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766081196,
- "type": "futures_grid",
- "exchangeId": "BITMEX",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAmount": 100,
- "maxWin": 50,
- "maxLoss": 20,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEX_ETH_USDT_ETHUSDT"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}
], - "nextPageId": null
}
}Retrieves a paginated list of trading bots for a specific user.
User ID and pagination parameters
| userId required | string non-empty The unique identifier of the user whose bots to retrieve |
| limit | integer <int32> Maximum number of bots to return per page. Use -1 for default (10,000). Valid range: -1 or 1-10,000. |
| nextPageId | string or null Opaque pagination token from previous response. Omit for first page. |
{- "userId": "50e3b09c-b4fc-4ba4-9c84-1fed830ab506",
- "limit": 10,
- "nextPageId": ""
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "items": [
- {
- "userId": "816f438e-4b30-45bd-9785-f7bcca944db8",
- "botId": "18c561aa5a9c4e54af24fb8c21a2040a",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766081300,
- "type": "spot_grid",
- "exchangeId": "BITMEXSPOT",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEXSPOT_ETH_USDT_"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}, - {
- "userId": "4bf8ec12-fa28-442b-b1c1-e67dd31864dd",
- "botId": "bedc8bb485514565b64a728fc0886a95",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766081196,
- "type": "futures_grid",
- "exchangeId": "BITMEX",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAmount": 100,
- "maxWin": 50,
- "maxLoss": 20,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEX_ETH_USDT_ETHUSDT"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}
], - "nextPageId": null
}
}Retrieves details for a specific trading bot by bot ID and user ID.
User ID and bot ID
| userId required | string non-empty |
| botId required | string non-empty |
{- "userId": "d9bd8028-a594-4828-8edb-e37a35d39dad",
- "botId": "6dafad4e364449c9906296aab8eff2f7"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "userId": "d9bd8028-a594-4828-8edb-e37a35d39dad",
- "botId": "6dafad4e364449c9906296aab8eff2f7",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766087724,
- "type": "spot_grid",
- "exchangeId": "BITMEXSPOT",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEXSPOT_ETH_USDT_"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}
}Creates and starts a new trading bot for the specified user with the provided configuration.
Bot configuration including user ID, script type, and settings
| userId | string or null The user ID who will own this bot |
| type | string (WhiteLabelScriptType) Enum: "spot_grid" "futures_grid" "spot_dollar_cost_averaging" "futures_dollar_cost_averaging" "webhook" Type of trading bot script |
| settings | any or null Bot configuration settings. Structure varies by bot type. Use /scripts/script endpoint to get available settings for each type. |
| masterBotId | string or null Optional: Master bot ID if this bot should follow updates from a master bot (for copy trading) |
{- "userId": "f873b314-f165-45a0-b658-d15ff37d529a",
- "type": "spot_grid",
- "settings": {
- "symbol": "BITMEXSPOT_ETH_USDT_",
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false
}, - "masterBotId": null
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "userId": "d9bd8028-a594-4828-8edb-e37a35d39dad",
- "botId": "6dafad4e364449c9906296aab8eff2f7",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766087724,
- "type": "spot_grid",
- "exchangeId": "BITMEXSPOT",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEXSPOT_ETH_USDT_"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}
}Updates the settings of an existing trading bot. Note: Copied bots cannot be edited directly.
Bot ID, user ID, and new settings to apply
| userId | string or null |
| botId | string or null |
| settings | any or null |
{- "userId": "4aca37d0-c3ab-482a-b479-e421ec74805b",
- "botId": "7d7e643ac399492c8adf1add09316abb",
- "settings": {
- "stopCondition": "Price",
- "stopType": "Above value",
- "stopValue": 55000,
- "stopExit": true
}
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Creates a copy of an existing bot for another user on the same exchange.
Follow Updates Behavior:
Master Bot Tracking:
Requirements:
Source bot ID, target user ID, optional settings overrides, and follow updates flag
| userId required | string non-empty The target user ID who will receive the bot copy |
| botId required | string non-empty The source bot ID to copy from |
| followUpdates required | boolean Whether the copied bot should follow updates from the source bot. When true, the copy becomes a "follower" that automatically receives settings updates when the master bot is edited via /bots/edit. When false, the copy is independent and can be edited separately. |
| settings required | any Optional settings to override in the copy. These settings will be merged with the source bot's settings. Use /scripts/script endpoint to see available settings for the bot type. |
{- "userId": "user_f6g7h8i9j0",
- "botId": "bot_x1y2z3a4b5",
- "followUpdates": true,
- "settings": {
- "orderSize": 75
}
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "userId": "d9bd8028-a594-4828-8edb-e37a35d39dad",
- "botId": "6dafad4e364449c9906296aab8eff2f7",
- "status": "stopped",
- "masterBotId": "",
- "createdAt": 1766087724,
- "type": "spot_grid",
- "exchangeId": "BITMEXSPOT",
- "settings": {
- "lowerLimit": 3000,
- "upperLimit": 4000,
- "gridMode": "Arithmetic",
- "gridCount": 2,
- "investmentAsset": "Quote",
- "investmentAmount": 100,
- "tradeToFillGrid": false,
- "startCondition": "Instant",
- "startType": "Above value",
- "startValue": 0,
- "stopCondition": "Manual",
- "stopType": "Above value",
- "stopValue": 0,
- "stopExit": false,
- "symbol": "BITMEXSPOT_ETH_USDT_"
}, - "profit": 0,
- "roi": 0,
- "cloned": 0,
- "followers": 0
}
}Reactivates a previously stopped bot. The bot must exist and be in stopped status.
Bot ID to start
| botId required | string non-empty The unique identifier of the bot to start |
{- "botId": "7d7e643ac399492c8adf1add09316abb"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Stops a running trading bot and deactivates it. The bot configuration and history are preserved and can be reactivated later. All open orders will be cancelled.
Bot ID to stop
| botId required | string non-empty The unique identifier of the bot to stop |
{- "botId": "895aef7fe5eb4b368ece3d4e65729769"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Calculates and returns the orders that would be created when starting a bot, without actually creating the bot or placing any orders. Currently supported: Grid bots only (spot_grid, futures_grid). Other bot types will return an error. IMPORTANT: This preview is an estimate based on current market conditions. Actual order prices and quantities may differ when the bot is created due to price movements, fee changes, or market volatility. Use this preview as a planning tool, not a guarantee of exact order placement.
Bot configuration for preview
| userId required | string non-empty |
| exchangeId required | string non-empty |
| type required | string (WhiteLabelScriptType) Enum: "spot_grid" "futures_grid" "spot_dollar_cost_averaging" "futures_dollar_cost_averaging" "webhook" Type of trading bot script |
| settings required | any |
{- "userId": "string",
- "exchangeId": "string",
- "type": "spot_grid",
- "settings": null
}{ }Permanently deletes a trading bot and removes it from the system. This action cannot be undone. All bot configuration and history will be lost.
Bot ID to delete
| botId required | string non-empty The unique identifier of the bot to delete |
{- "botId": "d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Retrieves all open orders for a specific bot.
User ID and bot ID
| botId required | string non-empty The unique identifier of the bot |
{- "botId": "6dafad4e364449c9906296aab8eff2f7"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": [
- {
- "orderId": "ord_1a2b3c4d5e",
- "exchangeOrderId": "12345678901234567890",
- "positionId": "pos_xyz789abc123",
- "status": "OPEN",
- "timestamp": 1704067200,
- "direction": "BUY",
- "orderType": "Limit",
- "price": 42500.5,
- "triggerPrice": 0,
- "tradePrice": 42500.5,
- "amount": 0.1,
- "amountFilled": 0.05,
- "feeCosts": 2.125,
- "feeCurrency": "USDT",
- "grossProfit": 0,
- "roi": 0,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "note": "Grid entry order #5"
}, - {
- "orderId": "ord_9f8e7d6c5b",
- "exchangeOrderId": "09876543210987654321",
- "positionId": "pos_xyz789abc123",
- "status": "OPEN",
- "timestamp": 1704070800,
- "direction": "SELL",
- "orderType": "Limit",
- "price": 43000,
- "triggerPrice": 0,
- "tradePrice": 43000,
- "amount": 0.05,
- "amountFilled": 0,
- "feeCosts": 0,
- "feeCurrency": "USDT",
- "grossProfit": 0,
- "roi": 0,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "note": "Grid exit order #5"
}
]
}Retrieves a paginated list of execution log messages for a specific bot.
User ID, bot ID, and pagination parameters
| botId required | string non-empty The unique identifier of the bot |
| limit | integer <int32> Maximum number of log entries to return per page. Use -1 for default (10,000). Valid range: -1 or 1-10,000. |
| nextPageId | string or null Opaque pagination token from previous response. Omit for first page. |
| offset | integer <int32> Number of log entries to skip from the beginning (for backwards pagination) |
{- "botId": "895aef7fe5eb4b368ece3d4e65729769",
- "limit": 100,
- "nextPageId": "",
- "offset": 0
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "items": [
- {
- "lineNumber": 1,
- "timestamp": 1704067200,
- "severity": "info",
- "color": null,
- "message": "Bot created"
}, - {
- "lineNumber": 2,
- "timestamp": 1767806556,
- "severity": "custom",
- "color": "rgba(128, 128, 128, 1.00)",
- "message": "Round initialized."
}, - {
- "lineNumber": 3,
- "timestamp": 1767806556,
- "severity": "trade",
- "color": null,
- "message": "Placed BUY order at 42500.50 for 0.1 BTC"
}, - {
- "lineNumber": 4,
- "timestamp": 1767806556,
- "severity": "warning",
- "color": null,
- "message": "Order partially filled: 0.05 BTC at 42500.50"
}, - {
- "lineNumber": 5,
- "timestamp": 1767806556,
- "severity": "error",
- "color": null,
- "message": "Blocking PlaceBuyOrder(). Insufficient funds. 247075.500000 USDT required. 64.606001 USDT available."
}
], - "nextPageId": "MjAwMDAwMDAwNQ"
}
}Retrieves all currently open positions for a specific bot. No pagination needed as this is real-time data.
User ID and bot ID
| botId required | string non-empty The unique identifier of the bot |
{- "botId": "6dafad4e364449c9906296aab8eff2f7"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": [
- {
- "positionId": "pos_xyz789abc123",
- "status": "OPEN",
- "timestamp": 1704067200,
- "direction": "LONG",
- "enterPrice": 42500.5,
- "exitPrice": null,
- "amount": 0.05,
- "amountLabel": "0.05 BTC",
- "unrealizedProfit": 15,
- "realizedProfit": 0,
- "profitLabel": "0 USDT",
- "roi": 0,
- "feeCosts": 2.125,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "openTime": 1704067200,
- "closeTime": 0,
- "orderCount": 1
}, - {
- "positionId": "pos_def456ghi789",
- "status": "OPEN",
- "timestamp": 1704070800,
- "direction": "SHORT",
- "enterPrice": 43000,
- "exitPrice": null,
- "amount": 0.03,
- "amountLabel": "0.03 BTC",
- "unrealizedProfit": 3,
- "realizedProfit": 0,
- "profitLabel": "0 USDT",
- "roi": 0,
- "feeCosts": 1.29,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "openTime": 1704070800,
- "closeTime": 0,
- "orderCount": 1
}
]
}Retrieves a paginated list of closed positions for a specific bot.
User ID, bot ID, and pagination parameters
| botId required | string non-empty The unique identifier of the bot |
| limit | integer <int32> Maximum number of positions to return per page. Use -1 for default (10,000). Valid range: -1 or 1-10,000. |
| nextPageId | string or null Opaque pagination token from previous response. Omit for first page. |
{- "botId": "18c561aa5a9c4e54af24fb8c21a2040a",
- "limit": 50,
- "nextPageId": ""
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "items": [
- {
- "positionId": "pos_closed1a2b3c",
- "status": "CLOSED",
- "timestamp": 1704024000,
- "direction": "LONG",
- "enterPrice": 42000,
- "exitPrice": 42500,
- "amount": 0.1,
- "amountLabel": "0.1 BTC",
- "unrealizedProfit": 0,
- "realizedProfit": 50,
- "profitLabel": "50.00 USDT",
- "roi": 1.19,
- "feeCosts": 4.25,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "openTime": 1704024000,
- "closeTime": 1704067200,
- "orderCount": 2
}, - {
- "positionId": "pos_closed9z8y7x",
- "status": "CLOSED",
- "timestamp": 1703980800,
- "direction": "SHORT",
- "enterPrice": 43000,
- "exitPrice": 42700,
- "amount": 0.05,
- "amountLabel": "0.05 BTC",
- "unrealizedProfit": 0,
- "realizedProfit": 15,
- "profitLabel": "15.00 USDT",
- "roi": 0.7,
- "feeCosts": 2.14,
- "market": "BINANCE_BTC_USDT_",
- "leverage": 1,
- "openTime": 1703980800,
- "closeTime": 1704024000,
- "orderCount": 2
}
], - "nextPageId": "MTAwMDAwMDAwMw"
}
}Retrieves all enter and exit orders for a specific position.
User ID, bot ID, and position ID
| botId required | string non-empty The unique identifier of the bot |
| positionId required | string non-empty The unique identifier of the position |
{- "botId": "bedc8bb485514565b64a728fc0886a95",
- "positionId": "pos_abc123xyz789"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "positionId": "pos_closed1a2b3c",
- "enterOrders": [
- {
- "orderId": "ord_enter_001",
- "timestamp": 1704024000,
- "direction": "BUY",
- "orderType": "Limit",
- "price": 42000,
- "amount": 0.1,
- "feeCosts": 4.2,
- "feeCurrency": "USDT",
- "profit": 0,
- "roi": 0,
- "note": "Initial position entry"
}
], - "exitOrders": [
- {
- "orderId": "ord_exit_001",
- "timestamp": 1704067200,
- "direction": "SELL",
- "orderType": "Limit",
- "price": 42500,
- "amount": 0.1,
- "feeCosts": 4.25,
- "feeCurrency": "USDT",
- "profit": 50,
- "roi": 1.19,
- "note": "Take profit order"
}
]
}
}Retrieves a list of cryptocurrency exchanges that are enabled for your partner account.
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": [
- {
- "id": "BITMEXSPOT",
- "name": "BitMEX",
- "isSpot": true,
- "isLeverage": false
}, - {
- "id": "BITMEX",
- "name": "BitMEX Derivative",
- "isSpot": false,
- "isLeverage": true
}
]
}Retrieves all available trading pairs (markets) across the exchanges enabled for your partner account.
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": [
- {
- "exchangeId": "BITMEX",
- "name": "AAVE/USDT AAVEUSDT",
- "fullName": "BitMEX Derivative AAVEUSDT",
- "symbol": "BITMEX_AAVE_USDT_AAVEUSDT",
- "exchangeSymbol": "AAVEUSDT",
- "baseCurrency": "AAVE",
- "quoteCurrency": "USDT",
- "priceDecimals": 2,
- "amountDecimals": 1,
- "minimumTradeAmount": 0.1,
- "minimumTradeVolume": 0,
- "amountLabel": "AAVE",
- "profitLabel": "USDT",
- "isSpot": false,
- "isLeverage": true,
- "isOpen": false
}, - {
- "exchangeId": "BITMEX",
- "name": "ADA/USD ADAUSD",
- "fullName": "BitMEX Derivative ADAUSD",
- "symbol": "BITMEX_ADA_USD_ADAUSD",
- "exchangeSymbol": "ADAUSD",
- "baseCurrency": "ADA",
- "quoteCurrency": "USD",
- "priceDecimals": 4,
- "amountDecimals": 0,
- "minimumTradeAmount": 1,
- "minimumTradeVolume": 0,
- "amountLabel": "Contract(s)",
- "profitLabel": "XBT",
- "isSpot": false,
- "isLeverage": true,
- "isOpen": true
}, - {
- "exchangeId": "BITMEX",
- "name": "ADA/USDT ADAUSDT",
- "fullName": "BitMEX Derivative ADAUSDT",
- "symbol": "BITMEX_ADA_USDT_ADAUSDT",
- "exchangeSymbol": "ADAUSDT",
- "baseCurrency": "ADA",
- "quoteCurrency": "USDT",
- "priceDecimals": 4,
- "amountDecimals": 0,
- "minimumTradeAmount": 10,
- "minimumTradeVolume": 0,
- "amountLabel": "ADA",
- "profitLabel": "USDT",
- "isSpot": false,
- "isLeverage": true,
- "isOpen": true
}
]
}Retrieves a list of all available trading bot scripts (e.g., Grid Bot, DCA Bot, etc.).
{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": [
- {
- "type": "spot_grid",
- "name": "Spot Grid Bot",
- "description": "Buy low and sell high 24/7 automatically with just one click.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "lowerLimit",
- "group": "Price range",
- "name": "Lower limit",
- "description": "Lower price limit",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "upperLimit",
- "group": "Price range",
- "name": "Upper limit",
- "description": "Upper price limit",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "gridMode",
- "group": "Grid mode & quantity",
- "name": "Grid mode",
- "description": "Grid mode. Arithmetic grid mode will place all grids evenly spaced based on a constant price difference between grids. Geometric grid mode will place all grids evenly spaced based on a constant percentage difference between grids.",
- "type": "option",
- "value": "Arithmetic",
- "canBeEdited": false,
- "options": [
- "Arithmetic",
- "Geometric"
]
}, - {
- "key": "gridCount",
- "group": "Grid mode & quantity",
- "name": "Grid count",
- "description": "The amount of grids the price range is split into.",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "investmentAsset",
- "group": "Investment amount",
- "name": "Asset",
- "description": "Select the asset type in which the investment amount is based on. Example: on BTC/USDT market the Base option would point to BTC, and Quote option would point to USDT.",
- "type": "option",
- "value": "Base",
- "canBeEdited": false,
- "options": [
- "Base",
- "Quote"
]
}, - {
- "key": "investmentAmount",
- "group": "Investment amount",
- "name": "Amount",
- "description": "Total amount to be invested into the grid range. This amount is split among grids.",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}
]
}, - {
- "type": "futures_grid",
- "name": "Futures Grid Bot",
- "description": "Amplify your purchasing power with an advanced version of Grid Trading.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "lowerLimit",
- "group": "Price range",
- "name": "Lower limit",
- "description": "Lower price limit",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "maxWin",
- "group": "Safety settings",
- "name": "Max. allowed win",
- "description": "Disabled if zero. Set the maximum win allowed (total profits). If reached, the bot will trigger a take-profit and deactivate.",
- "type": "number",
- "value": 0,
- "canBeEdited": true,
- "options": [ ]
}
]
}, - {
- "type": "spot_dollar_cost_averaging",
- "name": "Spot Dollar Cost Average Bot",
- "description": "Auto-place spot buy/sell orders for better average price or unwind.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "direction",
- "group": "Price Settings",
- "name": "Direction",
- "description": "Trading direction",
- "type": "option",
- "value": "Buy",
- "canBeEdited": false,
- "options": [
- "Buy",
- "Sell"
]
}, - {
- "key": "priceDeviation",
- "group": "Price Settings",
- "name": "Price Deviation %",
- "description": "Gap between each order",
- "type": "number",
- "value": 2,
- "canBeEdited": false,
- "options": [ ]
}
]
}, - {
- "type": "futures_dollar_cost_averaging",
- "name": "Futures Dollar Cost Average Bot",
- "description": "Auto-place futures buy/sell orders for better average price or unwind.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "direction",
- "group": "Price Settings",
- "name": "Direction",
- "description": "Trading direction",
- "type": "option",
- "value": "Buy",
- "canBeEdited": false,
- "options": [
- "Buy",
- "Sell"
]
}, - {
- "key": "priceDeviation",
- "group": "Price Settings",
- "name": "Price Deviation %",
- "description": "Gap between each order",
- "type": "number",
- "value": 2,
- "canBeEdited": false,
- "options": [ ]
}
]
}, - {
- "type": "webhook",
- "name": "Webhook Bot",
- "description": "Executed trades based on signals provided by external parties.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "signalToken",
- "group": "",
- "name": "Token",
- "description": "",
- "type": "string",
- "value": "",
- "canBeEdited": true,
- "options": [ ]
}
]
}
]
}Retrieves detailed information about a specific trading bot script, including all configurable settings and parameters.
Script type identifier
| type | string (WhiteLabelScriptType) Enum: "spot_grid" "futures_grid" "spot_dollar_cost_averaging" "futures_dollar_cost_averaging" "webhook" Type of trading bot script |
{- "type": "spot_grid"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "type": "spot_grid",
- "name": "Spot Grid Bot",
- "description": "Buy low and sell high 24/7 automatically with just one click.",
- "settings": [
- {
- "key": "symbol",
- "group": "",
- "name": "Symbol",
- "description": "The symbol of the market the bot will run on",
- "type": "string",
- "value": "",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "lowerLimit",
- "group": "Price range",
- "name": "Lower limit",
- "description": "Lower price limit",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "upperLimit",
- "group": "Price range",
- "name": "Upper limit",
- "description": "Upper price limit",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "gridMode",
- "group": "Grid mode & quantity",
- "name": "Grid mode",
- "description": "Grid mode. Arithmetic grid mode will place all grids evenly spaced based on a constant price difference between grids. Geometric grid mode will place all grids evenly spaced based on a constant percentage difference between grids.",
- "type": "option",
- "value": "Arithmetic",
- "canBeEdited": false,
- "options": [
- "Arithmetic",
- "Geometric"
]
}, - {
- "key": "gridCount",
- "group": "Grid mode & quantity",
- "name": "Grid count",
- "description": "The amount of grids the price range is split into.",
- "type": "number",
- "value": "0",
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "investmentAsset",
- "group": "Investment amount",
- "name": "Asset",
- "description": "Select the asset type in which the investment amount is based on. Example: on BTC/USDT market the Base option would point to BTC, and Quote option would point to USDT.",
- "type": "option",
- "value": "Base",
- "canBeEdited": false,
- "options": [
- "Base",
- "Quote"
]
}, - {
- "key": "investmentAmount",
- "group": "Investment amount",
- "name": "Amount",
- "description": "Total amount to be invested into the grid range. This amount is split among grids.",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "tradeToFillGrid",
- "group": "Advanced Settings",
- "name": "Trade to fill grids?",
- "description": "If true, bot will automatically buy or sell assets to fill both buy and sell grids.",
- "type": "boolean",
- "value": false,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "startCondition",
- "group": "Advanced Settings",
- "name": "Start condition",
- "description": "Instant condition will start the bot immediately. Price condition activates bot once price is above or below set start value. RSI condition will activate bot once RSI is above or below set start value. (NOTE: RSI uses the main interval setting and has 14 period length)",
- "type": "option",
- "value": "Instant",
- "canBeEdited": false,
- "options": [
- "Instant",
- "Price",
- "RSI"
]
}, - {
- "key": "startType",
- "group": "Advanced Settings",
- "name": "Start type",
- "description": "Activation on above or below start value.",
- "type": "option",
- "value": "Above value",
- "canBeEdited": false,
- "options": [
- "Above value",
- "Below value"
]
}, - {
- "key": "startValue",
- "group": "Advanced Settings",
- "name": "Start value",
- "description": "The value for Price or RSI start conditions.",
- "type": "number",
- "value": 0,
- "canBeEdited": false,
- "options": [ ]
}, - {
- "key": "stopCondition",
- "group": "Advanced Settings",
- "name": "Stop condition",
- "description": "Manual condition never deactivate the bot. Price condition deactivates bot once price is above or below set stop value. RSI condition will deactivate bot once RSI is above or below set stop value. (NOTE: RSI uses the main interval setting and has 14 period length)",
- "type": "option",
- "value": "Manual",
- "canBeEdited": true,
- "options": [
- "Manual",
- "Price",
- "RSI"
]
}, - {
- "key": "stopType",
- "group": "Advanced Settings",
- "name": "Stop type",
- "description": "Deactivation on above or below stop value.",
- "type": "option",
- "value": "Above value",
- "canBeEdited": true,
- "options": [
- "Above value",
- "Below value"
]
}, - {
- "key": "stopValue",
- "group": "Advanced Settings",
- "name": "Stop value",
- "description": "The value for Price or RSI stop conditions.",
- "type": "number",
- "value": 0,
- "canBeEdited": true,
- "options": [ ]
}, - {
- "key": "stopExit",
- "group": "Advanced Settings",
- "name": "Stop exits",
- "description": "If true, bot will sell all bought assets when using [Below value] stop condition, or buy back when using [Above value] stop condition.",
- "type": "boolean",
- "value": false,
- "canBeEdited": true,
- "options": [ ]
}
]
}
}Retrieves information about a trading signal using its token.
Signal token
| signalToken | string or null |
{- "signalToken": "webhook_token_abc123xyz"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "signalToken": "my-btc-signal-token",
- "action": "buy",
- "price": 43250.5,
- "amount": 0.05,
- "timestamp": 1702324800,
- "metadata": {
- "source": "TradingView",
- "strategy": "RSI Oversold",
- "confidence": 0.85
}
}
}Sends a trading signal to all webhook-based trading bots listening for the specified signal token.
Required Fields:
Valid Action Values (case-sensitive):
Optional Fields:
Important Notes:
Signal data to send to webhook-based bots
| signal required | any Trading signal object containing the signal token, action, amount, and timestamp. Required fields: signalToken (string), action (string, lowercase only), amount (decimal), timestamp (integer). Valid action values (case-sensitive, must be lowercase): "buy", "sell", "enter_long", "exit_long", "enter_short", "exit_short". Optional fields: price (decimal), investmentType (string), maxLag (integer). |
{- "signal": {
- "signalToken": "my-webhook-token-123",
- "action": "buy",
- "amount": 0.01,
- "timestamp": 1702345678
}
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}Retrieves a paginated list of all users in your partner account.
Pagination parameters
| limit | integer <int32> |
| nextPageId | string or null |
{- "limit": 5,
- "nextPageId": ""
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "items": [
- {
- "userId": "28f19b46-81df-481c-9872-c215626f166e",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766069766,
- "botsStarted": 0,
- "botsActive": 0
}, - {
- "userId": "98aaa021-05c9-4cb1-ae7b-aaa128b42530",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766069766,
- "botsStarted": 0,
- "botsActive": 0
}, - {
- "userId": "e2f12128-c864-47b5-81a7-1e8aeba29943",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766069765,
- "botsStarted": 0,
- "botsActive": 0
}, - {
- "userId": "b3829396-4ad9-4034-ae7a-e8e2fb582c33",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766069765,
- "botsStarted": 0,
- "botsActive": 0
}, - {
- "userId": "3f1315cb-bf6d-4753-8ea5-d29d8d6f0f5b",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766069742,
- "botsStarted": 0,
- "botsActive": 0
}
], - "nextPageId": "N8AoR5407j"
}
}Retrieves details for a specific user by user ID.
User ID
| userId required | string non-empty |
{- "userId": "696c712e-346b-4631-9df8-38fe59211493"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": {
- "userId": "696c712e-346b-4631-9df8-38fe59211493",
- "exchangeId": "BITMEX",
- "exchangeUserId": null,
- "createdAt": 1766070919,
- "botsStarted": 0,
- "botsActive": 0
}
}Creates a new user in your partner account with exchange API credentials.
User details including email, exchange, and API credentials
| exchangeId required | string non-empty The exchange identifier (e.g., BINANCE, BYBIT, BITMEX) |
| publicKey required | string non-empty The exchange API public key. Use "sim" for simulated/paper trading accounts. |
| secretKey required | string non-empty The exchange API secret key |
| extraKey | string or null Optional passphrase or extra key required by some exchanges (e.g., KuCoin) |
| exchangeUserId | string or null Optional exchange user ID for tracking or identifying the user on the exchange platform |
{- "exchangeId": "BITMEX",
- "publicKey": "your-api-public-key",
- "secretKey": "your-api-secret-key",
- "extraKey": "",
- "exchangeUserId": ""
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": "696c712e-346b-4631-9df8-38fe59211493"
}Deletes a user from your partner account. The user must not have any active bots - stop and delete all bots before deleting the user.
User ID to delete
| userId required | string non-empty |
{- "userId": "696c712e-346b-4631-9df8-38fe59211493"
}{- "isSuccess": true,
- "code": 0,
- "message": "",
- "data": true
}