杠杆交易

交易

安全类型: TRADE

交易下方的接口都需要签名和API-key验证

post
创建杠杆订单

https://openapi.xxx.com/sapi/v1/margin/order
限速规则:10次/s
Request
Response
Request
Headers
X-CH-SIGN
required
string
签名
X-CH-APIKEY
required
string
您的API-key
X-CH-TS
required
integer
时间戳
Body Parameters
symbol
required
string
币对名称 E.g. BTCUSDT
volume
required
number
订单数量
side
required
string
订单方向, BUY/SELL
type
required
string
订单类型, LIMIT/MARKET
price
optional
number
订单价格, 对于LIMIT订单必须发送
newClientOrderId
optional
string
客户端订单标识
recvWindow
optional
string
时间窗口
Response
200: OK
发送杠杆订单成功
{
'symbol': 'LXTUSDT',
'orderId': '494736827050147840',
'clientOrderId': '157371322565051',
'transactTime': '1573713225668',
'price': '0.005452',
'origQty': '110',
'executedQty': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'SELL'
}

get
杠杆订单查询

https://openapi.xxx.com/sapi/v1/margin/order
Request
Response
Request
Headers
X-CH-SIGN
required
string
签名
X-CH-APIKEY
required
string
您的API-key
X-CH-TS
required
integer
时间戳
Query Parameters
orderId
required
string
订单ID
newClientOrderId
optional
string
客户端订单标识
symbol
required
string
币对名称E.g. BTCUSDT
Response
200: OK
{
'orderId': '499890200602846976',
'clientOrderId': '157432755564968',
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'transactTime': '1574327555669'
}

post
撤销杠杆订单

https://openapi.xxx.com/sapi/v1/margin/cancel
Request
Response
Request
Headers
X-CH-SIGN
required
string
签名
X-CH-APIKEY
required
string
您的API-key
X-CH-TS
required
integer
时间戳
Body Parameters
orderId
required
string
订单id
newClientOrderId
optional
string
客户端订单标识
symbol
required
string
币对名称E.g. BTCUSDT
Response
200: OK
{
'symbol': 'BHTUSDT',
'clientOrderId': '0',
'orderId': '499890200602846976',
'status': 'CANCELED'
}

get
杠杆当前委托

https://openapi.xxx.com/sapi/v1/margin/openOrders
Request
Response
Request
Headers
X-CH-SIGN
required
string
签名
X-CH-APIKEY
required
string
您的API-key
X-CH-TS
required
integer
时间戳
Query Parameters
symbol
required
string
币对名称 E.g. BTCUSDT
limit
optional
integer
默认100; 最大1000
Response
200: OK
[
{
'orderId': '499902955766523648',
'symbol': 'BHTUSDT',
'price': '0.01',
'origQty': '50',
'executedQty': '0',
'avgPrice': '0',
'status': 'NEW',
'type': 'LIMIT',
'side': 'BUY',
'time': '1574329076202'
},...
]

get
杠杆交易记录

https://openapi.xxx.com/sapi/v1/margin/myTrades
Request
Response
Request
Headers
X-CH-SIGN
required
string
签名
X-CH-APIKEY
required
string
您的API-key
X-CH-TS
required
integer
时间戳
Query Parameters
symbol
required
string
币对名称 E.g. BTCUSDT
limit
optional
integer
默认100; 最大1000
fromId
optional
integer
从这个tradeId开始检索
Response
200: OK
[
{
"symbol": "ETHBTC",
"id": 100211,
"bidId": 150695552109032492,
"askId": 150695552109032493,
"price": "4.00000100",
"qty": "12.00000000",
"time": 1499865549590,
"isBuyer": true,
"isMaker": false,
"feeCoin": "ETH",
"fee":"0.001"
},...
]