杠杆API列表
索引
- 获取自己的放贷信息 lendOrder/get
- 获取自己的借贷信息 borrowOrder/get
- 获取自己的预定放贷信息 lendOrderbook/get
- 获取自己的放贷资产信息 transferAssets/lendAssets
- 获取信用账户资产 transferAssets/borrowAssets
- 获取信用交易深度 borrowDepth/get
- 发起借贷 borrowOrder/autobook
- 还款 borrowOrder/refund
- 发布预定放贷信息 lendOrderbook/publish
- 撤销预定放贷信息 lendOrderbook/cancel
- 信用账户下单 trade/trade
- 信用账户撤单 trade/cancel
获取自己的放贷信息 lendOrder/get
- path: /v1/credit
- method: POST
- cmd: lendOrder/get
参数 | 类型 | 描述 |
---|---|---|
page | int | 页数 |
size | int | 数量 |
coin_symbol | string | 币种 |
status | list | 0-借出 1-部分收回 2-完成 |
请求:
{
"cmd":"lendOrder/get",
"body":{
"page":1,
"status":[
0,
1
],
"coin_symbol":"USDT",
"size":1
}
}
响应:
{
"result": [
{
"result": {
"count": 2,
"page": 1,
"items": [
{
"id": 14,
"user_id": 8114202916,
"coin_id": 60,
"coin_symbol": "USDT",
"amount": "1000.00000000",
"amount_receipt": "0.00000000",
"interest_rate": "0.00200000",
"insurance_rate": "0.10000000",
"fee": "0.00000000",
"insurance": "0.00000000",
"interest": "2.33333324",
"interest_receipt": "0.00000000",
"period": 7,
"expireAt": "2019-11-18T03:00:00.000Z",
"status": 0,
"createdAt": "2019-11-11T03:50:47.000Z",
"days": 1
}
],
"validSymbols": [
"USDT"
]
},
"cmd": "lendOrder/get"
}
]
}
获取自己的借贷信息 borrowOrder/get
- path: /v1/credit
- method: POST
- cmd: borrowOrder/get
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 交易币种 | USDT, EOS... | |
pair | true | string | 仓位 | BTC_USDT, ETH_USDT, *_USDT-全仓 | |
status | true | int或Array | 订单状态 | 0未成交, 1借款成功, 2部分还款, 3-6已完成 | |
page | true | integer | 第几页 | 从1开始 | |
size | true | integer | 每页数量 | 1-50 |
请求:
{
"cmd":"borrowOrder/get",
"body":{
"page":1,
"status":[
1,
2
],
"size":10,
"pair":"BTC_USDT"
}
}
响应:
{
"result": [
{
"result": {
"count": 2,
"page": 1,
"items": [
{
"id": 539354,
"user_id": 8114202916,
"coin_id": 60,
"coin_symbol": "USDT",
"pair": "BTC_USDT",
"amount": "406.00000000",
"amount_refund": "0.00000000",
"interest_rate": "0.00010000",
"interest_rate_hour": "0.00000417",
"interest": "0.26559180",
"interest_refund": "0.00000000",
"period": 7,
"expireAt": "2019-11-15T11:00:00.000Z",
"status": 1,
"createdAt": "2019-11-08T11:53:15.000Z"
}
],
"validSymbols": [
{
"coin_symbol": "USDT",
"pair": "BTC_USDT"
}
]
},
"cmd": "borrowOrder/get"
}
]
}
获取自己的放贷挂单信息 lendOrderbook/get
- path: /v1/credit
- method: POST
- cmd: lendOrderbook/get
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 交易币种 | USDT, EOS, ... | |
status | true | integer或integerArray | 订单状态 | 0未成交, 1部分成交, 2已完成 | |
page | true | integer | 第几页 | 从1开始 | |
size | true | integer | 每页数量 | 1-50 |
请求:
{
"cmd":"lendOrderbook/get",
"body":{
"page":1,
"status":[
0,
1
],
"coin_symbol":"EOS",
"size":50
}
}
响应:
{
"result":{
"count":1,
"page":1,
"items":[
{
"id":1,
"user_id":10000000,
"coin_id":61,
"coin_symbol":"EOS",
"amount":5, // 待成交数量
"amount_finish":0, // 已成交数量
"interest_rate":0.001, // 利率
"period":7,
"expireAt":"2018-12-29T10:59:18.000Z",
"status":0,
"createdAt":"2018-12-22T10:59:18.000Z"
}
],
"validSymbols":[
"EOS"
]
},
"cmd":"lendOrderbook/get"
}
获取自己的放贷资产信息 transferAssets/lendAssets
- path: /v1/credit
- method: POST
- cmd: transferAssets/lendAssets
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 交易币种 | USDT, EOS, ... |
请求:
{
"cmd":"transferAssets/lendAssets",
"body":{
"coin_symbol":"EOS"
}
}
响应:
{
"result":{
"balance":"1.52319980", // 可用余额
"lend":"0.00000000", // 待收贷款数量
"lend_book":"0.00000000", // 预订贷款数量
"interest":"0.00000000", // 待收利息
"lend_receipt":"1.44000000", // 已收贷款数量
"interest_receipt":"0.16115200" // 已收利息
},
"cmd":"transferAssets/lendAssets"
}
获取自己的借款资产信息 transferAssets/borrowAssets
- path: /v1/credit
- method: POST
- cmd: transferAssets/borrowAssets
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
pair | true | string | 仓位 | BTC_USDT, ETH_USDT, *_USDT-全仓 |
请求:
{
"cmd":"transferAssets/borrowAssets",
"body":{
"pair":"BTC_USDT",
}
}
响应:
{
"result": [
{
"result": {
"pair": "BTC_USDT",
"currency_deposit": "8406.00000000",
"currency_borrow": "506.34642529",
"currency_can_borrow": "70590.53574710",
"currency_borrow_book": "0",
"margin_radio": "1660.13",
"leverage_ratio": 3, //杠杆倍数(废弃)
"max_leverage_ratio": 10, //最大支持杠杆倍数(新)
"force_price": "0",
"bust_price": "0",
"items": [
{
"coin_symbol": "BTC",
"coin_id": 42,
"balance": "0.00000000",
"freeze": "0.00000000",
"borrow": "0",
"can_transfer_credit": "0.00000000",
"can_transfer_main": "0",
"can_borrow": "8.82381696",
"borrow_book": "0",
"force_price": "0",
"bust_price": "0",
"price": "8000",
"interest": "0",
"total": "0.00000000"
},
{
"coin_symbol": "USDT",
"coin_id": 60,
"balance": "8406.00000000",
"freeze": "0.00000000",
"borrow": "506.34642529",
"can_transfer_credit": "7494.57643447",
"can_transfer_main": "5000.00000000",
"can_borrow": "70590.53574710",
"borrow_book": "0",
"force_price": "0",
"bust_price": "0",
"price": "1",
"interest": "0.34642529",
"total": "8406.00000000"
}
],
"current_leverage_radio": "2", //当前杠杆倍数(新)
"force_deal_radio": 110, //爆仓保证金率(新)
"alert_radio": 115, //报警保证金率(新)
"safe_radio": 200 //强平之后的保证金率(新)
},
"cmd": "transferAssets/borrowAssets"
}
]
}
获取借贷深度 borrowDepth/get
- path: /v1/credit
- method: POST
- cmd: borrowDepth/get
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 币种 | USDT, EOS, ... | |
pair | false | string | 仓位 | BTC_USDT, ETH_USDT, ... |
请求:
{
"cmd":"borrowDepth/get",
"body":{
"coin_symbol":"EOS",
"pair":"EOS_USDT"
}
}
响应:
{
"result":{
"lend":[ // 放款深度
{
"interest_rate":"0.07", //放款利率
"total":"5.20000000", // 放款数量
"number":1
},
{
"interest_rate":"0.08",
"total":"21657.73800000",
"number":19
}
],
"borrow":[// 借款深度
{
"interest_rate":"0.01", // 借款利率
"total":"5.00000000", // 借款数量
"number":1
}
],
"history":[// 成交历史
{
"interest_rate":0.0008,
"amount":"26.480",
"createdAt":"2018-12-19T22:05:21.000Z"
},
{
"interest_rate":0.0008,
"amount":"6000.000",
"createdAt":"2018-12-19T10:24:27.000Z"
}
]
},
"cmd":"borrowDepth/get"
}
发起借贷 borrowOrder/autobook
- path: /v1/credit
- method: POST
- cmd: borrowOrder/autobook
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 需要借款的币种 | EOS, BTC, USDT | |
pair | true | string | 需要借款的仓位 | BTC_USDT, *_USDT | |
amount | true | double | 借款数量 |
请求:
{
"cmd":"borrowOrder/autobook",
"body":{
"coin_symbol": "BTC",
"pair": "BTC_USDT",
"amount":"5.0036"
}
}
响应:
{
"result":"操作成功",
"cmd":"borrowOrder/autobook"
}
还款 borrowOrder/refund
- path: /v1/credit
- method: POST
- cmd: borrowOrder/refund
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 需要还款的币种 | EOS, BTC, USDT | |
pair | true | string | 需要还款的仓位 | BTC_USDT, *_USDT | |
amount | true | double | 还款数量 |
请求:
{
"cmd":"borrowOrder/refund",
"body":{
"coin_symbol": "BTC",
"pair": "BTC_USDT",
"amount":"5.0036"
}
}
响应:
{
"result":"操作成功",
"cmd":"borrowOrder/refund"
}
发布预定放贷信息 lendOrderbook/publish
- path: /v1/credit
- method: POST
- cmd: lendOrderbook/publish
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
coin_symbol | true | string | 交易币种 | USDT, EOS, ... | |
amount | true | double | 放款数量 | ||
interest_rate | true | double | 放款利率 | ||
is_insurance | true | integer | 是否开启保险 | 0或1 | |
force | true | integer | 1 |
请求:
{
"cmd":"lendOrderbook/publish",
"body":{
"coin_symbol":"EOS",
"amount":"5",
"interest_rate":0.001,
"is_insurance":1,
"force":1
}
}
响应:
{
"result":"操作成功",
"cmd":"lendOrderbook/publish"
}
撤销预定放贷信息 lendOrderbook/cancel
- path: /v1/credit
- method: POST
- cmd: lendOrderbook/cancel
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
orderbook_id | true | integer | 订单id |
请求:
{
"cmd":"lendOrderbook/cancel",
"body":{
"orderbook_id":9064
}
}
响应:
{
"result":"操作成功",
"cmd":"lendOrderbook/cancel"
}
信用账户下单 trade/trade
- path: /v1/credit
- method: POST
- cmd: trade/trade
参数 | 类型 | 描述 |
---|---|---|
pair | string | 交易对 |
account_type | integer | 账户类型 1-逐仓账户 257-全仓账户 |
order_type | integer | 交易类型 2-限价单 |
order_side | integer | 交易方向 1-买,2-卖 |
price | string | 委托价格 最小值 0.00000001 |
amount | string | 委托数量 最小值 0.0001 |
money | string | 委托金额 |
请求:
{
"cmd":"trade/trade",
"body":{
"account_type":1,
"pair":"BTC_USDT",
"order_type":2,
"price":"100",
"amount":"1",
"money":"100.0000",
"order_side":1
}
}
响应:
{
"result": [
{
"result": 1,
"cmd": "trade/trade"
}
]
}
信用账户撤单 trade/cancel
- path: /v1/credit
- method: POST
- cmd: trade/cancel
参数名称 | 是否必须 | 类型 | 描述 | 默认值 | 取值范围 |
---|---|---|---|---|---|
orders_id | true | string | 委托单id |
请求:
{
"cmd": "trade/cancel",
"body": {
"orders_id": "4631142976192513" //委托单id
}
}
响应:
{
"result":"ok",
"cmd":"trade/cancel"
}