Lending Endpoints

Get all lending markets info

GET /api/v2/lending/markets

Response

{
    "status": 200,
    "data": [
      {
        "symbol": "USDT_BTC",
        "collateralRate": 150,
        "liquidThreshold": 110,
        "minOrderAmount": 10,
        "decInterest": 2,
        "decAmount": 2,
        "fee": 0.005,
        "lastInterest": 10,
        "volume": 0,
        "volume24h": 0,
        "collateralVolume24h": 0,
        "change24h": 0,
        "high24h": 0,
        "low24h": 0
      },
      {
        "symbol": "USDT_ETH",
        "collateralRate": 150,
        "liquidThreshold": 110,
        "minOrderAmount": 1,
        "decInterest": 2,
        "decAmount": 2,
        "fee": 0.005,
        "lastInterest": 11,
        "volume": 0,
        "volume24h": 0,
        "collateralVolume24h": 0,
        "change24h": 0,
        "high24h": 0,
        "low24h": 0
      }
  ]
}

Get one lending market info

GET /api/v2/lending/markets/<symbol>

Parameters

Key Mandatory Data type Description Example
symbol required string lending market symbol USDT_BTC, …

Response

{
  "status": 200,
  "data": {
    "symbol": "USDT_BTC",
    "collateralRate": 150,
    "liquidThreshold": 110,
    "minOrderAmount": 10,
    "decInterest": 2,
    "decAmount": 2,
    "fee": 0.005,
    "lastInterest": 10,
    "volume": 0,
    "volume24h": 0,
    "collateralVolume24h": 0,
    "change24h": 0,
    "high24h": 0,
    "low24h": 0
  }
}

Get ticker

GET /api/v2/lending/get-ticker

Parameters

Key Mandatory Data type Description Example
symbol required string lending market symbol USDT_BTC, …

Response

{
  "status": 200,
  "data": {
      "symbol": "USDT_BTC",
      "volume": 100,
      "change24h": 0,
      "lastInterest": 10,
      "highInterest": 0,
      "lowInterest": 0
  }
}

Get order book

GET /api/v2/lending/get-order-book

Parameters

Key Mandatory Data type Description Example
symbol required string lending market symbol USDT_BTC, …
type option int 11: lend or 10: borrow, ignore if get all 10
limit option int limit record 10

Response

  {
    "status": 200,
    "data": [
        {
            "id": 873,
            "symbol": "USDT_BTC",
            "userId": 4004352,
            "type": 11,
            "interest": 10,
            "amount": 1,
            "remain": 1,
            "term": 33,
            "createdAt": 1577091596,
            "status": 10
        },
        {
            "id": 872,
            "symbol": "USDT_BTC",
            "userId": 4004352,
            "type": 10,
            "interest": 10,
            "amount": 1,
            "remain": 1,
            "term": 30,
            "createdAt": 1577075431,
            "status": 10
        }
    ]
}

Get market history

GET /api/v2/lending/get-market-history

Parameters

Key Mandatory Data type Description Example
symbol required string lending market symbol USDT_BTC, …
limit option int limit record 10

Response

// type 10 is borrow, 11 is lend

  {
  "status": 200,
  "data": [
      {
          "id": 472,
          "symbol": "USDT_BTC",
          "type": 10,
          "interest": 10,
          "amount": 2,
          "term": 33,
          "loanAt": 1576841224,
          "createdAt": 1576841224,
          "closedAt": null
      },
      {
          "id": 470,
          "symbol": "USDT_BTC",
          "type": 10,
          "interest": 10,
          "amount": 1,
          "term": 30,
          "loanAt": 1576830816,
          "createdAt": 1576830816,
          "closedAt": null
      },
      {
          "id": 469,
          "symbol": "USDT_BTC",
          "type": 11,
          "interest": 10,
          "amount": 1,
          "term": 30,
          "loanAt": 1576830787,
          "createdAt": 1576830787,
          "closedAt": null
      },
      {
          "id": 468,
          "symbol": "USDT_BTC",
          "type": 10,
          "interest": 10,
          "amount": 1,
          "term": 20,
          "loanAt": 1576830043,
          "createdAt": 1576830043,
          "closedAt": 1576830621
      }
  ]
}

Transfer balance

POST /api/v2/lending/transfer-balance

Body:

Key Mandatory Data type Description Example
type required int Transfer type 3: exchange to loan or 4: loan to exchange 3
symbol required string token symbol USDT, BTC,…
amount required double amount transfer 0.1
time_stamp required long Time stamp to synchronize with server time (second) 1539703961
recv_window option int Delta delay time with server. Default 5 seconds. 5

Headers

Key Mandatory Data type Description Example
api-key required string Create api-key from profile page 78HUdkjile0kds045dftk5mefjid3gkt
signature requi red string View formula generate signature 6b811e0c4237bf8fb0ae70ae3aba76f2b70595f962cc42b6fed0b9bb33b18ffb

Response

{
  "status": 200,
  "data": "Transfer exchange to loan success"
}

Place order

POST /api/v2/lending/place-order

Body:

Key Mandatory Data type Description Example
type required int 10: Borrow, 11: Lend 10
symbol required string lending market symbol USDT_BTC, …
amount required double amount lending 0.1
interest required double anual percentage rate 10
term required int days 30
time_stamp required long Time stamp to synchronize with server time (second) 1539703961
recv_window option int Delta delay time with server. Default 5 seconds. 5

Headers

Key Mandatory Data type Description Example
api-key required string Create api-key from profile page 78HUdkjile0kds045dftk5mefjid3gkt
signature requi red string View formula generate signature 6b811e0c4237bf8fb0ae70ae3aba76f2b70595f962cc42b6fed0b9bb33b18ffb

Response

// lend
{
  "status": 200,
  "message": "Add lend order success!",
  "data": {
    "uid": "6y227ffkb0ihz0c",
    "type": 11,
    "amount": 10,
    "interest": 10,
    "term": 22
  }
}

// borrow
{
  "status": 200,
  "message": "Borrow USDT success",
  "data": {
    "uid": "6y227ffkb0ihz0c",
    "type": 10,
    "amount": 10,
    "interest": 10,
    "term": 22
  }
}

Cancel order

POST /api/v2/lending/cancel-order

Body:

Key Mandatory Data type Description Example
id required int order id 871
symbol required string lending market symbol USDT_BTC, …
time_stamp required long Time stamp to synchronize with server time (second) 1539703961
recv_window option int Delta delay time with server. Default 5 seconds. 5

Headers

Key Mandatory Data type Description Example
api-key required string Create api-key from profile page 78HUdkjile0kds045dftk5mefjid3gkt
signature requi red string View formula generate signature 6b811e0c4237bf8fb0ae70ae3aba76f2b70595f962cc42b6fed0b9bb33b18ffb

Response

{
  "status": 200,
  "data": "Cancel loan order success"
}

Get my orders

GET /api/v2/lending/get-my-orders

Order Status

Name Value
ORDER_PENDING_STATUS 0
ORDER_MATCHING_PENDING_STATUS 10
ORDER_CANCELED_STATUS 2
ORDER_FINISHED_STATUS 1
ORDER_FAILED_STATUS -1

Parameters

Key Mandatory Data type Description Example
symbol option string lending market symbol USDT_BTC, …
page option int current page 1
limit option int number record show on page 10
status option int order status, ignore if get all 1
from option long unix time stamp 1577075222
to option long unix time stamp 1577076871
time_stamp required long Time stamp to synchronize with server time (second) 1539703961
recv_window option int Delta delay time with server. Default 5 seconds. 5

Headers

Key Mandatory Data type Description Example
api-key required string Create api-key from profile page 78HUdkjile0kds045dftk5mefjid3gkt
signature requi red string View formula generate signature 6b811e0c4237bf8fb0ae70ae3aba76f2b70595f962cc42b6fed0b9bb33b18ffb

Response

{
  "status": 200,
  "totalPage": 2,
  "data": [
      {
          "id": 879,
          "symbol": "USDT_BTC",
          "type": 11,
          "interest": 10,
          "amount": 1,
          "remain": 1,
          "term": 22,
          "createdAt": 1577186833,
          "status": 10
      },
      {
          "id": 878,
          "symbol": "USDT_BTC",
          "type": 10,
          "interest": 10,
          "amount": 1,
          "remain": 1,
          "term": 20,
          "createdAt": 1577186771,
          "status": 10
      },
      {
          "id": 873,
          "symbol": "USDT_BTC",
          "type": 11,
          "interest": 10,
          "amount": 1,
          "remain": 1,
          "term": 33,
          "createdAt": 1577091596,
          "status": 10
      },
      {
          "id": 872,
          "symbol": "USDT_BTC",
          "type": 10,
          "interest": 10,
          "amount": 1,
          "remain": 1,
          "term": 30,
          "createdAt": 1577075431,
          "status": 10
      },
      {
          "id": 871,
          "symbol": "USDT_BTC",
          "type": 11,
          "interest": 10,
          "amount": 1,
          "remain": 1,
          "term": 20,
          "createdAt": 1577075222,
          "status": 2
      }
  ]
}

Get my trading

GET /api/v2/lending/get-my-trading

Transaction Status

Name Value
LOAN_MATCH_STATUS_OPENED 0
LOAN_MATCH_STATUS_FINISHED 1
LOAN_MATCH_STATUS_CANCELED 2
LOAN_MATCH_STATUS_LIQUIDATED 3

Parameters

Key Mandatory Data type Description Example
symbol option string lending market symbol USDT_BTC, …
page option int current page 1
limit option int number record show on page 10
status option int transaction status, ignore if get all 1
from option long unix time stamp 1577075222
to option long unix time stamp 1577076871
time_stamp required long Time stamp to synchronize with server time (second) 1539703961
recv_window option int Delta delay time with server. Default 5 seconds. 5

Headers

Key Mandatory Data type Description Example
api-key required string Create api-key from profile page 78HUdkjile0kds045dftk5mefjid3gkt
signature requi red string View formula generate signature 6b811e0c4237bf8fb0ae70ae3aba76f2b70595f962cc42b6fed0b9bb33b18ffb

Response

{
  "status": 200,
  "totalPage": 1,
  "data": [
    {
        "id": 469,
        "symbol": "USDT_BTC",
        "lendUserId": 4004923,
        "borrowUserId": 4004352,
        "type": 11,
        "interest": 10,
        "amount": 1,
        "term": 30,
        "amountCollateral": 84.13202671,
        "liquidPrice": 0.01307469,
        "entryPrice": 0.01782912,
        "loanAt": 1576830787,
        "createdAt": 1576830787,
        "closedAt": null,
        "status": 0
    },
    {
        "id": 468,
        "symbol": "USDT_BTC",
        "lendUserId": 4004352,
        "borrowUserId": 4004922,
        "type": 10,
        "interest": 10,
        "amount": 1,
        "term": 20,
        "amountCollateral": 83.98745563,
        "liquidPrice": 0.01309719,
        "entryPrice": 0.01785981,
        "loanAt": 1576830043,
        "createdAt": 1576830043,
        "closedAt": 1576830621,
        "status": 2
    },
    {
        "id": 465,
        "symbol": "USDT_BTC",
        "lendUserId": 4004923,
        "borrowUserId": 4004352,
        "type": 11,
        "interest": 10,
        "amount": 0.05,
        "term": 30,
        "amountCollateral": 4.20106875,
        "liquidPrice": 0.01309191,
        "entryPrice": 0.0178526,
        "loanAt": 1576817609,
        "createdAt": 1576817609,
        "closedAt": 1576817620,
        "status": 2
    }
  ]
}