查询当前委托

/sapi/v1/trade/order/opens

请求类型: GET

是否验签: 是

接口权限: 读取

限频: 每个account 3秒最多 144 次请求(交易接口3秒最多 72 次请求,查询接口3秒最多 72 次请求) (该account的所有币种和不同到期日的合约的所有私有接口共享该限制) 。

接口描述: 此接口用于查询合约当前未成交的委托单,若全部为否,则全量查询用户所有挂单,并且根据创建时间由早到晚进行排序。

请求地址

环境
地址

线上环境(aws客户首选)

请求参数

参数
数据类型
是否必填
描述
取值范围
默认值

contract_code

String

false

合约代码

margin_mode

String

false

保证金模式

cross:全仓

order_id

String

false

订单id

client_order_id

String

false

用户自定义订单ID

from

long

false

查询的起始id,默认从0开始

limit

Integer

false

分页页面大小,默认为10,最大为100。

direct

String

false

翻页方向,prev, next,默认next

响应参数

参数
数据类型
是否必填
描述
取值范围

id

String

true

查询id

contract_code

String

true

合约代码

永续:"BTC-USDT"... ,交割:"BTC-USDT-210625"...

side

String

true

买卖方向

buy:买 "sell":卖

position_side

String

true

仓位方向

"long":多 "short":空 “both”:单向持仓

type

String

true

订单报价类型

market, limit, post_only

price_match

String

true

最优档位,和price互斥

opponent-对手价、"optimal_5":最优5档,"optimal_10":最优10档,"optimal_20":最优20档

order_id

String

true

订单id

client_order_id

String

true

用户自定义订单ID

margin_mode

String

true

保证金模式

cross:全仓 ;

price

String

true

价格,仅当限价单的时候有效,市价无需输入。

volume

String

true

委托张数。

lever_rate

Long

true

杠杆等级

state

String

true

订单状态

new, partially_filled, filled, partially_canceled, canceled,rejected

order_source

String

true

订单来源

(system:系统、web:用户网页、api:用户API、m:用户M站、risk:风控系统、settlement:交割结算、ios:ios客户端、android:安卓客户端、windows:windows客户端、mac:mac客户端、trigger:计划委托触发、tpsl:止盈止损触发、ADL: adl订单)

reduce_only

boolean

true

只减仓

time_in_force

String

true

枚举fok, ioc, gtc,非必填,默认是gtc

tp_trigger_price

String

true

止盈触发价格

tp_order_price

String

true

止盈委托价格(最优N档委托类型时无需填写价格)

tp_type

String

true

止盈委托类型,不填默认为market: 市价,maket: 限价:limit ,最优5档: optimal_5,最优10档:optimal_10,最优20档:optimal_20

tp_trigger_price_type

String

false

止盈价格触发类型,默认是最新价

last":最新价,"mark":标记价格

sl_trigger_price

String

true

止损触发价格

sl_order_price

String

true

止损委托价格(最优N档委托类型时无需填写价格)

sl_type

String

true

止损委托类型,不填默认为 市价,maket: 限价:limit ,最优5档: optimal_5,最优10档:optimal_10,最优20档:optimal_20

sl_trigger_price_type

String

true

止损价格触发类型,默认是最新价

"last":最新价,"market":标记价格

trade_avg_price

String

true

成交均价

trade_volume

String

true

成交数量

trade_turnover

String

true

成交总金额

fee_currency

String

true

手续费币种,多个则使用","分隔

fee

String

true

总手续费(U)

price_protect

boolean

true

价差保护,默认为false。仅当设置止盈/止损需要该参数。

false 或者 true

profit

String

true

平仓盈亏

contract_type

String

true

合约类型

swap(永续)、this_week(当周)、next_week(次周)、quarter(当季)、next_quarter(次季)

created_time

String

true

订单创建时间, UTC时间戳(MS)

updated_time

String

true

订单更新时间, UTC时间戳(MS)

self_match_prevent

String

true

防自成交

cancel_taker: 撤销taker单 cancel_maker:撤销maker单 cancel_both:撤销全部订单

请求示例

响应示例

最后更新于