> For the complete documentation index, see [llms.txt](https://docs.koinbay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.koinbay.com/api/futures-rest-api.md).

# Futures REST API

Base URL: **<https://futuresopenapi.koinbay.com>**  ·  22 endpoints.

## Ping

```
GET  /fapi/v1/ping    Public
```

#### Response 200

```
{}
```

## Server time

```
GET  /fapi/v1/time    Public
```

#### Response 200

```
{
  "timezone": "GMT+08:00",
  "serverTime": 1780475301031
}
```

## Contracts

```
GET  /fapi/v1/contracts    Public
```

#### Response 200

```
[
  {
    "symbol": "E-BTC-USDT", "pricePrecision": 1, "side": 1,
    "maxMarketVolume": 5000000, "multiplier": 0.0001, "maxLever": 150,
    "minOrderVolume": 1, "marginCoin": "USDT", "type": "E",
    "openMakerFee": 0.00025, "openTakerFee": 0.00075,
    "closeMakerFee": 0.00025, "closeTakerFee": 0.00075,
    "multiplierCoin": "BTC", "contractId": 1, "minLever": 0, "status": 1
  }
]
```

## Depth (order book)

```
GET  /fapi/v1/depth    Public
```

#### Query parameters

| Name         | Req | Type    | Description          |
| ------------ | --- | ------- | -------------------- |
| contractName | yes | string  | e.g. E-BTC-USDT      |
| limit        | no  | integer | default 100; max 100 |

#### Response 200

```
{
  "asks": [ [67009.4, 7268], [67018.4, 100000] ],
  "bids": [ [67009.1, 7052], [67008.5, 22933] ],
  "time": null
}
```

## 24hr ticker

```
GET  /fapi/v1/ticker    Public
```

#### Query parameters

| Name         | Req | Type   | Description |
| ------------ | --- | ------ | ----------- |
| contractName | yes | string | <p><br></p> |

#### Response 200

```
{
  "high": "70059.9", "vol": "438447196", "last": "67009.2",
  "low": "65399.9", "buy": 67009.1, "sell": 67009.4,
  "rose": "-0.0426", "time": 1780475301000
}
```

## Index / tag price

```
GET  /fapi/v1/index    Public
```

#### Query parameters

| Name         | Req | Type   | Description               |
| ------------ | --- | ------ | ------------------------- |
| contractName | yes | string | <p><br></p>               |
| limit        | no  | string | no-op for a single object |

#### Response 200

```
{
  "currentFundRate": -8.7e-05,
  "tagPrice": 67009.2,
  "indexPrice": 67041.73666666666,
  "nextFundRate": -8.7e-05
}
```

## Klines / candlesticks

```
GET  /fapi/v1/klines    Public
```

**Notes**:

* Interval set: 1min,5min,15min,30min,1h,1day,1week,1month.

#### Query parameters

| Name         | Req | Type    | Description                                |
| ------------ | --- | ------- | ------------------------------------------ |
| contractName | yes | string  | <p><br></p>                                |
| interval     | yes | string  | 1min,5min,15min,30min,1h,1day,1week,1month |
| limit        | no  | integer | default 100; max 300                       |

#### Response 200

```
[
  { "high": "66999.9", "vol": "39358", "low": "66973.2", "idx": 1780475220000, "close": "66998.5", "open": "66995.8" }
]
```

## Create order

```
POST  /fapi/v1/order    Signed
```

#### Request body (application/json)

<table data-search="false"><thead><tr><th>Field</th><th>Req</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>contractName</td><td>yes</td><td>string</td><td>e.g. E-BTC-USDT</td></tr><tr><td>volume</td><td>yes</td><td>number</td><td>market open: unit is value</td></tr><tr><td>price</td><td>no</td><td>number</td><td>required for LIMIT</td></tr><tr><td>type</td><td>yes</td><td>string</td><td>LIMIT / MARKET</td></tr><tr><td>side</td><td>yes</td><td>string</td><td>BUY / SELL</td></tr><tr><td>open</td><td>yes</td><td>string</td><td>OPEN / CLOSE</td></tr><tr><td>positionType</td><td>no</td><td>number</td><td>1 cross / 2 isolated</td></tr><tr><td>clientOrderId</td><td>no</td><td>string</td><td><br></td></tr><tr><td>timeInForce</td><td>no</td><td>string</td><td>IOC / FOK / POST_ONLY</td></tr></tbody></table>

#### Response 200

```
{
  "orderId": "3302507625176983697"
}
```

## Order information

```
GET  /fapi/v1/order    Signed
```

#### Query parameters

| Name          | Req | Type   | Description |
| ------------- | --- | ------ | ----------- |
| contractName  | yes | string | <p><br></p> |
| orderId       | yes | string | <p><br></p> |
| clientOrderId | no  | string | default 0   |

#### Response 200

```
{
  "side": "BUY", "executedQty": 0, "orderId": 3302507625176983697,
  "origQty": 1.0, "avgPrice": 0.0, "tradeFee": 0.0, "realizedAmount": 0.0,
  "type": "LIMIT", "price": 60281.9, "transactTime": 1780475338000,
  "action": "OPEN", "contractName": "E-BTC-USDT", "timeInForce": "",
  "fills": [], "status": "PENDING_CANCEL"
}
```

## Create condition (trigger) order

```
POST  /fapi/v1/conditionOrder/    Signed
```

#### Request body (application/json)

<table data-search="false"><thead><tr><th>Field</th><th>Req</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>triggerType</td><td>no</td><td>string</td><td>1 stop-loss / 2 take-profit / 3 chase-rise / 4 kill-fall</td></tr><tr><td>triggerPrice</td><td>no</td><td>string</td><td><br></td></tr><tr><td>clientOrderId</td><td>no</td><td>string</td><td><br></td></tr><tr><td>positionType</td><td>no</td><td>number</td><td><br></td></tr><tr><td>open</td><td>no</td><td>string</td><td>OPEN / CLOSE</td></tr><tr><td>side</td><td>no</td><td>string</td><td>BUY / SELL</td></tr><tr><td>type</td><td>no</td><td>string</td><td>LIMIT / MARKET</td></tr><tr><td>contractName</td><td>no</td><td>string</td><td><br></td></tr><tr><td>price</td><td>no</td><td>number</td><td><br></td></tr><tr><td>volume</td><td>no</td><td>number</td><td><br></td></tr></tbody></table>

#### Response 200

```
{
  "code": "0",
  "msg": "Success",
  "data": { "triggerIds": ["622990"], "ids": [], "cancelIds": [] },
  "msgData": null,
  "succ": true
}
```

## Cancel order

```
POST  /fapi/v1/cancel    Signed
```

**Notes**:

* Returns {"orderId":"\<string>"}; cancel is async.

#### Request body (application/json)

| Field        | Req | Type   | Description |
| ------------ | --- | ------ | ----------- |
| contractName | yes | string | <p><br></p> |
| orderId      | yes | string | <p><br></p> |

#### Response 200

```
{
  "orderId": "3302507625176983697"
}
```

## Open orders

```
GET  /fapi/v1/openOrders    Signed
```

#### Query parameters

| Name         | Req | Type   | Description |
| ------------ | --- | ------ | ----------- |
| contractName | no  | string | <p><br></p> |

#### Response 200

```
{
  "code": "0",
  "msg": "success",
  "data": null
}
```

## Order history

```
POST  /fapi/v1/orderHistorical    Signed
```

#### Request body (application/json)

| Field        | Req | Type    | Description           |
| ------------ | --- | ------- | --------------------- |
| contractName | no  | string  | <p><br></p>           |
| limit        | no  | string  | default 100; max 1000 |
| fromId       | no  | integer | <p><br></p>           |

#### Response 200

```
[
  {
    "side": "BUY", "clientId": "0", "ctimeMs": 1780474577000, "positionType": 1,
    "orderId": 3302386455559497370, "avgPrice": 0.0, "realizedAmount": 0.0, "fee": 0.0,
    "openOrClose": "OPEN", "leverageLevel": 5, "source": 3, "type": 1,
    "volume": 1.0, "dealVolume": 0, "price": 60327.0, "contractId": 1,
    "ctime": "2026-06-03T16:16:17", "contractName": "E-BTC-USDT", "dealMoney": 0.0, "status": 4
  }
]
```

## Profit & loss history

```
POST  /fapi/v1/profitHistorical    Signed
```

#### Request body (application/json)

| Field        | Req | Type    | Description |
| ------------ | --- | ------- | ----------- |
| contractName | no  | string  | <p><br></p> |
| limit        | no  | string  | <p><br></p> |
| fromId       | no  | integer | <p><br></p> |

#### Response 200

```
[]
```

## My trades

```
GET  /fapi/v1/myTrades    Signed
```

#### Query parameters

| Name         | Req | Type    | Description           |
| ------------ | --- | ------- | --------------------- |
| contractName | yes | string  | <p><br></p>           |
| limit        | no  | string  | default 100; max 1000 |
| fromId       | no  | integer | <p><br></p>           |

#### Response 200

```
[
  {
    "symbol": "BTC-USDT", "amount": 20.09082, "side": "BUY", "fee": "0.015068115",
    "isMaker": false, "isBuyer": true, "bidId": 1874564572563538130, "bidUserId": 10034,
    "price": 66969.4, "qty": 3, "askId": 1954072405852309104,
    "contractName": "E-BTC-USDT", "time": 1780477419000, "tradeId": 224874818, "askUserId": 10378
  }
]
```

## Positions

```
GET  /fapi/v1/positions    Signed
```

#### Query parameters

| Name         | Req | Type   | Description                                  |
| ------------ | --- | ------ | -------------------------------------------- |
| contractName | yes | string | required; omitting returns -1121 BAD\_SYMBOL |

#### Response 200

```
{
  "positions": [
    {
      "symbol": "E-BTC-USDT", "leverage": 20, "positionType": 1,
      "avgPrice": 66969.4, "positionSide": "BUY", "realizedAmount": 0.0,
      "positionVolume": 3.0, "holdAmount": 0.0, "openPrice": 66969.4,
      "ctime": "2026-06-03T17:03:39", "canCloseVolume": 3.0, "mtime": "2026-06-03T17:03:40"
    }
  ]
}
```

## Change position mode

```
POST  /fapi/v1/edit_user_position_model    Signed
```

#### Request body (application/json)

| Field         | Req | Type    | Description       |
| ------------- | --- | ------- | ----------------- |
| contractName  | yes | string  | <p><br></p>       |
| positionModel | yes | integer | 1 net / 2 two-way |

#### Response 200

```
{
  "code": "0",
  "msg": "success",
  "data": null
}
```

## Change margin mode

```
POST  /fapi/v1/edit_user_margin_model    Signed
```

#### Request body (application/json)

| Field        | Req | Type    | Description          |
| ------------ | --- | ------- | -------------------- |
| contractName | yes | string  | <p><br></p>          |
| marginModel  | yes | integer | 1 cross / 2 isolated |

#### Response 200

```
{
  "code": "0",
  "msg": "success",
  "data": null
}
```

## Change leverage

```
POST  /fapi/v1/edit_lever    Signed
```

#### Request body (application/json)

| Field        | Req | Type   | Description |
| ------------ | --- | ------ | ----------- |
| contractName | yes | string | <p><br></p> |
| nowLevel     | yes | string | e.g. 50     |

#### Response 200

```
{
  "code": "0",
  "msg": "success",
  "data": null
}
```

## Trigger order list

```
POST  /fapi/v1/trigger_order_list    Signed
```

#### Request body (application/json)

| Field        | Req | Type    | Description  |
| ------------ | --- | ------- | ------------ |
| contractName | yes | string  | <p><br></p>  |
| page         | no  | integer | default 1    |
| limit        | no  | integer | default 1000 |

#### Response 200

```
{
  "code": "0", "msg": "success",
  "data": {
    "count": 1,
    "trigOrderList": [
      {
        "triggerOrderId": "622990", "side": "BUY", "triggerPrice": 100568.7,
        "marginCoin": "USDT", "volume": 10000.0, "price": 60341.2,
        "contractId": 1, "contractName": "BTCUSDT", "id": "1880950",
        "triggerType": 3, "open": "OPEN", "status": 0
      }
    ]
  }
}
```

## Cancel trigger order

```
POST  /v1/inner/trigger_order_cancel    Signed
```

#### Request body (application/json)

| Field        | Req | Type    | Description        |
| ------------ | --- | ------- | ------------------ |
| contractName | yes | string  | <p><br></p>        |
| orderId      | yes | integer | the triggerOrderId |

#### Response 200

```
{
  "code": "0",
  "msg": "Success",
  "data": null,
  "msgData": null,
  "succ": true
}
```

## Account

```
GET  /fapi/v1/account    Signed
```

#### Response 200

```
{
  "account": [
    {
      "marginCoin": "USDT", "accountNormal": 999.5606, "accountLock": 23799.5017,
      "achievedAmount": 4156.5072, "unrealizedAmount": 650.6385,
      "totalEquity": 99964804.56, "partEquity": 13917.8753,
      "bonusBalance": null, "walletBalance": null, "availableAmount": null,
      "positionVos": [
        {
          "contractId": 1, "contractName": "E-BTC-USDT", "contractSymbol": "BTC-USDT",
          "positions": [
            { "id": 13603, "uid": 10023, "positionType": 2, "side": "BUY",
              "volume": 69642.0, "openPrice": 11840.2394, "avgPrice": 11840.3095,
              "leverageLevel": 24, "marginRate": 0.2097, "unRealizedAmount": 2164.5289 }
          ]
        }
      ]
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.koinbay.com/api/futures-rest-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
