Credit Api List

Index


GetLendOrder lendOrder/get

  • path: /v1/credit
  • method: POST
  • cmd: lendOrder/get
Params Type Comment
page int page
size int size
coin_symbol string symbol
status list Type

Request:

{
    "cmd":"lendOrder/get",
    "body":{
        "page":1,
        "status":[
            0,
            1
        ],
        "coin_symbol":"USDT",
        "size":1
    }
}

Response:

{
    "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"
        }
    ]
}

GetBorrowOrder borrowOrder/get

  • path: /v1/credit
  • method: POST
  • cmd: borrowOrder/get
ParamsName Require Type Comment Default Value
coin_symbol true string coin USDT, EOS...
pair true string position BTC_USDT, ETH_USDT, *_USDT-cross position
status true int/Array status 0 unfill, 1 ok, 2 part Refund, 3-6 finish
page true integer pase 1
size true integer size 1-50

Request:

{
    "cmd":"borrowOrder/get",
    "body":{
        "page":1,
        "status":[
            1,
            2
        ],
        "size":10,
        "pair":"BTC_USDT"
    }
}

Response:

{
    "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"
        }
    ]
}

GetLendBook lendOrderbook/get

  • path: /v1/credit
  • method: POST
  • cmd: lendOrderbook/get
ParamsName Require Type Comment Default Value
coin_symbol true string Symbol USDT, EOS, ...
status true integer/integerArray status 0 unfill, 1 partfill, 2 fill
page true integer page start at 1
size true integer size 1-50

Request:

{
    "cmd":"lendOrderbook/get",
    "body":{
        "page":1,
        "status":[
            0,
            1
        ],
        "coin_symbol":"EOS",
        "size":50
    }
}

Response:

{
    "result":{
        "count":1,
        "page":1,
        "items":[
            {
                "id":1,
                "user_id":10000000,
                "coin_id":61,
                "coin_symbol":"EOS",
                "amount":5, // amount
                "amount_finish":0, // fill amount
                "interest_rate":0.001, // rate
                "period":7,
                "expireAt":"2018-12-29T10:59:18.000Z", 
                "status":0,
                "createdAt":"2018-12-22T10:59:18.000Z" 
            }
        ],
        "validSymbols":[
            "EOS"
        ]
    },
    "cmd":"lendOrderbook/get"
}

GetLendAsset transferAssets/lendAssets

  • path: /v1/credit
  • method: POST
  • cmd: transferAssets/lendAssets
ParamsName Require Type Comment Default Value
coin_symbol true string 交易coin USDT, EOS, ...

Request:

{
    "cmd":"transferAssets/lendAssets",
    "body":{
        "coin_symbol":"EOS"
    }
}

Response:

{
    "result":{
        "balance":"1.52319980", // 可用余额
        "lend":"0.00000000", // 待收贷款size
        "lend_book":"0.00000000", // 预订贷款size
        "interest":"0.00000000", // 待收利息
        "lend_receipt":"1.44000000", // 已收贷款size
        "interest_receipt":"0.16115200" // 已收利息
    },
    "cmd":"transferAssets/lendAssets"
}

GetBorrowAssetInfo transferAssets/borrowAssets

  • path: /v1/credit
  • method: POST
  • cmd: transferAssets/borrowAssets
ParamsName Require Type Comment Default Value
pair true string postion BTC_USDT, ETH_USDT, *_USDT-cross position

Request:

{
    "cmd":"transferAssets/borrowAssets",
    "body":{
        "pair":"BTC_USDT",
    }
}

Response:

{
    "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"
        }
    ]
}

GetBorrowDepth borrowDepth/get

  • path: /v1/credit
  • method: POST
  • cmd: borrowDepth/get
ParamsName Require Type Comment Default Value
coin_symbol true string coin USDT, EOS, ...
pair false string position BTC_USDT, ETH_USDT, ...

Request:

{
    "cmd":"borrowDepth/get",
    "body":{
        "coin_symbol":"EOS",
        "pair":"EOS_USDT"
    }
}

Response:

{
    "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"
}

Borrow borrowOrder/autobook

  • path: /v1/credit
  • method: POST
  • cmd: borrowOrder/autobook
ParamsName Require Type Comment Default Value
coin_symbol true string coin EOS, BTC, USDT
pair true string position BTC_USDT, *_USDT
amount true double size

Request:

{
    "cmd":"borrowOrder/autobook",
    "body":{
        "coin_symbol": "BTC",
        "pair": "BTC_USDT",
        "amount":"5.0036"
    }
}

Response:

{
    "result":"操作成功",
    "cmd":"borrowOrder/autobook"
}

Refund borrowOrder/refund

  • path: /v1/credit
  • method: POST
  • cmd: borrowOrder/refund
ParamsName Require Type Comment Default Value
coin_symbol true string coin EOS, BTC, USDT
pair true string position BTC_USDT, *_USDT
amount true double amount

Request:

{
    "cmd":"borrowOrder/refund",
    "body":{
        "coin_symbol": "BTC",
        "pair": "BTC_USDT",
        "amount":"5.0036"
    }
}

Response:

{
    "result":"ok",
    "cmd":"borrowOrder/refund"
}

PublishLendBook lendOrderbook/publish

  • path: /v1/credit
  • method: POST
  • cmd: lendOrderbook/publish
ParamsName Require Type Comment Default Value
coin_symbol true string coin USDT, EOS, ...
amount true double amount
interest_rate true double rate
is_insurance true integer insurance 0或1
force true integer 1

Request:

{
    "cmd":"lendOrderbook/publish",
    "body":{
        "coin_symbol":"EOS",
        "amount":"5",
        "interest_rate":0.001,
        "is_insurance":1,
        "force":1
    }
}

Response:

{
    "result":"操作成功",
    "cmd":"lendOrderbook/publish"
}

CancelLendBook lendOrderbook/cancel

  • path: /v1/credit
  • method: POST
  • cmd: lendOrderbook/cancel
ParamsName Require Type Comment Default Value
orderbook_id true integer id

Request:

{
    "cmd":"lendOrderbook/cancel",
    "body":{
        "orderbook_id":9064
    }
}

Response:

{
    "result":"操作成功",
    "cmd":"lendOrderbook/cancel"
}

Trade trade/trade

  • path: /v1/credit
  • method: POST
  • cmd: trade/trade
Params Type Comment
pair string trade pair
account_type integer Type 1-isolated 257-cross
order_type integer 2-limit
order_side integer 1buy 2sell
price string min 0.00000001
amount string min 0.0001
money string

Request:

{
    "cmd":"trade/trade",
    "body":{
        "account_type":1,
        "pair":"BTC_USDT",
        "order_type":2,
        "price":"100",
        "amount":"1",
        "money":"100.0000",
        "order_side":1
    }
}

Response:

{
    "result": [
        {
            "result": 1,
            "cmd": "trade/trade"
        }
    ]
}

Cancel trade/cancel

  • path: /v1/credit
  • method: POST
  • cmd: trade/cancel
ParamsName Require Type Comment Default Value
orders_id true string order_id

Request:

{
    "cmd": "trade/cancel",
    "body": {
        "orders_id": "4631142976192513"               //委托单id
    }
}

Response:

{
    "result":"ok",
    "cmd":"trade/cancel"
}

Copyright © bibox.com 2019 all right reserved,powered by GitbookUpdate Date: 2020-03-14

results matching ""

    No results matching ""