diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a7c367..17bdb84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ ## 2026-05-21 +### Added + +#### `POST /aster-chain/v3/transfer` — Transfer to Address / 转账至地址 + +A new WITHDRAW-authenticated endpoint for transferring assets to another registered Aster Chain user address. Returns `transferId`, `asset`, `amount`, `toAddress`, `timestamp`, and `status`. + +#### STP Mode APIs / 自成交防止模式接口 + +- `POST /fapi/v3/stpMode` — Change STP Mode / 更改STP模式 (TRADE, weight 1) +- `GET /fapi/v3/stpMode` — Get Current STP Mode / 查询STP模式 (USER_DATA, weight 30) + +Supports `EXPIRE_TAKER`, `EXPIRE_MAKER`, `EXPIRE_BOTH`. Added `stpMode` optional parameter to `POST /fapi/v3/order` for per-order STP override. + + ### Added #### `POST /fapi/v3/stpMode` — Change STP Mode / 更改STP模式 @@ -20,6 +34,21 @@ Added `stpMode` (ENUM, optional) to the place-order parameter list. When specifi --- +## 2026-05-20 + +### Added + +#### Strategy Order APIs / 策略订单接口 + +- `POST /fapi/v3/placeStrategyOrder` — Place Strategy Order / 策略下单 +- `POST /fapi/v3/updateStrategyOrder` — Update Strategy Order / 更新策略订单 +- `GET /fapi/v3/strategyOrder` — Query Strategy Open Order / 查询策略当前挂单 +- `GET /fapi/v3/strategyOrder/history` — Query Strategy History Order / 查询策略历史订单 + +Supports OTO, OCO, and OTOCO strategy types. + +--- + ## 2026-05-19 ### Added diff --git a/V3(Recommended)/EN/aster-chain.md b/V3(Recommended)/EN/aster-chain.md new file mode 100644 index 0000000..29ba55a --- /dev/null +++ b/V3(Recommended)/EN/aster-chain.md @@ -0,0 +1,94 @@ +# Aster-Chain API Overview + +* This document lists the base URL for the API endpoints: **https://chainapi.asterdex.com** +* All API responses are in JSON format. + +--- + +- [Aster-Chain Account Endpoints](#aster-chain-account-endpoints) + - [Get Account Status (USER_DATA)](#get-account-status-user_data) + - [Modify Account Status (TRADE)](#modify-account-status-trade) + - [Transfer to Address (WITHDRAW)](#transfer-to-address-withdraw) + +--- + +# Aster-Chain Account Endpoints + +## Get Account Status (USER_DATA) + +> **Response:** + +```javascript +{ + "status": "PRIVATE" // "PUBLIC" or "PRIVATE" +} +``` + +`GET /aster-chain/v3/account/status` + +Get the current account's privacy status. + +**Weight:** 1 + +**Parameters:** + +None + +--- + +## Modify Account Status (TRADE) + +> **Response:** + +```javascript +{ + "status": "PRIVATE" // "PUBLIC" or "PRIVATE" +} +``` + +`POST /aster-chain/v3/account/modify-status` + +Modify the account's privacy status. After a successful update, the change is broadcast to the Aster Chain. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| status | STRING | YES | Account privacy mode: `"PUBLIC"` or `"PRIVATE"` | + +--- + +## Transfer to Address (WITHDRAW) + +> **Response:** + +```javascript +{ + "transferId": "123456789", + "asset": "USDT", + "amount": "10.00", + "toAddress": "0xAbCd1234...", + "timestamp": 1699900800000, + "status": "SUCCESS" // "SUCCESS" or "PENDING" +} +``` + +`POST /aster-chain/v3/transfer` + +Transfer assets to another Aster Chain address. The recipient address must belong to a registered Aster Chain user. + +**Weight:** 50 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| asset | STRING | YES | Asset name to transfer (e.g. `"USDT"`) | +| amount | DECIMAL | YES | Transfer amount, must be greater than 0 | +| toAddress | STRING | YES | Recipient's Aster Chain wallet address | +| clientTranId | STRING | NO | Client-defined transfer ID; auto-generated if not provided | +| nonce | LONG | YES | Microsecond timestamp | +| user | STRING | YES | Source account wallet address | +| signature | STRING | YES | EIP-712 signature, signed with the `user` account's wallet private key | diff --git a/V3(Recommended)/EN/aster-finance-futures-api-v3.md b/V3(Recommended)/EN/aster-finance-futures-api-v3.md index ed0f51d..69abc01 100644 --- a/V3(Recommended)/EN/aster-finance-futures-api-v3.md +++ b/V3(Recommended)/EN/aster-finance-futures-api-v3.md @@ -101,6 +101,10 @@ - [Get User MMP (USER_DATA)](#get-user-mmp-user_data) - [Delete User MMP (USER_DATA)](#delete-user-mmp-user_data) - [Reset User MMP (USER_DATA)](#reset-user-mmp-user_data) + - [Place Strategy Order (TRADE)](#place-strategy-order-trade) + - [Update Strategy Order (TRADE)](#update-strategy-order-trade) + - [Query Strategy Open Order (USER_DATA)](#query-strategy-open-order-user_data) + - [Query Strategy History Order (USER_DATA)](#query-strategy-history-order-user_data) - [Bind Sub-Account (USER_DATA)](#bind-sub-account-user_data) - [Create Sub-Account (TRADE)](#create-sub-account-trade) - [Get Sub-Account List (USER_DATA)](#get-sub-account-list-user_data) @@ -3811,6 +3815,256 @@ true | symbol | STRING | YES | | +## Place Strategy Order (TRADE) + +> **Response:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "updateTime": 1699900000000, + "failureCode": 0, + "failureReason": "" +} +``` + +`POST /fapi/v3/placeStrategyOrder` + +Place a new strategy order. Supports OTO (One-Triggers-the-Other), OCO (One-Cancels-the-Other), and OTOCO (One-Triggers-One-Cancels-the-Other) strategy types. + +**Weight:** 50 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| clientStrategyId | STRING | NO | Client-assigned unique strategy ID | +| strategyType | ENUM | YES | Strategy type: `OTO`, `OCO`, `OTOCO` | +| subOrderList | JSON Array | YES | List of sub-orders. `OTO` and `OCO` require exactly 2; `OTOCO` requires exactly 3 | + +**Sub-order fields (each element in `subOrderList`):** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| strategySubId | STRING | YES | Sub-order sequence number starting from 1, must be sequential and match position in array | +| securityType | STRING | YES | Security type of the order | +| symbol | STRING | YES | Trading pair | +| side | STRING | YES | `BUY` or `SELL` | +| positionSide | STRING | NO | `BOTH`, `LONG`, `SHORT`. Default `BOTH` in one-way mode | +| type | STRING | YES | `LIMIT`, `MARKET`, `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET`, `TRAILING_STOP_MARKET` | +| quantity | STRING | YES* | Order quantity. Not required when `closePosition=true` | +| price | STRING | YES* | Required for `LIMIT`, `STOP`, `TAKE_PROFIT` | +| stopPrice | STRING | YES* | Required for `STOP`, `STOP_MARKET`, `TAKE_PROFIT`, `TAKE_PROFIT_MARKET` | +| timeInForce | STRING | YES* | Required for `LIMIT`; optional for stop orders (default `GTC`). `IOC` and `FOK` are not supported | +| workingType | STRING | NO | `CONTRACT_PRICE` or `MARK_PRICE`. Default `CONTRACT_PRICE` | +| reduceOnly | STRING | NO | Reduce-only flag | +| closePosition | STRING | NO | Close-position flag | +| priceProtect | STRING | NO | Price protection flag | +| clientOrderId | STRING | NO | Client-assigned order ID | +| activationPrice | STRING | NO | Activation price for `TRAILING_STOP_MARKET` | +| callbackRate | STRING | NO | Callback rate for `TRAILING_STOP_MARKET` | +| firstDrivenId | STRING | NO | `strategySubId` of the driving sub-order for the first trigger condition | +| firstDrivenOn | STRING | NO | Event type that activates the first trigger | +| firstTrigger | STRING | NO | First trigger action | +| secondDrivenId | STRING | NO | `strategySubId` of the driving sub-order for the second trigger condition | +| secondDrivenOn | STRING | NO | Event type that activates the second trigger | +| secondTrigger | STRING | NO | Second trigger action | + +--- + +## Update Strategy Order (TRADE) + +> **Response:** + +```javascript +[ + { + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "updatedSubOrder": 1, + "updateStatus": "SUCCESS", + "updateTime": 1699900000000, + "failureCode": 0, + "failureReason": "" + } +] +``` + +`POST /fapi/v3/updateStrategyOrder` + +Update one or more sub-orders of an existing strategy order. Returns an array with one result per updated sub-order. + +**Weight:** 50 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| strategyId | LONG | YES | Strategy order ID to update | +| strategyType | ENUM | YES | Strategy type: `OTO`, `OCO`, `OTOCO` | +| subOrderList | JSON Array | YES | Sub-orders to update. Max 2 items for `OTO`/`OCO`, max 3 for `OTOCO` | + +**Sub-order fields (each element in `subOrderList`):** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| strategySubId | STRING | YES | Sequence number of the sub-order to update | +| securityType | STRING | YES | Security type | +| symbol | STRING | YES | Trading pair | +| side | STRING | YES | `BUY` or `SELL` | +| positionSide | STRING | NO | `BOTH`, `LONG`, `SHORT` | +| type | STRING | YES | Order type | +| quantity | STRING | NO | New order quantity | +| price | STRING | NO | New price (applicable for `LIMIT`, `STOP`, `TAKE_PROFIT`) | +| stopPrice | STRING | NO | New stop price | +| timeInForce | STRING | NO | New time in force | +| workingType | STRING | NO | New working type | +| reduceOnly | STRING | NO | | +| closePosition | STRING | NO | | +| priceProtect | STRING | NO | | +| activationPrice | STRING | NO | For `TRAILING_STOP_MARKET` only | +| callbackRate | STRING | NO | For `TRAILING_STOP_MARKET` only | + +--- + +## Query Strategy Open Order (USER_DATA) + +> **Response:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "bookTime": 1699900000000, + "updateTime": 1699900001000, + "subOrders": [ + { + "strategyId": 123456789, + "orderId": 987654321, + "clientOrderId": "myOrder1", + "status": "NEW", + "strategySubId": 1, + "firstDrivenId": 0, + "firstDrivenOn": "", + "firstTrigger": "", + "secondDrivenId": 0, + "secondDrivenOn": "", + "secondTrigger": "", + "securityType": "FUTURE", + "symbol": "BTCUSDT", + "side": "BUY", + "positionSide": "LONG", + "type": "LIMIT", + "timeInForce": "GTC", + "quantity": "0.001", + "reduceOnly": false, + "closePosition": false, + "price": "50000", + "avgPrice": "0", + "priceProtect": false, + "stopPrice": "0", + "activatePrice": null, + "callbackRate": null, + "workingType": "CONTRACT_PRICE", + "triggerTime": 0 + } + ] +} +``` + +`GET /fapi/v3/strategyOpenOrder` + +Query a current open strategy order. Either `strategyId` or `clientStrategyId` must be provided, but not both. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| strategyId | LONG | NO* | Strategy order ID | +| clientStrategyId | STRING | NO* | Client-assigned strategy ID | +| strategyType | STRING | YES | Strategy type: `OTO`, `OCO`, `OTOCO` | + +*Either `strategyId` or `clientStrategyId` must be provided (mutually exclusive). + +--- + +## Query Strategy History Order (USER_DATA) + +> **Response:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "EXPIRED", + "bookTime": 1699800000000, + "updateTime": 1699800060000, + "subOrders": [ + { + "strategyId": 123456789, + "orderId": 987654321, + "clientOrderId": "myOrder1", + "status": "FILLED", + "strategySubId": 1, + "firstDrivenId": 0, + "firstDrivenOn": "", + "firstTrigger": "", + "secondDrivenId": 0, + "secondDrivenOn": "", + "secondTrigger": "", + "securityType": "FUTURE", + "symbol": "BTCUSDT", + "side": "BUY", + "positionSide": "LONG", + "type": "LIMIT", + "timeInForce": "GTC", + "quantity": "0.001", + "reduceOnly": false, + "closePosition": false, + "price": "50000", + "avgPrice": "50000", + "priceProtect": false, + "stopPrice": "0", + "activatePrice": null, + "callbackRate": null, + "workingType": "CONTRACT_PRICE", + "triggerTime": 1699800030000 + } + ] +} +``` + +`GET /fapi/v3/strategyHistoryOrder` + +Query historical strategy orders. Either `strategyId` or `clientStrategyId` must be provided, but not both. Maximum lookback window is 90 days. + +**Weight:** 5 + +**Parameters:** + +| Name | Type | Mandatory | Description | +|------|------|-----------|-------------| +| strategyId | LONG | NO* | Strategy order ID | +| clientStrategyId | STRING | NO* | Client-assigned strategy ID | +| strategyType | STRING | YES | Strategy type: `OTO`, `OCO`, `OTOCO` | +| startTime | LONG | NO | Start time in milliseconds. Data older than 90 days cannot be queried | +| endTime | LONG | NO | End time in milliseconds | +| limit | INT | NO | Number of results returned. Default 500; max 1000 | + +*Either `strategyId` or `clientStrategyId` must be provided (mutually exclusive). + +--- + # Bind Sub-Account (USER_DATA) > **Response:** diff --git "a/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" "b/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" new file mode 100644 index 0000000..f37e324 --- /dev/null +++ "b/V3(Recommended)/\344\270\255\346\226\207/aster-chain_CN.md" @@ -0,0 +1,94 @@ +# Aster-Chain API 概览 + +* 本文档所列接口的 Base URL 为:**https://chainapi.asterdex.com** +* 所有接口响应均为 JSON 格式。 + +--- + +- [Aster-Chain 账户接口](#aster-chain-账户接口) + - [查询账户状态 (USER_DATA)](#查询账户状态-user_data) + - [修改账户状态 (TRADE)](#修改账户状态-trade) + - [转账至地址 (WITHDRAW)](#转账至地址-withdraw) + +--- + +# Aster-Chain 账户接口 + +## 查询账户状态 (USER_DATA) + +> **响应:** + +```javascript +{ + "status": "PRIVATE" // "PUBLIC" 或 "PRIVATE" +} +``` + +`GET /aster-chain/v3/account/status` + +查询当前账户的隐私状态。 + +**权重:** 1 + +**参数:** + +无 + +--- + +## 修改账户状态 (TRADE) + +> **响应:** + +```javascript +{ + "status": "PRIVATE" // "PUBLIC" 或 "PRIVATE" +} +``` + +`POST /aster-chain/v3/account/modify-status` + +修改账户隐私状态。更新成功后,变更将广播至 Aster Chain。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| status | STRING | YES | 账户隐私模式:`"PUBLIC"` 或 `"PRIVATE"` | + +--- + +## 转账至地址 (WITHDRAW) + +> **响应:** + +```javascript +{ + "transferId": "123456789", + "asset": "USDT", + "amount": "10.00", + "toAddress": "0xAbCd1234...", + "timestamp": 1699900800000, + "status": "SUCCESS" // "SUCCESS" 或 "PENDING" +} +``` + +`POST /aster-chain/v3/transfer` + +将资产转账至另一个 Aster Chain 地址。接收地址必须属于已注册的 Aster Chain 用户。 + +**权重:** 50 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| asset | STRING | YES | 转账资产名称(如 `"USDT"`) | +| amount | DECIMAL | YES | 转账金额,必须大于 0 | +| toAddress | STRING | YES | 接收方的 Aster Chain 钱包地址 | +| clientTranId | STRING | NO | 客户端自定义划转 ID,若未提供则自动生成 | +| nonce | LONG | YES | 微秒时间戳 | +| user | STRING | YES | 发起账户钱包地址 | +| signature | STRING | YES | EIP-712 签名,使用 `user` 账户的钱包私钥签名 | diff --git "a/V3(Recommended)/\344\270\255\346\226\207/aster-finance-futures-api-v3_CN.md" "b/V3(Recommended)/\344\270\255\346\226\207/aster-finance-futures-api-v3_CN.md" index b6f2e1e..886dca4 100644 --- "a/V3(Recommended)/\344\270\255\346\226\207/aster-finance-futures-api-v3_CN.md" +++ "b/V3(Recommended)/\344\270\255\346\226\207/aster-finance-futures-api-v3_CN.md" @@ -99,6 +99,10 @@ - [获取用户MMP (USER_DATA)](#获取用户mmp-user_data) - [删除用户MMP (USER_DATA)](#删除用户mmp-user_data) - [重置用户MMP (USER_DATA)](#重置用户mmp-user_data) + - [策略下单 (TRADE)](#策略下单-trade) + - [更新策略订单 (TRADE)](#更新策略订单-trade) + - [查询策略当前挂单 (USER_DATA)](#查询策略当前挂单-user_data) + - [查询策略历史订单 (USER_DATA)](#查询策略历史订单-user_data) - [绑定子账户 (USER_DATA)](#绑定子账户-user_data) - [创建子账户 (TRADE)](#创建子账户-trade) - [查询子账户列表 (USER_DATA)](#查询子账户列表-user_data) @@ -3963,6 +3967,256 @@ POST /fapi/v3/mmpReset`` ------------ | ------------ | ------------ | ------------ symbol | STRING | YES +## 策略下单 (TRADE) + +> **响应:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "updateTime": 1699900000000, + "failureCode": 0, + "failureReason": "" +} +``` + +`POST /fapi/v3/placeStrategyOrder` + +下策略订单。支持 OTO(一单触发另一单)、OCO(一单取消另一单)、OTOCO(一单触发并取消另外两单)三种策略类型。 + +**权重:** 50 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| clientStrategyId | STRING | NO | 客户端自定义策略 ID | +| strategyType | ENUM | YES | 策略类型:`OTO`、`OCO`、`OTOCO` | +| subOrderList | JSON Array | YES | 子订单列表。`OTO` 和 `OCO` 恰好需要 2 个子订单;`OTOCO` 恰好需要 3 个 | + +**`subOrderList` 中每个子订单的字段:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| strategySubId | STRING | YES | 子订单序号,从 1 开始,必须与数组位置保持一致 | +| securityType | STRING | YES | 订单的资产类型 | +| symbol | STRING | YES | 交易对 | +| side | STRING | YES | `BUY` 或 `SELL` | +| positionSide | STRING | NO | `BOTH`、`LONG`、`SHORT`,单向持仓模式下默认 `BOTH` | +| type | STRING | YES | `LIMIT`、`MARKET`、`STOP`、`STOP_MARKET`、`TAKE_PROFIT`、`TAKE_PROFIT_MARKET`、`TRAILING_STOP_MARKET` | +| quantity | STRING | YES* | 委托数量。`closePosition=true` 时可不填 | +| price | STRING | YES* | `LIMIT`、`STOP`、`TAKE_PROFIT` 时必填 | +| stopPrice | STRING | YES* | `STOP`、`STOP_MARKET`、`TAKE_PROFIT`、`TAKE_PROFIT_MARKET` 时必填 | +| timeInForce | STRING | YES* | `LIMIT` 时必填;止损类订单可选(默认 `GTC`)。不支持 `IOC` 和 `FOK` | +| workingType | STRING | NO | `CONTRACT_PRICE` 或 `MARK_PRICE`,默认 `CONTRACT_PRICE` | +| reduceOnly | STRING | NO | 是否仅减仓 | +| closePosition | STRING | NO | 是否全部平仓 | +| priceProtect | STRING | NO | 是否开启价格保护 | +| clientOrderId | STRING | NO | 客户端自定义订单 ID | +| activationPrice | STRING | NO | `TRAILING_STOP_MARKET` 专用激活价格 | +| callbackRate | STRING | NO | `TRAILING_STOP_MARKET` 回调比例 | +| firstDrivenId | STRING | NO | 第一触发条件的驱动子订单 `strategySubId` | +| firstDrivenOn | STRING | NO | 激活第一触发条件的事件类型 | +| firstTrigger | STRING | NO | 第一触发动作 | +| secondDrivenId | STRING | NO | 第二触发条件的驱动子订单 `strategySubId` | +| secondDrivenOn | STRING | NO | 激活第二触发条件的事件类型 | +| secondTrigger | STRING | NO | 第二触发动作 | + +--- + +## 更新策略订单 (TRADE) + +> **响应:** + +```javascript +[ + { + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "updatedSubOrder": 1, + "updateStatus": "SUCCESS", + "updateTime": 1699900000000, + "failureCode": 0, + "failureReason": "" + } +] +``` + +`POST /fapi/v3/updateStrategyOrder` + +修改已有策略订单中的一个或多个子订单。返回数组,每个子订单对应一条更新结果。 + +**权重:** 50 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| strategyId | LONG | YES | 要修改的策略订单 ID | +| strategyType | ENUM | YES | 策略类型:`OTO`、`OCO`、`OTOCO` | +| subOrderList | JSON Array | YES | 要修改的子订单列表。`OTO`/`OCO` 最多 2 个,`OTOCO` 最多 3 个 | + +**`subOrderList` 中每个子订单的字段:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| strategySubId | STRING | YES | 要修改的子订单序号 | +| securityType | STRING | YES | 资产类型 | +| symbol | STRING | YES | 交易对 | +| side | STRING | YES | `BUY` 或 `SELL` | +| positionSide | STRING | NO | `BOTH`、`LONG`、`SHORT` | +| type | STRING | YES | 订单类型 | +| quantity | STRING | NO | 新委托数量 | +| price | STRING | NO | 新价格(适用于 `LIMIT`、`STOP`、`TAKE_PROFIT`) | +| stopPrice | STRING | NO | 新止损价 | +| timeInForce | STRING | NO | 新的有效方式 | +| workingType | STRING | NO | 新的触发价格类型 | +| reduceOnly | STRING | NO | | +| closePosition | STRING | NO | | +| priceProtect | STRING | NO | | +| activationPrice | STRING | NO | 仅适用于 `TRAILING_STOP_MARKET` | +| callbackRate | STRING | NO | 仅适用于 `TRAILING_STOP_MARKET` | + +--- + +## 查询策略当前挂单 (USER_DATA) + +> **响应:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "WORKING", + "bookTime": 1699900000000, + "updateTime": 1699900001000, + "subOrders": [ + { + "strategyId": 123456789, + "orderId": 987654321, + "clientOrderId": "myOrder1", + "status": "NEW", + "strategySubId": 1, + "firstDrivenId": 0, + "firstDrivenOn": "", + "firstTrigger": "", + "secondDrivenId": 0, + "secondDrivenOn": "", + "secondTrigger": "", + "securityType": "FUTURE", + "symbol": "BTCUSDT", + "side": "BUY", + "positionSide": "LONG", + "type": "LIMIT", + "timeInForce": "GTC", + "quantity": "0.001", + "reduceOnly": false, + "closePosition": false, + "price": "50000", + "avgPrice": "0", + "priceProtect": false, + "stopPrice": "0", + "activatePrice": null, + "callbackRate": null, + "workingType": "CONTRACT_PRICE", + "triggerTime": 0 + } + ] +} +``` + +`GET /fapi/v3/strategyOpenOrder` + +查询当前挂单中的策略订单。`strategyId` 与 `clientStrategyId` 必须且只能提供其中一个。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| strategyId | LONG | NO* | 策略订单 ID | +| clientStrategyId | STRING | NO* | 客户端自定义策略 ID | +| strategyType | STRING | YES | 策略类型:`OTO`、`OCO`、`OTOCO` | + +*`strategyId` 与 `clientStrategyId` 二选一,不可同时传入。 + +--- + +## 查询策略历史订单 (USER_DATA) + +> **响应:** + +```javascript +{ + "strategyId": 123456789, + "clientStrategyId": "myStrategy1", + "strategyType": "OTO", + "strategyStatus": "EXPIRED", + "bookTime": 1699800000000, + "updateTime": 1699800060000, + "subOrders": [ + { + "strategyId": 123456789, + "orderId": 987654321, + "clientOrderId": "myOrder1", + "status": "FILLED", + "strategySubId": 1, + "firstDrivenId": 0, + "firstDrivenOn": "", + "firstTrigger": "", + "secondDrivenId": 0, + "secondDrivenOn": "", + "secondTrigger": "", + "securityType": "FUTURE", + "symbol": "BTCUSDT", + "side": "BUY", + "positionSide": "LONG", + "type": "LIMIT", + "timeInForce": "GTC", + "quantity": "0.001", + "reduceOnly": false, + "closePosition": false, + "price": "50000", + "avgPrice": "50000", + "priceProtect": false, + "stopPrice": "0", + "activatePrice": null, + "callbackRate": null, + "workingType": "CONTRACT_PRICE", + "triggerTime": 1699800030000 + } + ] +} +``` + +`GET /fapi/v3/strategyHistoryOrder` + +查询历史策略订单。`strategyId` 与 `clientStrategyId` 必须且只能提供其中一个。最大可查询范围为 90 天。 + +**权重:** 5 + +**参数:** + +| 名称 | 类型 | 是否必需 | 描述 | +|------|------|---------|------| +| strategyId | LONG | NO* | 策略订单 ID | +| clientStrategyId | STRING | NO* | 客户端自定义策略 ID | +| strategyType | STRING | YES | 策略类型:`OTO`、`OCO`、`OTOCO` | +| startTime | LONG | NO | 起始时间(毫秒),最远可查 90 天前的数据 | +| endTime | LONG | NO | 结束时间(毫秒) | +| limit | INT | NO | 返回条数,默认 500,最大 1000 | + +*`strategyId` 与 `clientStrategyId` 二选一,不可同时传入。 + +--- + # 绑定子账户 (USER_DATA) > **响应:**