Documentation Index
Fetch the complete documentation index at: https://docs.nexfi.robert.dpdns.org/llms.txt
Use this file to discover all available pages before exploring further.
Quant Strategies and Execution
This page mirrors the detailed design style for Quant APIs, covering strategy administration, backtests, execution, balances, positions, and risk controls.
POST /api/v1/admin/strategies
Purpose
Creates a strategy definition in the admin backend before activation.
Request Body
| Parameter | Type | Required | Description | Example |
|---|
strategyId | String | Yes | Unique strategy ID. | cross_arb_btc_01 |
strategyType | Enum | Yes | Strategy type. | cross_exchange_arbitrage |
symbols | String[] | Yes | Trading symbols. | ["BTC/USDT"] |
exchanges | Enum[] | Yes | Target exchanges. | ["binance","okx"] |
params | Object | Yes | Strategy parameters. | { "min_profit_rate": 0.002 } |
riskProfileId | String | No | Linked risk profile ID. | default_profile |
Supported First-Wave Strategy Types
cross_exchange_arbitrage
triangular_arbitrage
funding_rate_arbitrage
Example Request
{
"strategyId": "cross_arb_btc_01",
"strategyType": "cross_exchange_arbitrage",
"symbols": ["BTC/USDT"],
"exchanges": ["binance", "okx"],
"params": {
"min_profit_rate": 0.002,
"base_quantity": 0.01,
"max_position_size": 0.05
},
"riskProfileId": "default_profile"
}
Response Fields
| Field | Type | Description | Example |
|---|
data.strategyId | String | Strategy ID. | cross_arb_btc_01 |
data.status | String | Initial strategy status. | created |
Example Response
{
"code": 0,
"msg": "ok",
"data": {
"strategyId": "cross_arb_btc_01",
"status": "created"
}
}
GET /api/v1/admin/strategies
Purpose
Returns strategy list for the admin strategy management page.
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|
status | String | No | Strategy status filter. | running |
strategyType | String | No | Strategy type filter. | cross_exchange_arbitrage |
page | Integer | No | Page number. | 1 |
pageSize | Integer | No | Page size. | 20 |
Typical Response Fields
| Field | Type | Description | Example |
|---|
data.items[].strategyId | String | Strategy ID. | cross_arb_btc_01 |
data.items[].strategyType | String | Strategy type. | cross_exchange_arbitrage |
data.items[].symbols | String[] | Trading symbols. | ["BTC/USDT"] |
data.items[].exchanges | String[] | Exchanges. | ["binance","okx"] |
data.items[].status | String | Strategy status. | running |
GET /api/v1/admin/strategies/{strategyId}
Purpose
Returns detail of one strategy.
Path Parameters
| Parameter | Type | Required | Description | Example |
|---|
strategyId | String | Yes | Strategy ID. | cross_arb_btc_01 |
PUT /api/v1/admin/strategies/{strategyId}
Purpose
Updates strategy parameters or risk-profile binding.
Request Body
| Parameter | Type | Required | Description | Example |
|---|
params | Object | No | Updated strategy parameters. | { "min_profit_rate": 0.003 } |
riskProfileId | String | No | Updated risk profile ID. | conservative_profile |
POST /api/v1/admin/strategies/{strategyId}/start
Purpose
Starts a strategy runtime instance.
Response Fields
| Field | Type | Description | Example |
|---|
data.strategyId | String | Strategy ID. | cross_arb_btc_01 |
data.status | String | Runtime status after start. | running |
POST /api/v1/admin/strategies/{strategyId}/pause
Purpose
Pauses a running strategy.
POST /api/v1/admin/strategies/{strategyId}/stop
Purpose
Stops a running strategy.
GET /api/v1/admin/strategies/{strategyId}/runs
Purpose
Returns historical runtime records for troubleshooting and operational review.
Response Fields
| Field | Type | Description | Example |
|---|
data.items[].runId | String | Runtime record ID. | run_001 |
data.items[].strategyId | String | Strategy ID. | cross_arb_btc_01 |
data.items[].status | String | Runtime status. | stopped |
data.items[].startedAt | String | Start time. | 2026-05-11T10:00:00.000Z |
data.items[].endedAt | String | End time. | 2026-05-11T12:00:00.000Z |
POST /api/v1/admin/backtests
Purpose
Creates a backtest job for strategy validation and parameter exploration.
Request Body
| Parameter | Type | Required | Description | Example |
|---|
strategyType | String | Yes | Strategy type. | cross_exchange_arbitrage |
symbols | String[] | Yes | Backtest symbols. | ["BTC/USDT"] |
timeRange | Object | Yes | Backtest time range. | { "from": "2026-01-01", "to": "2026-03-01" } |
params | Object | Yes | Backtest parameters. | { "min_profit_rate": 0.002 } |
Response Fields
| Field | Type | Description | Example |
|---|
data.backtestId | String | Backtest job ID. | bt_001 |
data.status | String | Backtest status. | queued |
GET /api/v1/admin/backtests/{backtestId}
Purpose
Returns backtest result payload, including summary metrics and trade list.
Response Fields
| Field | Type | Description | Example |
|---|
data.backtestId | String | Backtest ID. | bt_001 |
data.status | String | Backtest status. | completed |
data.metrics | Object | Metrics such as pnl, Sharpe ratio, and drawdown. | { "sharpe": 1.8 } |
data.trades | Array | Trade result list. | [] |
POST /api/v1/execution/orders
Purpose
Places an order on the target exchange.
Request Body
| Parameter | Type | Required | Description | Example |
|---|
exchange | Enum | Yes | Target exchange. | binance |
symbol | String | Yes | Trading symbol. | BTCUSDT |
side | String | Yes | Order side. | buy |
type | String | Yes | Order type. | limit |
price | Number | No | Limit price. | 65000 |
quantity | Number | Yes | Order quantity. | 0.01 |
strategyId | String | No | Source strategy ID. | cross_arb_btc_01 |
Example Request
{
"exchange": "binance",
"symbol": "BTCUSDT",
"side": "buy",
"type": "limit",
"price": 65000,
"quantity": 0.01,
"strategyId": "cross_arb_btc_01"
}
Response Fields
| Field | Type | Description | Example |
|---|
data.clientOrderId | String | Platform order ID. | ord_20260511_0001 |
data.exchangeOrderId | String | Exchange order ID. | 789123456 |
data.exchange | String | Exchange. | binance |
data.symbol | String | Trading symbol. | BTCUSDT |
data.status | String | Order status. | new |
Example Response
{
"code": 0,
"msg": "ok",
"data": {
"clientOrderId": "ord_20260511_0001",
"exchangeOrderId": "789123456",
"exchange": "binance",
"symbol": "BTCUSDT",
"status": "new"
}
}
GET /api/v1/execution/orders
Purpose
Returns execution order list.
Query Parameters
| Parameter | Type | Required | Description | Example |
|---|
exchange | Enum | No | Exchange filter. | binance |
symbol | String | No | Symbol filter. | BTCUSDT |
status | String | No | Status filter. | filled |
GET /api/v1/execution/orders/{clientOrderId}
Purpose
Returns detail of one execution order.
POST /api/v1/execution/orders/{clientOrderId}/cancel
Purpose
Cancels an existing execution order.
GET /api/v1/execution/positions
Purpose
Returns current exchange positions.
Typical Response Fields
| Field | Type | Description | Example |
|---|
data.items[].exchange | String | Exchange. | binance |
data.items[].symbol | String | Trading symbol. | BTCUSDT |
data.items[].positionSide | String | Position side. | long |
data.items[].netQuantity | Number | Net position quantity. | 0.5 |
GET /api/v1/execution/balances
Purpose
Returns exchange balance list.
Typical Response Fields
| Field | Type | Description | Example |
|---|
data.items[].exchange | String | Exchange. | okx |
data.items[].asset | String | Asset symbol. | USDT |
data.items[].available | Number | Available balance. | 100000 |
data.items[].frozen | Number | Frozen balance. | 5000 |
GET /api/v1/risk/config
Purpose
Returns current risk configuration.
Typical Response Fields
| Field | Type | Description | Example |
|---|
data.maxPosition | Number | Maximum per-symbol position. | 2 |
data.maxTotalExposure | Number | Maximum total exposure. | 1000000 |
data.maxOrderSize | Number | Maximum single order size. | 100000 |
data.maxOrdersPerSecond | Integer | Maximum orders per second. | 5 |
data.maxDailyLoss | Number | Maximum daily loss. | 20000 |
data.maxDrawdown | Number | Maximum drawdown threshold. | 0.15 |
data.killSwitch | Boolean | Global kill switch. | false |
PUT /api/v1/risk/config
Purpose
Updates risk thresholds and kill-switch settings.
GET /api/v1/risk/events
Purpose
Returns risk events for audit and troubleshooting.
Typical Response Fields
| Field | Type | Description | Example |
|---|
data.items[].eventId | String | Risk event ID. | risk_evt_001 |
data.items[].eventType | String | Risk event type. | MAX_DRAWDOWN_EXCEEDED |
data.items[].level | String | Severity level. | critical |
data.items[].message | String | Event message. | Drawdown threshold exceeded |
data.items[].createdAt | String | Event time. | 2026-05-11T10:00:00.000Z |
Notes
- Strategy, execution, and risk APIs are operational APIs and should be treated as admin-grade surfaces.
- Backtest output is analytical and should not be interpreted as production-trading guarantees.
- Risk configuration changes should be audited together with operator identity and change reason.