# Contract

## Public

{% hint style="info" %}
Security: None

Endpoints under **Public** section can be accessed freely without requiring any API-key or signatures
{% endhint %}

### 1) Test Connectivity

This endpoint checks connectivity to the host

URL: <https://futuresopenapi.koinbay.com/fapi/v1/ping>

Method: Get

Parameters: No

Success Response:&#x20;

```
{}
```

### 2) Check Server Time

URL: <https://futuresopenapi.koinbay.com/fapi/v1/time>

Method: Get

Parameters: No

Success Response:{

```
{
   "serverTime":1607702400000,
    "timezone":Chinese standard time
}
```

<table><thead><tr><th width="150">name</th><th>type</th><th>example</th><th>description</th></tr></thead><tbody><tr><td>serverTime</td><td>  long</td><td>1607702400000</td><td>server timestamp</td></tr><tr><td>timezone</td><td>string</td><td>China standard time</td><td> server time zone</td></tr></tbody></table>

### 3) Operation Summary

URL: <https://futuresopenapi.koinbay.com/fapi/v1/contracts>

Method: Get

Parameters: No

Success Response:

```
[
    {
        "symbol": "H-HT-USDT",
        "pricePrecision": 8,
        "side": 1,
        "maxMarketVolume": 100000,
        "multiplier": 6,
        "minOrderVolume": 1,
        "maxMarketMoney": 10000000,
        "type": "H",
        "maxLimitVolume": 1000000,
        "maxValidOrder": 20,
        "multiplierCoin": "HT",
        "minOrderMoney": 0.001,
        "maxLimitMoney": 1000000,
        "status": 1
    }
]
```

| Parametera      | Value Format | Sample response | Description                                                                       |
| --------------- | ------------ | --------------- | --------------------------------------------------------------------------------- |
| symbol          | number       | `E-BTC-USDT`    | Contract Name                                                                     |
| status          | string       | 1               | status（0：cannot trade，1：can trade                                                 |
| type            | number       | S               | contract type, E: perpetual contract, S: test contract, others are mixed contract |
| side            | number       | 1               | Contract direction(backwards：0，1：forward)                                         |
| multiplier      | string       | 0.5             | Contract face value                                                               |
| multiplierCoin  | number       | BTC             | Contract face value unit                                                          |
| pricePrecision  | number       | 4               | Precision of the price                                                            |
| minOrderMoney   | number       | 10              | Minimum order volume                                                              |
| minOrderVolume  | number       | 10              | Minimum order value                                                               |
| maxMarketVolume | number       | 100000          | Market price order maximum volume                                                 |
| maxMarketMoney  | number       | 100000          | Market price order maximum value                                                  |
| macLimitVolume  | number       | 100000          | Limit price order maximum volume                                                  |
| maxValidOrder   | number       | 100000          | Maximum valid order quantity                                                      |

## Market

{% hint style="info" %}
Security: None​

Market section can be accessed freely without requiring any API-key or signatures.
{% endhint %}

### 1) Depth

Market Depth Data

URL: <https://futuresopenapi.koinbay.com/fapi/v1/depth>

Parameters

Query

| Query         | Value Format | Value Format                  | Required/Optional |
| ------------- | ------------ | ----------------------------- | ----------------- |
| Limit         | Integer      | Default 100, Max 100          | Required          |
| Contract Name | String       | Contract Name E.g. E-BTC-USDT | Required          |

Success Response:

```json
{
  "bids": [
    [
      "3.90000000",   // price
      "431.00000000"  // quantity
    ],
    [
      "4.00000000",
      "431.00000000"
    ]
  ],
  "asks": [
    [
      "4.00000200",  // price
      "12.00000000"  // quantity
    ],
    [
      "5.10000000",
      "28.00000000"
    ]
  ]
}
```

<table><thead><tr><th>name</th><th width="150">type</th><th>example</th><th>description</th></tr></thead><tbody><tr><td>time</td><td>long</td><td>1595563624731</td><td>Current Timestamp  (ms)</td></tr><tr><td>bids</td><td>list</td><td>Look below</td><td>Order book purchase info</td></tr><tr><td>asks</td><td>list</td><td>Look below</td><td>Order book selling info</td></tr></tbody></table>

The fields bids and asks are lists of order book price level entries, sorted from best to worst.

| name | type  | example | description                               |
| ---- | ----- | ------- | ----------------------------------------- |
| ' '  | float | 131.1   | price level                               |
| ' '  | float | 2.3     | Total order quantity for this price level |

### 2) 24 hours ticker

24 hr price change statistics

URL: <https://futuresopenapi.koinbay.com/fapi/v1/ticker>

Method: Get

Parameters:

| Query         | Value Format | Value Format                   | Required/Optional |
| ------------- | ------------ | ------------------------------ | ----------------- |
| contract name | string       | Contract  name E.g. E-BTC-USDT | Optional          |

Success Response of obtaining ticker info:

<pre class="language-json"><code class="lang-json">{
<strong>    "high": "9279.0301",
</strong>    "vol": "1302",
    "last": "9200",
    "low": "9279.0301",
    "rose": "0",
    "time": 1595563624731
}
</code></pre>

| name | type   | example         | description     |
| ---- | ------ | --------------- | --------------- |
| time | long   | `1595563624731` | Open time       |
| high | float  | 9900            | Higher price    |
| low  | float  | 8800.34         | Lower price     |
| last | float  | 8900            | Newest price    |
| vol  | float  | 4999            | Trade volume    |
| rose | string | +0.5            | Price variation |

### 3) Get index/marked price

URL:  <https://futuresopenapi.koinbay.com/fapi/v1/index>

Method: Get

Parameters

| Query        | Value  format | Value format                  | Required/Optional |
| ------------ | ------------- | ----------------------------- | ----------------- |
| Contact Name | string        | Contract name E.g. E-BTC-USDT | Optional          |
| Limit        | string        | Default 100, Max 100          | Optional          |

Success Responses:

```json
{
    "markPrice": 581.5,
    "indexPrice": 646.3933333333333,
    "lastFundingRate": 0.001,
    "contractName": "E-ETH-USDT",
    "time": 1608273554063
}
```

##

## Trading

{% hint style="warning" %}
Publishing Soon
{% endhint %}

## Account&#x20;

{% hint style="warning" %}
Publishing Soon
{% endhint %}
