> ## Documentation Index
> Fetch the complete documentation index at: https://docs.idax.exchange/llms.txt
> Use this file to discover all available pages before exploring further.

# Futures

## Public

### Security: None

Endpoints under **Public** section can be accessed freely without requiring any API key or signatures.

***

### Test Connectivity

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/ping`
</Note>

This endpoint checks connectivity to the host.

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {}
    ```
  </Tab>
</Tabs>

***

### Check Server Time

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/time`
</Note>

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {
        "serverTime": 1607702400000,
        "timezone": "GMT+08:00"
    }
    ```
  </Tab>
</Tabs>

#### Response:

| Name       | Type   | Example         | Description      |
| ---------- | ------ | --------------- | ---------------- |
| serverTime | long   | `1607702400000` | Server timestamp |
| timezone   | string | `GMT+08:00`     | Server time zone |

***

### Futures List

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/contracts`
</Note>

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    [
        {
            "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,
            "minLever": 1,
            "maxLever": 75,
            "openTakerFee": 0.0002,
            "openMakerFee": 0.0002,
            "closeTakerFee": 0.0002,
            "closeMakerFee": 0.0002
        }
    ]
    ```
  </Tab>
</Tabs>

#### Response:

| Name            | Type   | Example      | Description                                                                   |
| --------------- | ------ | ------------ | ----------------------------------------------------------------------------- |
| symbol          | string | `E-BTC-USDT` | Futures name                                                                  |
| status          | number | `1`          | Status (0: cannot trade, 1: can trade)                                        |
| type            | string | `S`          | Futures type. E: perpetual futures, S: test futures, others are mixed futures |
| side            | number | `1`          | Futures direction (backwards: 0, forward: 1)                                  |
| multiplier      | number | `0.5`        | Futures face value                                                            |
| multiplierCoin  | string | `BTC`        | Futures face value unit                                                       |
| pricePrecision  | number | `4`          | Precision of the price                                                        |
| minOrderVolume  | number | `10`         | Minimum order volume, the unit is "sheet"                                     |
| minOrderMoney   | number | `10`         | Minimum order value                                                           |
| maxMarketVolume | number | `100000`     | Market price order maximum volume, the unit is "sheet"                        |
| maxMarketMoney  | number | `100000`     | Market price order maximum value                                              |
| maxLimitVolume  | number | `100000`     | Limit price order maximum volume, the unit is "sheet"                         |
| maxValidOrder   | number | `100000`     | Maximum valid order quantity                                                  |
| minLever        | number | `5`          | Minimum leverage multiplier                                                   |
| maxLever        | number | `5`          | Maximum leverage multiplier                                                   |
| openTakerFee    | number | `0.0002`     | Taker fee for opening a position                                              |
| openMakerFee    | number | `0.0002`     | Maker fee for opening a position                                              |
| closeTakerFee   | number | `0.0002`     | Taker fee for closing a position                                              |
| closeMakerFee   | number | `0.0002`     | Maker fee for closing a position                                              |

***

## Market

### Security: None

Market section can be accessed freely without requiring any API key or signatures.

***

### Depth

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/depth`
</Note>

Market depth data.

#### Query Parameters

| Name         | Type    | Description                  |
| ------------ | ------- | ---------------------------- |
| limit        | integer | Default 100, Max 100         |
| contractName | string  | Futures Name E.g. E-BTC-USDT |

<Tabs>
  <Tab title="200  Successfully retrieve market depth data">
    ```json theme={"system"}
    {
      "bids": [
        [
          "3.90000000",
          "431.00000000"
        ],
        [
          "4.00000000",
          "431.00000000"
        ]
      ],
      "asks": [
        [
          "4.00000200",
          "12.00000000"
        ],
        [
          "5.10000000",
          "28.00000000"
        ]
      ]
    }
    ```
  </Tab>
</Tabs>

#### Response:

| Name | Type | Example         | Description              |
| ---- | ---- | --------------- | ------------------------ |
| time | long | `1595563624731` | Current timestamp (ms)   |
| bids | list | Look below      | Order book purchase info |
| asks | list | Look below      | Order book selling info  |

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 |

***

### 24hrs ticker

<Note type="info">
  **`GET`** `https://futuersopenapi.idax.exchange/fapi/v1/ticker`
</Note>

24 hour price change statistics.

#### Query Parameters

| Name         | Type   | Description                  |
| ------------ | ------ | ---------------------------- |
| contractName | string | Futures name E.g. E-BTC-USDT |

<Tabs>
  <Tab title="200  Successfully obtain ticker info">
    ```json theme={"system"}
    {
        "high": "9279.0301",
        "vol": "1302",
        "last": "9200",
        "low": "9279.0301",
        "rose": "0",
        "time": 1595563624731
    }
    ```
  </Tab>
</Tabs>

#### Response:

| 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 |

***

### All market tickers

<Note type="info">
  **`GET`** `https://futuersopenapi.idax.exchange/fapi/v1/ticker_all`
</Note>

<Tabs>
  <Tab title="200  Successfully retrieved ticker information">
    ```json theme={"system"}
    {
        "e_btcusdt": {
            "high": "9279.0301",
            "vol": "1302",
            "last": "9200",
            "low": "9279.0301",
            "rose": "0",
            "time": 1595563624731
        },
        "e_ethusdt": {
            "high": "9279.0301",
            "vol": "1302",
            "last": "9200",
            "low": "9279.0301",
            "rose": "0",
            "time": 1595563624731
        }
    }
    ```
  </Tab>
</Tabs>

#### Response:

| 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 |

***

### Get index/marked price

<Note type="info">
  **`GET`** `https://futuersopenapi.idax.exchange/fapi/v1/index`
</Note>

#### Query Parameters

| Name         | Type   | Description                  |
| ------------ | ------ | ---------------------------- |
| contractName | string | Futures name E.g. E-BTC-USDT |
| limit        | string | Default 100, Max 100         |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {
        "markPrice": 581.5,
        "indexPrice": 646.3933333333333,
        "lastFundingRate": 0.001,
        "contractName": "E-ETH-USDT",
        "time": 1608273554063
    }
    ```
  </Tab>
</Tabs>

#### Response:

| Name              | Type   | Example      | Description       |
| ----------------- | ------ | ------------ | ----------------- |
| `indexPrice`      | float  | `0.055`      | Index price       |
| `markPrice`       | float  | `0.0578`     | Marked price      |
| `contractName`    | string | `E-BTC-USDT` | Contract name     |
| `lastFundingRate` | float  | `0.123`      | Current fund rate |

***

### Kline/charts data

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/klines`
</Note>

#### Query Parameters

| Name         | Type    | Description                                                                        |
| ------------ | ------- | ---------------------------------------------------------------------------------- |
| contractName | string  | Futures name E.g. E-BTC-USDT                                                       |
| interval     | string  | K-line interval: `1min`, `5min`, `15min`, `30min`, `1h`, `1day`, `1week`, `1month` |
| limit        | integer | Default 100, Max 300                                                               |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    [
        {
            "high": "6228.77",
            "vol": "111",
            "low": "6228.77",
            "idx": 1594640340,
            "close": "6228.77",
            "open": "6228.77"
        },
        {
            "high": "6228.77",
            "vol": "222",
            "low": "6228.77",
            "idx": 1587632160,
            "close": "6228.77",
            "open": "6228.77"
        },
        {
            "high": "6228.77",
            "vol": "333",
            "low": "6228.77",
            "idx": 1587632100,
            "close": "6228.77",
            "open": "6228.77"
        }
    ]
    ```
  </Tab>
</Tabs>

#### Response:

| Name    | Type  | Example         | Description          |
| ------- | ----- | --------------- | -------------------- |
| `idx`   | long  | `1538728740000` | Start timestamp (ms) |
| `open`  | float | `36.00000`      | Open price           |
| `close` | float | `33.00000`      | Closing price        |
| `high`  | float | `36.00000`      | Max price            |
| `low`   | float | `30.00000`      | Min price            |
| `vol`   | float | `2456.111`      | Trade volume         |

***

## Trading

### Security: TRADE

All interfaces under the transaction require signature and API key verification.

***

### Order creation

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/order`
</Note>

Creation of single new orders.

#### Headers

| Name            | Type   | Description    |
| --------------- | ------ | -------------- |
| X-CH-TS         | string | Timestamp      |
| X-CH-APIKEY     | string | Your API key   |
| X-CH-SIGN       | string | Signature      |
| futures-version | string | Version: `101` |

#### Request Body

| Name          | Type   | Description                                                            |
| ------------- | ------ | ---------------------------------------------------------------------- |
| volume        | number | Order quantity                                                         |
| price         | number | Order price                                                            |
| orderUnit     | number | Order unit: `1` (cont), `2` (sheet), `3` (value). Default: `2`         |
| contractName  | string | Futures name E.g. `E-BTC-USDT`                                         |
| type          | string | Order type: `LIMIT/MARKET`                                             |
| side          | string | Trade direction: `BUY/SELL`                                            |
| open          | string | Open balancing direction: `OPEN/CLOSE`                                 |
| positionType  | number | Hold-up position: `1` full position, `2` restrictive position          |
| clientOrderId | string | Client order identity, a string with length less than 32 bits          |
| timeInForce   | string | Not required when type is `MARKET`. Options: `IOC`, `FOK`, `POST_ONLY` |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {
        "orderId": 256609229205684228
    }
    ```
  </Tab>
</Tabs>

#### Response:

| Name    | Type   | Example              | Description |
| ------- | ------ | -------------------- | ----------- |
| orderId | string | `256609229205684228` | Order ID    |

***

### Condition order creation

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/conditionOrder`
</Note>

#### Headers

| Name            | Type   | Description    |
| --------------- | ------ | -------------- |
| X-CH-TS         | string | Timestamp      |
| X-CH-APIKEY     | string | Your API key   |
| X-CH-SIGN       | string | Signature      |
| futures-version | string | Version: `101` |

#### Request Body

| Name         | Type   | Description                                                    |
| ------------ | ------ | -------------------------------------------------------------- |
| volume       | number | Order quantity                                                 |
| triggerType  | string | Trigger type: `3UP/4DOWN`                                      |
| triggerPrice | string | Trigger price                                                  |
| positionType | number | Hold-up position: `1` full position, `2` restrictive position  |
| orderUnit    | number | Order unit: `1` (cont), `2` (sheet), `3` (value). Default: `2` |
| open         | string | Open balancing direction: `OPEN/CLOSE`                         |
| side         | string | Trade direction: `BUY/SELL`                                    |
| type         | string | Order type: `LIMIT/MARKET`                                     |
| contractName | string | Futures name E.g. `E-BTC-USDT`                                 |
| price        | number | Order price                                                    |

<Tabs>
  <Tab title="200: OK">
    ```json theme={"system"}
    {
        "orderId": 256609229205684228
    }
    ```
  </Tab>
</Tabs>

***

### Cancel order

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/cancel`
</Note>

**Speed limit rules: 20 times/2 seconds**

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name         | Type   | Description                    |
| ------------ | ------ | ------------------------------ |
| contractName | string | Futures name E.g. `E-BTC-USDT` |
| orderId      | string | Order ID                       |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {
        "orderId": 256609229205684228
    }
    ```
  </Tab>
</Tabs>

***

### Cancel all orders

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/cancel_all`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

<Tabs>
  <Tab title="200: OK  A successful response has a code of 0. A code less than 0 indicates an error, and msg contains the reason for the error.">
    ```json theme={"system"}
    {
        "code": "0",
        "msg": "成功",
        "data": null
    }
    ```
  </Tab>
</Tabs>

***

### Order details

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/order`
</Note>

#### Request Body

| Name         | Type   | Description                    |
| ------------ | ------ | ------------------------------ |
| contractName | string | Futures name E.g. `E-BTC-USDT` |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    [
        {
            "side": "BUY",
            "executedQty": 0,
            "orderId": 259396989397942275,
            "price": 10000.0000000000000000,
            "origQty": 1.0000000000000000,
            "avgPrice": 0,
            "transactTime": "1607702400000",
            "action": "OPEN",
            "contractName": "E-BTC-USDT",
            "type": "LIMIT",
            "status": "INIT",
            "tradeFee": 2.700,
            "realizedAmount": 10.8
        }
    ]
    ```
  </Tab>
</Tabs>

#### Response:

| Name             | Type   | Example              | Description                                                                                                                                                         |
| ---------------- | ------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `orderId`        | long   | `150695552109032492` | Order ID (system generated)                                                                                                                                         |
| `contractName`   | string | `E-BTC-USDT`         | Futures name                                                                                                                                                        |
| `price`          | float  | `10.5`               | Order price                                                                                                                                                         |
| `origQty`        | float  | `10.5`               | Order quantity                                                                                                                                                      |
| `executedQty`    | float  | `20`                 | Executed quantity                                                                                                                                                   |
| `avgPrice`       | float  | `10.5`               | Average transaction price                                                                                                                                           |
| `symbol`         | string | `BHTUSDT`            | Coin pair name                                                                                                                                                      |
| `status`         | string | `NEW`                | Order status: `NEW` (new order, not filled), `PARTIALLY_FILLED` (partially filled), `FILLED` (fully filled), `CANCELLED` (already cancelled), `REJECTED` (rejected) |
| `side`           | string | `BUY`                | Order direction: `BUY` (buy long) and `SELL` (sell short)                                                                                                           |
| `action`         | string | `OPEN`               | `OPEN/CLOSE`                                                                                                                                                        |
| `transactTime`   | long   | `1607702400000`      | Order creation time                                                                                                                                                 |
| `tradeFee`       | float  | `2.9`                | Order trade fee                                                                                                                                                     |
| `realizedAmount` | float  | `10.6`               | Order profit                                                                                                                                                        |

***

### Open order

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/openOrders`
</Note>

Obtain open futures — the user's current orders.

#### Query Parameters

| Name         | Type   | Description                                                                    |
| ------------ | ------ | ------------------------------------------------------------------------------ |
| contractName | string | Contract name E.g. `E-BTC-USDT`. If not passed, all contracts will be queried. |

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    [
        {
            "side": "BUY",
            "executedQty": 0,
            "orderId": 259396989397942275,
            "price": 10000.0000000000000000,
            "origQty": 1.0000000000000000,
            "avgPrice": 0,
            "transactTime": "1607702400000",
            "action": "OPEN",
            "contractName": "E-BTC-USDT",
            "type": "LIMIT",
            "status": "INIT"
        }
    ]
    ```
  </Tab>
</Tabs>

#### Response:

| Name           | Type   | Example              | Description                                                                                                                                                         |
| -------------- | ------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `orderId`      | long   | `150695552109032492` | Order ID (system generated)                                                                                                                                         |
| `contractName` | string | `E-BTC-USDT`         | Futures name                                                                                                                                                        |
| `price`        | float  | `4765.29`            | Order price                                                                                                                                                         |
| `origQty`      | float  | `1.01`               | Order quantity                                                                                                                                                      |
| `executedQty`  | float  | `1.01`               | Filled orders quantity                                                                                                                                              |
| `avgPrice`     | float  | `4754.24`            | Filled orders average price                                                                                                                                         |
| `type`         | string | `LIMIT`              | Order type: `LIMIT` (limit price) and `MARKET` (market price)                                                                                                       |
| `side`         | string | `BUY`                | Order direction: `BUY` (buy long) and `SELL` (sell short)                                                                                                           |
| `status`       | string | `NEW`                | Order status: `NEW` (new order, not filled), `PARTIALLY_FILLED` (partially filled), `FILLED` (fully filled), `CANCELLED` (already cancelled), `REJECTED` (rejected) |
| `action`       | string | `OPEN`               | `OPEN/CLOSE`                                                                                                                                                        |
| `transactTime` | long   | `1607702400000`      | Order creation time                                                                                                                                                 |

***

### Order history

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/orderHistorical`
</Note>

#### Headers

| Name        | Type   | Description  |
| ----------- | ------ | ------------ |
| X-CH-SIGN   | string | Signature    |
| X-CH-APIKEY | string | Your API key |
| X-CH-TS     | string | Timestamp    |

#### Request Body

| Name         | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| contractName | string | Futures name E.g. E-BTC-USDT         |
| limit        | string | Lines per page, default 100, max 500 |
| fromId       | long   | Start retrieving from this ID        |

<Tabs>
  <Tab title="200: OK">
    ```json theme={"system"}
    [
        {
            "side": "BUY",
            "clientId": "0",
            "ctimeMs": 1632903411000,
            "positionType": 2,
            "orderId": 777293886968070157,
            "avgPrice": 41000,
            "openOrClose": "OPEN",
            "leverageLevel": 26,
            "type": 4,
            "closeTakerFeeRate": 0.00065,
            "volume": 2,
            "openMakerFeeRate": 0.00025,
            "dealVolume": 1,
            "price": 41000,
            "closeMakerFeeRate": 0.00025,
            "contractId": 1,
            "ctime": "2021-09-29T16:16:51",
            "contractName": "E-BTC-USDT",
            "openTakerFeeRate": 0.00065,
            "dealMoney": 4.1,
            "status": 4
        }
    ]
    ```
  </Tab>
</Tabs>

***

### Profit history

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/profitHistorical`
</Note>

#### Headers

| Name        | Type   | Description  |
| ----------- | ------ | ------------ |
| X-CH-SIGN   | string | Signature    |
| X-CH-APIKEY | string | Your API key |
| X-CH-TS     | string | Timestamp    |

#### Request Body

| Name         | Type   | Description                                                                                                                     |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------- |
| contractName | string | Futures name E.g. E-BTC-USDT. Defaults to all contracts if omitted.                                                             |
| limit        | string | Lines per page, default 100, max 500                                                                                            |
| fromId       | long   | Start retrieving from this ID                                                                                                   |
| startTime    | long   | Timestamp (ms). Example: `1735721190000`                                                                                        |
| endTime      | long   | Timestamp (ms). Example: `1735721190000`. `startTime` and `endTime` must be provided together. Defaults to all time if omitted. |

<Tabs>
  <Tab title="200: OK">
    ```json theme={"system"}
    [
        {
            "side": "SELL",
            "positionType": 2,
            "tradeFee": -5.23575,
            "realizedAmount": 0,
            "leverageLevel": 26,
            "openPrice": 44500,
            "settleProfit": 0,
            "mtime": 1632882739000,
            "shareAmount": 0,
            "openEndPrice": 44500,
            "closeProfit": -45,
            "volume": 900,
            "contractId": 1,
            "historyRealizedAmount": -50.23575,
            "ctime": 1632882691000,
            "id": 8764,
            "capitalFee": 0
        }
    ]
    ```
  </Tab>
</Tabs>

***

### Order record

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/myTrades`
</Note>

#### Query Parameters

| Name         | Type   | Description                          |
| ------------ | ------ | ------------------------------------ |
| contractName | string | Futures name E.g. E-BTC-USDT         |
| limit        | string | Lines per page, default 100, max 500 |
| fromId       | long   | Start retrieving from this trade ID  |

#### Headers

| Name        | Type   | Description  |
| ----------- | ------ | ------------ |
| X-CH-SIGN   | string | Signature    |
| X-CH-APIKEY | string | Your API key |
| X-CH-TS     | string | Timestamp    |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    [
      {
        "symbol": "ETHBTC",
        "id": 100211,
        "bidId": 150695552109032492,
        "askId": 150695552109032493,
        "price": "4.00000100",
        "qty": "12.00000000",
        "time": 1499865549590,
        "isBuyer": true,
        "isMaker": false,
        "fee": "0.001"
      }
    ]
    ```
  </Tab>
</Tabs>

#### Response:

| Name         | Type    | Example              | Description                                                 |
| ------------ | ------- | -------------------- | ----------------------------------------------------------- |
| symbol       | string  | `ETHBTC`             | Coin name (trade pair)                                      |
| tradeId      | number  | `28457`              | Trade ID                                                    |
| bidId        | long    | `150695552109032492` | Buyer order ID                                              |
| askId        | long    | `150695552109032493` | Seller order ID                                             |
| bidUserId    | integer | `10024`              | Buyer user ID                                               |
| askUserId    | integer | `10025`              | Seller user ID                                              |
| price        | float   | `4.01`               | Filled price                                                |
| qty          | float   | `12`                 | Trade quantity                                              |
| amount       | float   | `5.38`               | Filled amount                                               |
| time         | number  | `1499865549590`      | Trade timestamp                                             |
| fee          | number  | `0.001`              | Trading fees                                                |
| side         | string  | `BUY`                | Current order direction: `BUY` (purchase), `SELL` (selling) |
| contractName | string  | `E-BTC-USDT`         | Futures name                                                |
| isMaker      | boolean | `true`               | Is it maker?                                                |
| isBuyer      | boolean | `true`               | Is it buyer?                                                |

***

### Change Position Mode

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/edit_user_position_model`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name                                                | Type    | Description                                                         |
| --------------------------------------------------- | ------- | ------------------------------------------------------------------- |
| contractName <span style={{color:'red'}}>\*</span>  | string  | Futures name E.g. `E-BTC-USDT`                                      |
| positionModel <span style={{color:'red'}}>\*</span> | integer | Position Mode (1. Net Position, 2. Two-way Position) — Enter 1 or 2 |

<Tabs>
  <Tab title="200: OK  Success, code is 0. A code less than 0 indicates an error, and msg provides the reason for the error.">
    ```json theme={"system"}
    {
        "code": "0",
        "msg": "成功",
        "data": null
    }
    ```
  </Tab>
</Tabs>

***

### Change Margin Mode

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/edit_user_margin_model`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name                                               | Type    | Description                                                      |
| -------------------------------------------------- | ------- | ---------------------------------------------------------------- |
| contractName <span style={{color:'red'}}>\*</span> | string  | Futures name E.g. `E-BTC-USDT`                                   |
| marginModel <span style={{color:'red'}}>\*</span>  | integer | Margin Mode (1. Cross Margin, 2. Isolated Margin) — Enter 1 or 2 |

<Tabs>
  <Tab title="200: OK  Success, code is 0. A code less than 0 indicates an error, and msg provides the reason for the error.">
    ```json theme={"system"}
    {
        "code": "0",
        "msg": "成功",
        "data": null
    }
    ```
  </Tab>
</Tabs>

***

### Adjust Position Margin

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/edit_position_margin`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name                                             | Type    | Description   |
| ------------------------------------------------ | ------- | ------------- |
| positionId <span style={{color:'red'}}>\*</span> | integer | Position ID   |
| amount <span style={{color:'red'}}>\*</span>     | number  | Adjust amount |

<Tabs>
  <Tab title="200: OK  Success, code is 0. A code less than 0 indicates an error, and msg provides the reason for the error.">
    ```json theme={"system"}
    {
        "code": "0",
        "msg": "成功",
        "data": null
    }
    ```
  </Tab>
</Tabs>

***

### Change Leverage Ratio

<Note type="success">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/edit_lever`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name                                               | Type    | Description                                   |
| -------------------------------------------------- | ------- | --------------------------------------------- |
| contractName <span style={{color:'red'}}>\*</span> | string  | Futures name E.g. `E-BTC-USDT`                |
| nowLevel <span style={{color:'red'}}>\*</span>     | integer | The leverage ratio to be modified, e.g., `50` |

<Tabs>
  <Tab title="200: OK  Success, code is 0. A code less than 0 indicates an error, and msg provides the reason for the error.">
    ```json theme={"system"}
    {
        "code": "0",
        "msg": "成功",
        "data": null
    }
    ```
  </Tab>
</Tabs>

***

## Account

### Security: USER\_DATA

All interfaces under the account require signature and API key verification.

***

### Account info

<Note type="info">
  **`GET`** `https://futuresopenapi.idax.exchange/fapi/v1/account`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

<Tabs>
  <Tab title="200">
    ```json theme={"system"}
    {
        "account": [
            {
                "marginCoin": "USDT",
                "accountNormal": 999.5606,
                "accountLock": 23799.5017,
                "partPositionNormal": 9110.7294,
                "totalPositionNormal": 0,
                "achievedAmount": 4156.5072,
                "unrealizedAmount": 650.6385,
                "totalMarginRate": 0,
                "totalEquity": 99964804.560,
                "partEquity": 13917.8753,
                "totalCost": 0,
                "sumMarginRate": 873.4608,
                "positionVos": [
                    {
                        "contractId": 1,
                        "contractName": "E-BTC-USDT",
                        "contractSymbol": "BTC-USDT",
                        "positions": [
                            {
                                "id": 13603,
                                "uid": 10023,
                                "contractId": 1,
                                "positionType": 2,
                                "side": "BUY",
                                "volume": 69642.0,
                                "openPrice": 11840.2394,
                                "avgPrice": 11840.3095,
                                "closePrice": 12155.3005,
                                "leverageLevel": 24,
                                "holdAmount": 7014.2111,
                                "closeVolume": 40502.0,
                                "pendingCloseVolume": 0,
                                "realizedAmount": 8115.9125,
                                "historyRealizedAmount": 1865.3985,
                                "tradeFee": -432.0072,
                                "capitalFee": 2891.2281,
                                "closeProfit": 8117.6903,
                                "shareAmount": 0.1112,
                                "freezeLock": 0,
                                "status": 1,
                                "ctime": "2020-12-11T17:42:10",
                                "mtime": "2020-12-18T20:35:43",
                                "brokerId": 21,
                                "marginRate": 0.2097,
                                "reducePrice": 9740.8083,
                                "returnRate": 0.3086,
                                "unRealizedAmount": 2164.5289,
                                "openRealizedAmount": 2165.0173,
                                "positionBalance": 82458.2839,
                                "settleProfit": 0.4883,
                                "indexPrice": 12151.1175,
                                "keepRate": 0.005,
                                "maxFeeRate": 0.0025
                            }
                        ]
                    }
                ]
            }
        ]
    }
    ```
  </Tab>
</Tabs>

#### Response:

| Name      | Type  | Description        |
| --------- | ----- | ------------------ |
| `account` | array | Balance collection |

`account` field:

| Name                | Type   | Example | Description                        |
| ------------------- | ------ | ------- | ---------------------------------- |
| marginCoin          | string | `USDT`  | Margin coin                        |
| accountNormal       | float  | `10.05` | Balance account                    |
| accountLock         | float  | `10.07` | Margin frozen account              |
| partPositionNormal  | float  | `10.07` | Restricted position margin balance |
| totalPositionNormal | float  | `10.07` | Full position initial margin       |
| achievedAmount      | float  | `10.07` | Profit and losses occurred         |
| unrealizedAmount    | float  | `10.05` | Unfilled profit and losses         |
| totalMarginRate     | float  | `10.05` | Full position margin rate          |
| totalEquity         | float  | `10.07` | Full position equity               |
| partEquity          | float  | `10.07` | Restricted position equity         |
| totalCost           | float  | `10.07` | Full position costs                |
| sumMarginRate       | float  | `10.07` | All accounts margin rate           |
| positionVos         | array  |         | Position contract record           |

`positionVos` field:

| Name           | Type    | Example      | Description       |
| -------------- | ------- | ------------ | ----------------- |
| contractId     | integer | `2`          | Futures ID        |
| contractName   | string  | `E-BTC-USDT` | Futures name      |
| contractSymbol | string  | `BTC-USDT`   | Futures coin pair |
| positions      | array   |              | Position details  |

`positions` field:

| Name                  | Type    | Example | Description                                                               |
| --------------------- | ------- | ------- | ------------------------------------------------------------------------- |
| id                    | integer | `2`     | Position ID                                                               |
| uid                   | integer | `10023` | User ID                                                                   |
| positionType          | integer | `1`     | Hold position type (1 full, 2 restrictive)                                |
| side                  | string  | `SELL`  | Hold position direction: `BUY` sell long, `SELL` buy short                |
| volume                | integer | `1`     | Hold quantity, the unit is "sheet"                                        |
| openPrice             | float   | `1.05`  | Open position price                                                       |
| avgPrice              | float   | `1.05`  | Hold average price                                                        |
| closePrice            | float   | `1.05`  | Balancing average price                                                   |
| leverageLevel         | integer | `1`     | Leverage multiple                                                         |
| holdAmount            | float   | `1.05`  | Hold position margin                                                      |
| closeVolume           | integer | `1`     | Balanced quantity                                                         |
| pendingCloseVolume    | integer | `1`     | Number of pending closing orders                                          |
| realizedAmount        | float   | `1.05`  | Profit and losses occurred                                                |
| historyRealizedAmount | float   | `1.05`  | Historic accumulated profit and losses                                    |
| tradeFee              | float   | `1.05`  | Trading fees                                                              |
| capitalFee            | float   | `1.05`  | Capital costs                                                             |
| closeProfit           | float   | `1.05`  | Balancing profit and loss                                                 |
| shareAmount           | float   | `1.05`  | Amount to share                                                           |
| freezeLock            | integer | `0`     | Position freeze status: 0 normal, 1 liquidation freeze, 2 delivery freeze |
| status                | integer | `0`     | Position effectiveness: 0 ineffective, 1 effective                        |
| ctime                 | time    |         | Creation time                                                             |
| mtime                 | time    |         | Update time                                                               |
| brokerId              | integer | `1023`  | Client ID                                                                 |
| lockTime              | time    |         | Liquidation lock time                                                     |
| marginRate            | float   | `1.05`  | Margin rate                                                               |
| reducePrice           | float   | `1.05`  | Price reduction                                                           |
| returnRate            | float   | `1.05`  | Return rate (profit rate)                                                 |
| unRealizedAmount      | float   | `1.05`  | Unfilled profit and losses                                                |
| openRealizedAmount    | float   | `1.05`  | Open position unfilled profit and losses                                  |
| positionBalance       | float   | `1.05`  | Position value                                                            |
| indexPrice            | float   | `1.05`  | Newest marked price                                                       |
| keepRate              | float   | `1.05`  | Scaled minimum kept margin rate                                           |
| maxFeeRate            | float   | `1.05`  | Balancing maximum fees rate                                               |

***

### Account transaction info

<Note type="info">
  **`POST`** `https://futuresopenapi.idax.exchange/fapi/v1/get_user_transaction`
</Note>

#### Headers

| Name        | Type    | Description  |
| ----------- | ------- | ------------ |
| X-CH-SIGN   | string  | Signature    |
| X-CH-APIKEY | string  | Your API key |
| X-CH-TS     | integer | Timestamp    |

#### Request Body

| Name                                            | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| beginTime <span style={{color:'red'}}>\*</span> | string  | Required. Start time — pass in a timestamp.                                                                                                                                                                                                                                                                                                                                                                                                                            |
| endTime <span style={{color:'red'}}>\*</span>   | string  | Required. End time — pass in a timestamp.                                                                                                                                                                                                                                                                                                                                                                                                                              |
| symbol <span style={{color:'red'}}>\*</span>    | string  | Required. The type of margin for the transaction flow: `USDT`, `EXUSD`, `DOGE`                                                                                                                                                                                                                                                                                                                                                                                         |
| page                                            | integer | The current page. Default: `1`                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| limit                                           | integer | Number of items per page. Default: `200`, max: `200`                                                                                                                                                                                                                                                                                                                                                                                                                   |
| assetType                                       | integer | Query account type. Default `0`: Main account. `1`: Bring the order account. `2`: Follow the order account.                                                                                                                                                                                                                                                                                                                                                            |
| langKey                                         | string  | Language type of the returned data. Default: `en_US` (English)                                                                                                                                                                                                                                                                                                                                                                                                         |
| type                                            | string  | Transaction scenario to filter. If not passed, all scenarios are returned. Options: `1` (into), `2` (transfer), `3` (clearing storehouse), `4` (settlement short positions), `5` (capital cost), `6` (open warehouse fee), `7` (unwind fees), `8` (share), `9` (poundage), `10` (give gold), `11` (give gold recovery), `12` (public and private transfer), `13` (unwinding profit and loss), `18` (KOL transfer), `19`–`28` (documentary and single order operations) |

#### Response:

| Name              | Type   | Description                                                                                                                                                                 |
| ----------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| uid               | number | User ID                                                                                                                                                                     |
| contractName      | string | Contract name                                                                                                                                                               |
| contractOtherName | string | Contract other name                                                                                                                                                         |
| timeStamp         | number | Transaction timestamp                                                                                                                                                       |
| type              | string | Transaction type: `fundingFee`, `transferIn`, `transferOut`, `openFee`, `closeFee`, `settlementLossShare`, `shareFee`, `coupon`, `couponRecycle`, `settlementClosePosition` |
| date              | string | Transaction time                                                                                                                                                            |
| amount            | string | Transaction amount                                                                                                                                                          |
| page              | number | Current page count                                                                                                                                                          |
| limit             | number | Number of items per page                                                                                                                                                    |

Transaction record detail fields:

| Name              | Type   | Description                                                                                                                                                                 |
| ----------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                | number | Transaction ID                                                                                                                                                              |
| contractOtherName | string | Contract other name                                                                                                                                                         |
| ctimeMillis       | number | Transaction timestamp                                                                                                                                                       |
| type              | string | Transaction type: `fundingFee`, `transferIn`, `transferOut`, `openFee`, `closeFee`, `settlementLossShare`, `shareFee`, `coupon`, `couponRecycle`, `settlementClosePosition` |
| ctime             | string | Transaction time                                                                                                                                                            |
| amount            | number | Transaction amount                                                                                                                                                          |
| afterBalance      | number | Account balance after the transfer of funds                                                                                                                                 |
| scene             | number | Transaction scene ID                                                                                                                                                        |
| page              | number | Current page                                                                                                                                                                |
| limit             | number | Page size                                                                                                                                                                   |
| count             | number | Total transaction count                                                                                                                                                     |
