欢迎使用全新的 WEEX API 文档。需要查看旧版本?切换到旧版文档
WEEX
WEEX 合约 REST API

模拟交易

端点

查询账户余额 Demo (USER_DATA)

查询账户余额 Demo (USER_DATA)。

GET
/capi/v3/sim/balance
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重5

查询账户余额 Demo (USER_DATA) › 响应

200

成功响应

​object[]
asset
​string

资产名称

balance
​string

总余额

availableBalance
​string

可用余额

frozen
​string

冻结资产

unrealizePnl
​string

未实现盈亏


下单 Demo (TRADE)

下单 Demo (TRADE)。

POST
/capi/v3/sim/order
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重0

下单 Demo (TRADE) › 查询参数

symbol
​string · required

交易对,例如 BTCSUSDT。

side
​string · required

买卖方向,取值:BUY、SELL。

positionSide
​string · required

持仓方向,取值:LONG、SHORT。

type
​string · required

订单类型,取值:LIMIT、MARKET。

quantity
​string · required

下单数量,必须大于 0。

newClientOrderId
​string · required

客户自定义订单号(1-36 位,匹配 ^[\.A-Z:/a-z0-9_-]{1,36}$)。

timeInForce
​string

有效方式,type = LIMIT 时必填,取值:GTC、IOC、FOK、POST_ONLY。

price
​string

限价订单价格,type = LIMIT 时必填。

tpTriggerPrice
​string

预设止盈触发价。

slTriggerPrice
​string

预设止损触发价。

TpWorkingType
​string

止盈触发价计算基准,取值:CONTRACT_PRICE、MARK_PRICE,默认 CONTRACT_PRICE。

SlWorkingType
​string

止损触发价计算基准,取值:CONTRACT_PRICE、MARK_PRICE,默认 CONTRACT_PRICE。

下单 Demo (TRADE) › 响应

200

成功响应

orderId
​string

系统生成的订单 ID。

clientOrderId
​string

回显的 newClientOrderId。

success
​boolean

是否受理成功。

errorCode
​string

当 success = false 时返回错误码;成功时为空。

errorMessage
​string

当 success = false 时返回错误信息;成功时为空。


查询全部仓位 Demo (USER_DATA)

查询全部仓位 Demo (USER_DATA)。

GET
/capi/v3/sim/position/allPosition
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重10

查询全部仓位 Demo (USER_DATA) › 响应

200

成功响应

​object[]
id
​integer

仓位 ID

asset
​string

所属抵押品资产

symbol
​string

交易对

side
​string

持仓方向(如 LONG、SHORT)

marginType
​string

保证金模式。CROSSED 表示全仓,ISOLATED 表示逐仓。

separatedMode
​string

分仓模式。COMBINED 表示合仓,SEPARATED 表示分仓。

separatedOpenOrderId
​integer

分仓开仓委托单 ID

leverage
​string

仓位杠杆倍数

size
​string

当前持仓数量

openValue
​string

开仓价值

openFee
​string

开仓手续费

fundingFee
​string

资金费用

marginSize
​string

保证金额度(以保证金币种计)

isolatedMargin
​string

逐仓保证金

isAutoAppendIsolatedMargin
​boolean

是否启用自动追加逐仓保证金(仅逐仓有效)

cumOpenSize
​string

累计开仓数量

cumOpenValue
​string

累计开仓价值

cumOpenFee
​string

累计开仓手续费

cumCloseSize
​string

累计平仓数量

cumCloseValue
​string

累计平仓价值

cumCloseFee
​string

累计平仓手续费

cumFundingFee
​string

累计已结算资金费用

cumLiquidateFee
​string

累计清算(强平)费用

createdMatchSequenceId
​integer

创建时对应撮合引擎序号

updatedMatchSequenceId
​integer

最新更新对应撮合引擎序号

createdTime
​integer

创建时间Unix 毫秒时间戳

updatedTime
​integer

更新时间Unix 毫秒时间戳

unrealizePnl
​string

未实现盈亏

liquidatePrice
​string

预估强平价。为 0 表示当前无爆仓风险


查询历史委托 Demo (USER_DATA)

查询历史委托 Demo (USER_DATA)。

GET
/capi/v3/sim/order/history
https://api-contract.weex.com
请求权重
此端点消耗基于 IP 的请求权重。较重的端点会消耗更多您的 IP 速率限制容量。
请在访问限制章节中了解更多信息。
IP 权重10

查询历史委托 Demo (USER_DATA) › 查询参数

symbol
​string

按交易对过滤。

limit
​integer

每页数量,1-1000,默认 500。

startTime
​integer

起始时间(毫秒),需 ≤ endTime。

endTime
​integer

结束时间(毫秒),与 startTime 间隔不超过 90 天。

page
​integer

页码,从 0 开始,默认 0。

查询历史委托 Demo (USER_DATA) › 响应

200

成功响应

​object[]
orderId
​integer

系统订单 ID。

symbol
​string

交易对。

side
​string

买卖方向,取值见订单方向。

positionSide
​string

持仓方向,取值见持仓模式。

status
​string

订单状态,取值见订单状态。

type
​string

订单类型,取值见订单类型。

time
​integer

下单时间(毫秒)。

price
​string

下单价格。

origQty
​string

原始下单数量。

executedQty
​string

已成交基础资产数量。

avgPrice
​string

平均成交价。

updateTime
​integer

最近更新时间(毫秒)。

clientOrderId
​string

客户自定义订单号。

cumQuote
​string

已成交计价资产数量。

timeInForce
​string

有效方式,取值见时间有效方式。

reduceOnly
​boolean

是否仅减仓。

stopPrice
​string

触发价/止损价(如适用)。

workingType
​string

触发价类型,取值见触发价格类型。