下单接口
普通单下单
POST /api/v1/perpetual/products/{contractCode}/order
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Body(json)
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 | |
---|---|---|---|---|---|---|
type | y | string | 类型 | 10 限价 11 市价 | ||
side | y | string | 方向 | open_long 开多 open_short 开空 close_long 平多 close_short 平空 | ||
price | n | string | 价格 | |||
amount | y | int | 数量 | |||
beMaker | n | int | 时间戳 | 0 | 被动委托:0:不被动委托 1:被动委托 | |
positionId | n | long | 持仓id | 分仓模式平仓必传,加仓也可以传 |
Response
{
"id": "1237893454356"
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
id | y | long | 订单id |
条件单下单
POST /api/v1/perpetual/products/{contractCode}/order
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Body(json)
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
positionId | n | long | 持仓id | 分仓模式平仓必传,加仓也可以传 | |
type | y | string | 订单类型 | 12: 条件单 | |
triggerBy | y | string | 触发类型 | 默认mark,标记价格:mark,最新价格:last | |
triggerPrice | y | string | 触发价 | 触发价格 | |
side | y | string | 方向 | open_long 开多 open_short 开空 close_long 平多 close_short 平空 | |
price | n | string | 委托价格 | 触发后下单价格(限价单price必传) | |
currentPrice | n | string | 当前标记价格 | 计划委托时不传;止盈止损时传当前合约价格, 用于判断止盈止损方向 | |
algoType | y | int | 委托类型 | 10-限价,11-市价 | |
amount | y | int | 数量 | 委托数量 |
//计划委托下单
{
"positionId": 12, //持仓id
"type": 12, //type:订单类型,12:条件单
"side": "open_long", //side:触发后开仓方向
"triggerBy": "last", //触发类型:指数价格:index,标记价格:mark,最新价格:last
"triggerPrice": "500", //触发价格
"price": "600.000000", //触发后下单价格(限价单price必传)
"amount": "10", //触发后下单数量
"algoType": 10 //条件单下单类型 10:限价单 11:市价单
}
//止盈止损下单
{
"positionId": 12, //持仓id
"type": 12, //type:订单类型,12:条件单
"amount": 12, //触发后下单数量
"side": "close_long", //side:触发后开仓方向
"triggerBy": "last", //触发类型:指数价格:index,标记价格:mark,最新价格:last
"triggerPrice": "12", //触发价格
"currentPrice": "600.000000", //当前合约价格, 判断止盈止损方向
"algoType": 10, //条件单下单类型 10:限价单 11:市价单
"price": "600.000000", //触发后下单价格(限价单price必传)
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
id | y | long | 订单id |
Response
{
"id": "1237893454356"
}
批量下单
POST /api/v1/perpetual/products/{contractCode}/batch-order
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
[
{
"amount": 1,
"lang": "zh_CN",
"platform": 1,
"price": "2.94",
"side": "open_long",
"type": 10,
"tag": 1
}
]
Body(list-json)
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
positionId | n | long | 持仓id | 分仓模式平仓必传,加仓也可以传 | |
type | y | string | 类型 | 10 限价或条件单 11 市价 | |
side | y | string | 方向 | open_long 开多 open_short 开空 close_long 平多 close_short 平空 | |
price | y | string | 价格 | ||
amount | y | int | 数量 | ||
beMaker | n | int | 时间戳 | 0 | 被动委托:0:不被动委托 1:被动委托 |
ioc | n | int | 订单若不能立即成交则未成交的部分立即取消 | 0 | 0: 关闭,1: 开启 |
tag | n | string | 标签 | 下单时用户所定义的标签,下单后返回 |
Response
[
{
"orderId": 80742077438016,
"tag": "1"
}
]
返回(list-json):
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
id | y | long | 订单id |
订单列表
GET /api/v1/perpetual/products/{contractCode}/list
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Response
[
{
"amount": "300.0000000000000000",
"avgPrice": "0E-16",
"base": "",
"contractCode": "fbtcusd",
"contractDirection": 0,
"createdDate": 1582225542000,
"dealAmount": "0E-16",
"detailSide": "open_long",
"direction": "",
"fee": "0E-16",
"id": 69109290623152,
"orderSize": "0.32258064",
"price": "9300.0000000000000000",
"profit": "0E-16",
"quote": "",
"reason": 0,
"refConditionOrderId": 0,
"refOrderCondition": null,
"side": "long",
"source": "",
"status": 0,
"systemType": 10,
"triggerBy": "",
"triggerPrice": ""
}
]
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
amount | y | string | 数量 | ||
avgPrice | y | string | 平均成交价 | ||
base | y | string | 基础货币名,如btc、fbtc | ||
contractCode | y | string | 是Base和Quote之间的组合 P_BTC_USDT,R_BTC_USDT | ||
contractDirection | y | int | 合约方向 0:正向,1:反向 | ||
createdDate | y | string | 创建时间 | ||
dealAmount | y | string | 已成交数量 | ||
detailSide | y | string | 订单方向 1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
direction | y | string | 条件单:触发方向,greater大于,less小于 | ||
fee | y | string | 该笔订单成交后交的手续费: 正表示得手续费,负表示付手续费 | ||
id | y | long | 订单id | ||
orderSize | y | string | 订单价值 | ||
price | y | string | 委托价格 | ||
profit | y | string | 该笔订单成交后对应的盈亏: 正表示盈利,负表示亏损 | ||
quote | y | string | 计价货币名,usd,cny,usdt | ||
reason | y | int | 该笔订单取消的理由,0是默认值,没有理由 | ||
refConditionOrderId | y | long | 条件单id | ||
refOrderCondition | y | object | 条件单详情 | ||
side | y | string | 订单方向,long多,short空 | ||
source | y | string | 来源 | ||
status | y | int | 状态 0:等待成交 1:部分成交 2:已经成交 -1:已经撤销 | ||
systemType | y | int | 10:限价 11:市价 13:强平单 14:爆仓单 15:穿仓 16:强减 | ||
triggerBy | y | string | 条件单触发类型,指数价格:index,标记价格:mark,最新价格:last | ||
triggerPrice | y | string | 条件单触发价格 |
撤单
DELETE /api/v1/perpetual/products/{contractCode}/order/{id}
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code | ||
id | y | long | 订单id |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Response
{
"code": 200,
"msg": "success",
"data": null
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
code | y | int | 状态,200:成功 | ||
msg | y | string | 提示 | ||
data | y | object |
批量撤单
DELETE /api/v1/perpetual/products/{contractCode}/orders
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Response
{
"code": 200,
"msg": "success",
"data": null
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
code | y | int | 状态,200:成功 | ||
msg | y | string | 提示 | ||
data | y | object |
根据订单号批量撤单
DELETE /api/v1/perpetual/products/{contractCode}/batch-delete-order
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
[
80581909355536,
80581909355537
]
Body(list)
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
id | y | string | 订单号 |
Response
{
"code": 200,
"msg": "success",
"data": null
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
code | y | int | 状态,200:成功 | ||
msg | y | string | 提示 | ||
data | y | object |
订单详情
GET /api/v1/perpetual/products/{contractCode}/{id}
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code | ||
id | y | long | 订单id |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Response
{
"amount": "300.0000000000000000",
"avgPrice": "0E-16",
"base": "",
"contractCode": "fbtcusd",
"contractDirection": 0,
"createdDate": 1582225542000,
"dealAmount": "0E-16",
"detailSide": "open_long",
"direction": "",
"fee": "0E-16",
"id": 69109290623152,
"orderSize": "0.32258064",
"price": "9300.0000000000000000",
"profit": "0E-16",
"quote": "",
"reason": 0,
"refConditionOrderId": 0,
"refOrderCondition": null,
"side": "long",
"source": "",
"status": 0,
"systemType": 10,
"triggerBy": "",
"triggerPrice": ""
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
amount | y | string | 数量 | ||
avgPrice | y | string | 平均成交价 | ||
base | y | string | 基础货币名,如btc、fbtc | ||
contractCode | y | string | 是Base和Quote之间的组合 P_BTC_USDT,R_BTC_USDT | ||
contractDirection | y | int | 合约方向 0:正向,1:反向 | ||
createdDate | y | string | 创建时间 | ||
dealAmount | y | string | 已成交数量 | ||
detailSide | y | string | 订单方向 1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
direction | y | string | 条件单:触发方向,greater大于,less小于 | ||
fee | y | string | 该笔订单成交后交的手续费: 正表示得手续费,负表示付手续费 | ||
id | y | long | 订单id | ||
orderSize | y | string | 订单价值 | ||
price | y | string | 委托价格 | ||
profit | y | string | 该笔订单成交后对应的盈亏: 正表示盈利,负表示亏损 | ||
quote | y | string | 计价货币名,usd,cny,usdt | ||
reason | y | int | 该笔订单取消的理由,0是默认值,没有理由 | ||
refConditionOrderId | y | long | 条件单id | ||
refOrderCondition | y | object | 条件单详情 | ||
side | y | string | 订单方向,long多,short空 | ||
source | y | string | 来源 | ||
status | y | int | 状态 0:等待成交 1:部分成交 2:已经成交 -1:已经撤销 | ||
systemType | y | int | 10:限价 11:市价 13:强平单 14:爆仓单 15:穿仓 16:强减 | ||
triggerBy | y | string | 条件单触发类型,指数价格:index,标记价格:mark,最新价格:last | ||
triggerPrice | y | string | 条件单触发价格 |
市价全平
POST /api/v1/perpetual/products/{contract_code}/{side}/closePosition
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code | ||
side | y | string | 方向 | long 多仓 short 空仓 |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 |
Response
{
"code": 200,
"msg": "success",
"data": null
}
返回:
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
code | y | int | 状态,200:成功 | ||
msg | y | string | 提示 | ||
data | y | object |
历史委托
GET /api/v1/perpetual/products/{contractCode}/history-list
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 | ||
base | n | string | 基础币 | ||
detailSide | n | string | 仓位方向 1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
status | n | int | 状态:1 已成交 2 部分成交已撤销 3 已撤单;多个条件过滤用","分隔 | ||
type | n | int | 合约方向 0:正向,1:反向 | ||
systemType | n | string | 下单类型:10:限价 11:市价 13:强平单 14:爆仓单 15:穿仓 16:强减;多个条件过滤用","分隔 | ||
startDate | n | int | 开始时间 | ||
endTime | n | int | 结束时间 | ||
page | n | int | 第几页 | 1 | |
pageSize | n | int | 页面大小 | 20 | |
stopLimitType | n | int | 计划类型:0 -止盈 1-止损 2-计划委托 |
Response
返回
{
"code": 0,
"msg": "",
"data": {
"total": 0,
"rows": [
{
"id": 0,
"contractCode": "",
"base": "",
"quote": "",
"indexBase": "",
"contractDirection": 0,
"side": "",
"detailSide": "",
"amount": "",
"dealAmount": "",
"avgPrice": "",
"price": "",
"orderSize": "",
"status": 0,
"systemType": 0,
"direction": "",
"profit": "",
"fee": "",
"reason": 0,
"triggerBy": "",
"triggerPrice": "",
"triggerDate": 0,
"modifyDate": 0,
"createdDate": "2022-04-18 16:07:49",
"source": "",
"refConditionOrderId": 0,
"refOrderCondition": {
"id": 0,
"contractCode": "",
"base": "",
"quote": "",
"indexBase": "",
"contractDirection": 0,
"type": "",
"direction": "",
"triggerPrice": "",
"triggerBy": "",
"price": "",
"side": "",
"detailSide": "",
"amount": "",
"avgPrice": "",
"dealAmount": "",
"orderSize": "",
"dealSize": "",
"status": 0,
"reason": 0,
"systemType": 0,
"createdDate": "2022-04-18 16:07:49",
"source": "",
"orderPriceType": 0,
"positionType": 0,
"stopLimitType": 0,
"refOrderId": 0,
"lever": 0,
"unitAmount": "",
"marginDigit": 0,
"marketPriceDigit": 0,
"triggerDate": 0,
"modifyDate": 0,
"tiggerOrderDetail": {
"id": 0,
"price": ""
}
},
"stopLimitType": "",
"lever": "",
"orderPriceType": 0,
"positionType": 0,
"unitAmount": "",
"marginDigit": 0,
"marketPriceDigit": 0,
"stopLoss": {
"id": 0,
"contractCode": "",
"base": "",
"quote": "",
"indexBase": "",
"contractDirection": 0,
"type": "",
"direction": "",
"triggerPrice": "",
"triggerBy": "",
"price": "",
"side": "",
"detailSide": "",
"amount": "",
"avgPrice": "",
"dealAmount": "",
"orderSize": "",
"dealSize": "",
"status": 0,
"reason": 0,
"systemType": 0,
"createdDate": "2022-04-18 16:07:49",
"source": "",
"orderPriceType": 0,
"positionType": 0,
"stopLimitType": 0,
"refOrderId": 0,
"lever": 0,
"unitAmount": "",
"marginDigit": 0,
"marketPriceDigit": 0,
"triggerDate": 0,
"modifyDate": 0,
"tiggerOrderDetail": {
"id": 0,
"price": ""
}
},
"stopProfit": {
"id": 0,
"contractCode": "",
"base": "",
"quote": "",
"indexBase": "",
"contractDirection": 0,
"type": "",
"direction": "",
"triggerPrice": "",
"triggerBy": "",
"price": "",
"side": "",
"detailSide": "",
"amount": "",
"avgPrice": "",
"dealAmount": "",
"orderSize": "",
"dealSize": "",
"status": 0,
"reason": 0,
"systemType": 0,
"createdDate": "2022-04-18 16:07:49",
"source": "",
"orderPriceType": 0,
"positionType": 0,
"stopLimitType": 0,
"refOrderId": 0,
"lever": 0,
"unitAmount": "",
"marginDigit": 0,
"marketPriceDigit": 0,
"triggerDate": 0,
"modifyDate": 0,
"tiggerOrderDetail": {
"id": 0,
"price": ""
}
}
}
]
}
}
Object-data
名称 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|
id | number | ID | ||
contractCode | string | 合约Code | ||
base | string | 基础货币名,如btc | ||
quote | string | 计价货币名,usd,cny,usdt | ||
indexBase | string | 指数货币 | ||
contractDirection | number | 方向 0:正向,1:反向 | ||
side | string | 仓位方向,long多,short空 | ||
detailSide | string | 仓位方向 1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
amount | string | 委托数量 | ||
dealAmount | string | 已成交数量 | ||
avgPrice | string | 平均成交价格 | ||
price | string | 委托价格 | ||
orderSize | string | 委托价值 | ||
status | number | 0 等待成交 1 部分成交 2 已经成交 -1 已经撤销 | ||
systemType | number | 10:限价 11:市价 13:强平单 14:爆仓单 15:穿仓 16:强减 | ||
direction | string | 触发方向,greater大于,less小于 | ||
profit | string | 该笔订单成交后对应的盈亏: 正表示盈利,负表示亏损 | ||
fee | string | 该笔订单成交后交的手续费: 正表示得手续费,负表示付手续费 | ||
reason | number | 该笔订单取消的理由,0是默认值,1 系统撤销,2 用户取消 其他-委托失败 | ||
triggerBy | string | 计划委托类型: index-指数价格market/mark-标记价格mark/last-最新价格last | ||
triggerPrice | string | 触发价格 | ||
triggerDate | number | 触发时间 | ||
modifyDate | number | 最后操作时间 | ||
createdDate | string | 创建时间 | ||
source | string | 来源 | ||
refConditionOrderId | number | 关联的条件订单id | ||
refOrderCondition | OrderCondition | 关联条件单 #Object-OrderCondition | ||
stopLimitType | string | 条件单类型 0 -止盈 1-止损 2-计划委托 | ||
lever | string | 杠杆 | ||
orderPriceType | number | 20 最优20档/10 最优10档/5 最优5档/1 对手价 | ||
positionType | number | 持仓类型 | ||
unitAmount | string | 一张合约对应的quote面值,默认1 | ||
marginDigit | number | 保证金小数位 | ||
marketPriceDigit | number | 标记价格小数位 | ||
stopLoss | object | 关联止损单 #Object-OrderCondition | ||
stopProfit | object | 关联止盈单 #Object-OrderCondition |
Object-OrderCondition
名称 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|
id | number | 条件单id | ||
contractCode | string | 合约code:是Base和Quote之间的组合 | ||
base | string | 基础货币名 | ||
quote | string | 计价货币名 | ||
indexBase | string | 指数货币 | ||
contractDirection | number | 方向 0:正向,1:反向 | ||
type | string | 触发类型:指数价格,标记价格,最新价格 | ||
direction | string | 触发方向,greater大于,less小于 | ||
triggerPrice | string | 触发价格 | ||
triggerBy | string | 计划委托类型: index-指数价格market/mark-标记价格mark/last-最新价格last | ||
price | string | 用户订单委托或者破产价格 | ||
side | string | 仓位方向,long多,short空 | ||
detailSide | string | 1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
amount | string | 委托数量 | ||
avgPrice | string | 平均成交价格 | ||
dealAmount | string | 已成交数量 | ||
orderSize | string | 委托价值 | ||
dealSize | string | 已经成交价值 | ||
status | number | 状态 1:已触发 0、2:未触发 3:预条件单 -1:已撤销 | ||
reason | number | 订单被撤销原因 1:系统撤销 2:用户撤销 3、4、5:触发后委托失败 中间用逗号分割 | ||
systemType | number | 10:限价 11:市价 13:强平单 14:爆仓单 | ||
createdDate | string | 创建时间 | ||
source | string | 来源 | ||
orderPriceType | number | 下单价格类型,对手价:opponent,最优20档:optimal_20,最优10档:optimal_10,最优5档:optimal_5 | ||
positionType | number | 仓位模式 | ||
stopLimitType | number | 条件类型 | ||
refOrderId | number | 关联订单id | ||
lever | number | 杠杆 | ||
unitAmount | string | 单位 | ||
marginDigit | number | 保证金位数 | ||
marketPriceDigit | number | 价格位数 | ||
triggerDate | number | 触发时间 | ||
modifyDate | number | 修改时间 | ||
tiggerOrderDetail | object |
订单交易详情
GET /api/v1/perpetual/products/{contractCode}/orderDetail
请求参数:
路径参数
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
contractCode | y | string | 合约code |
Query
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
AccessKeyId | y | string | 访问key | ||
SignatureVersion | y | string | 版本 | ||
SignatureMethod | y | string | 签名方法 | HmacSHA256 | |
Signature | y | string | 签名 | ||
Timestamp | y | string | 时间戳 | ||
orderId | y | number | 订单ID |
Response
返回
body
{
"code": 200,
"data": {
"amount": "4",
"avgPrice": "342.150000",
"canceledDate": 0,
"contract": {
"amount24": "",
"base": "usdt",
"code": "bchusdt",
"countDownTimeInterval": "",
"direction": 0,
"env": 0,
"fluctuation": "",
"fund": "",
"high": "",
"indexBase": "bch",
"indexPrice": "",
"lastCny": "",
"low": "",
"makerRate": "",
"marginDigit": 6,
"markPrice": "",
"marketPriceDigit": 6,
"maxLever": 0,
"minQuoteDigit": 0,
"minTradeDigit": 0,
"minTradeUnit": 0,
"nextLiquidationInterval": 0,
"openTradeTime": "",
"price": "",
"quote": "usdt",
"size24": "",
"sort": 0,
"takerRate": "",
"totalPosition": "",
"tradeStatus": 0,
"unitAmount": 0.1,
"unitAmountStr": "0.1"
},
"createdDate": 1649925906000,
"currencyCode": "usdt",
"dealAmount": "4",
"dealDetails": [
{
"dealAmount": "4",
"dealDate": 1649925907000,
"fee": "-0.088959",
"markerTaker": 2
}
],
"detailSide": "close_long",
"fee": "-0.088959",
"historyOrderFlag": true,
"lever": "20",
"liquidateExplosionDetail": null,
"orderId": 138434463977680,
"orderPriceType": 0,
"orderSystemType": 11,
"positionType": 1,
"price": "341.686700",
"profit": "-0.560000",
"refConditionOrderId": 0,
"refOrderId": 0,
"refType": 1,
"settingDate": 0,
"side": "short",
"status": 2,
"stopLimitType": 0,
"systemType": 11,
"triggerDate": 0,
"triggerPrice": "",
"unitAmount": "0.1",
"userId": 20600095
},
"msg": "success"
}
data
名称 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|
amount | string | 委托数量 | ||
avgPrice | string | 成交均价 | ||
canceledDate | number | 撤销时间 | ||
contract | object | 合约明细 | ContractNavigation | |
createdDate | number | 创建时间 | ||
currencyCode | string | 币种 | ||
dealAmount | string | 成交数量 | ||
dealDetails | object [] | 成交详情 | item 类型: OrderDealDetail | |
detailSide | string | 详细仓位方向:1.开多open_long 2.开空open_short 3.平多close_long 4.平空close_short | ||
fee | string | 手续费 | ||
historyOrderFlag | boolean | 是否是历史订单 | ||
lever | string | 杠杆 | ||
liquidateExplosionDetail | object | 强平详情 | LiquidateExplosionDetail | |
orderId | number | 订单ID | ||
orderPriceType | number | 订单类型 | ||
positionType | number | 仓位类型 | ||
price | string | 委托价 | ||
profit | string | 收益 | ||
refConditionOrderId | number | 条件单id | ||
settingDate | number | 设置时间 | ||
side | string | 方向 | ||
status | number | 1 部分成交 2 完全成交 -1 已经撤销 0 未成交(当systemType不等于12时) 0 未触发(当systemType等于12时条件单) | ||
stopLimitType | number | 条件单类型 0 -止盈 1-止损 2-计划委托 | ||
systemType | number | 系统类型 10:限价 11:市价 12:条件单 13:强平单 14:爆仓单 15:爆仓 16:强减 | ||
triggerDate | number | 触发时间 | ||
triggerPrice | string | 触发价 |
ContractNavigation
名称 | 是否必须 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|---|
amount24 | y | string | 24小时成交张数 | ||
base | y | string | 基础货币名 | ||
code | y | string | 合约code | ||
contractType | y | string | 合约类型,永续-perpetual、 交割-deliver 、当周交割-week、次周交割-nextWeek、当季交割-quarter、次季交割-nextQuarter | ||
countDownTimeInterval | y | string | 倒计时时间间隔 | ||
direction | y | integer | 方向 0:正向,1:反向 | format: int32 | |
env | y | integer | 是否测试盘 0:线上盘,1:测试盘 | format: int32 | |
fluctuation | y | string | 涨跌幅 | ||
fund | y | string | 资金费率 | ||
high | y | string | 最高价 | ||
indexBase | y | string | 指数货币 | ||
indexPrice | y | string | 指数价格 | ||
lastCny | y | string | 最新价折合人民币 | ||
liquidationDate | y | string | 清算时间 | format: date-time | |
low | y | string | 最低价 | ||
makerRate | y | string | maker 汇率 | ||
marginDigit | y | integer | 保证金精度 | format: int32 | |
markPrice | y | string | 标记价格 | ||
marketPriceDigit | y | integer | 标记价格最小单位(精度) | format: int32 | |
maxLever | y | number | 最大杠杆 | ||
minQuoteDigit | y | integer | 计价货币最小交易小数位 | format: int32 | |
minTradeDigit | y | integer | 基础货币最小交易小数位 | format: int32 | |
minTradeUnit | y | number | 最小交易单位 | ||
nextLiquidationInterval | y | integer | 下一次清算时间差 | format: int64 | |
openTradeTime | y | string | 开盘时间 | ||
price | y | string | 最新价 | ||
quote | y | string | 计价货币名 | ||
size24 | y | string | 24小时成交价值 | ||
sort | y | integer | 排序 | format: int32 | |
takerRate | y | string | taker 汇率 | ||
totalPosition | y | string | 持仓量 | ||
tradeStatus | y | integer | 发布状态:1预发,2上线后7天内,3.上线七天后 | format: int32 | |
unitAmount | y | number | 一张合约对应的quote面值,默认1 |
OrderDealDetail
名称 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|
dealAmount | string | 成交数量 | ||
dealDate | string | 成交时间 | ||
fee | string | 手续费 |
LiquidateExplosionDetail
名称 | 类型 | 描述 | 默认值 | 备注 |
---|---|---|---|---|
contractCode | string | 合约code | ||
explosionPrice | string | 破产价 | ||
feeRate | string | 手续费率 | ||
lever | string | 杠杠 | ||
liquidatePrice | string | 强平价 | ||
maintainRate | string | 维持保证金率 | ||
price | string | 委托价格 | ||
side | string | 方向 |