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

# Account and positions

> Futures API: account and positions.

## Get contract account assets

`GET` `/future/user/v1/compat/balance/list`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| queryAccountId | string | false | N/A | account id | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
        "accountId": 500000000000, // account id
        "userId": 500000000000, // user id
        "coin": "usdt", // Currency
        "underlyingType": 2, // Coin standard, u standard
        "walletBalance": "2078.57264793", // Currency balance
        "openOrderMarginFrozen": "0", // Order frozen
        "isolatedMargin": "0", // Margin freeze
        "crossedMargin": "0", // Full margin freeze
        "amount": "2078.57264793", // Net asset balance
        "totalAmount": "2078.57264793", // Margin balance
        "convertBtcAmount": "0.03638940", // walletBalance wallet asset conversion BTC
        "convertUsdtAmount": "2078.5726", // walletBalance wallet asset conversion to USDT
        "profit": "0", // Profit and loss
        "notProfit": "0", // unrealized profit or loss
        "bonus": "0", // Trial fee
        "coupon": "0" // Deduction
    }
 ],
  "returnCode": 0
}
```

## Get Account Related Information

`GET` `/future/user/v1/account/info`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "accountId": 0, //Account ID
    "allowOpenPosition": false, //Is it possible to open position
    "allowTrade": false, //Is it possible to trade
    "allowTransfer": false, //Is it possible to transfer
    "openTime": "", //Opening time
    "state": 0, //User status
    "userId": 0 //User ID
  },
  "returnCode": 0
}
```

## Get ListenKey

`GET` `/future/user/v1/user/listen-key`

Note:Valid time is 8 hours

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## Open Contract

`POST` `/future/user/v1/account/open`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## Get User's Single Currency Fund Information

`GET` `/future/user/v1/balance/detail`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| coin | string | true | N/A | Currency | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "availableBalance": 0,      //Available balance
    "coin": "",                 //Currency
    "isolatedMargin": 0,        //Frozen isolated margin
    "openOrderMarginFrozen": 0, //Frozen order
    "crossedMargin": 0,         //Crossed Margin
    "bonus": 0,                 //Bouns
    "coupon": 0,                //Coupon
    "walletBalance": 0          //Balance
  },
  "returnCode": 0
}
```

## Get User's Funds Information

`GET` `/future/user/v1/balance/list`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
      "availableBalance": 0,      //Available balance
      "coin": "",                 //Currency
      "isolatedMargin": 0,        //Frozen isolated margin
      "openOrderMarginFrozen": 0, //Frozen order
      "crossedMargin": 0,         //Crossed Margin
      "bonus": 0,                 //Bouns
      "coupon": 0,                //Coupon
      "walletBalance": 0          //Balance
    }
  ],
  "returnCode": 0
}
```

## Get User's Account Flow Information

`GET` `/future/user/v1/balance/bills`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pairs (queries all trading pairs if not passed) | |
| direction | string | false | NEXT | Direction（PREV:Previous page；NEXT:Next page） | PREV;NEXT |
| id | integer | false | N/A | id | |
| limit | integer | false | 10 | Limit | |
| startTime | integer | false | N/A | Start time | |
| endTime | integer | false | N/A | End time | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "hasNext": false, //Is there a next page
    "hasPrev": false, //Is there a previous page
    "items": [ //Datasheets
      {
        "afterAmount": 0, //Balance after change
        "amount": 0, //Quantity
        "coin": "", //Currency
        "createdTime": 0, //Time
        "id": 0, //id
        "side": "", //ADD:transfer in;SUB:transfer out
        "symbol": "", //Trading pair
        "type": "" //EXCHANGE:transfer;CLOSE_POSITION:Offset profit and loss;TAKE_OVER:position takeover;QIANG_PING_MANAGER:Liquidation management fee (fee);FUND:Fund Fee;FEE:Fee(Open position, liquidation, Forced liquidation);ADL:Adl;TAKE_OVER:position takeover;MERGE:Position Merge
      }
    ]
  },
  "returnCode": 0
}
```

## Get Fund Fee Information

`GET` `/future/user/v1/balance/funding-rate-list`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pairs (queries all trading pairs if not passed) | |
| direction | string | false | NEXT | Direction（PREV:Previous page；NEXT:Next page） | PREV;NEXT |
| id | integer | false | N/A | id | |
| limit | integer | false | 10 | Limit | |
| startTime | integer | false | N/A | Start time | |
| endTime | integer | false | N/A | End time | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {
    "hasNext": false, //Is there a next page
    "hasPrev": false, //Is there a previous page
    "items": [ //Datasheets
      {
        "cast": 0, //Fund fee
        "coin": "", //Currency
        "createdTime": 0, //Time
        "id": 0, //id
        "positionSide": "", //Direction
        "symbol": "" //Trading pair
      }
    ]
  },
  "returnCode": 0
}
```

## Get active position information

`GET` `/future/user/v1/position`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | false | N/A | Trading pairs (query the position information of all trading pairs when not uploaded) | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "args": [],
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
      "autoMargin": false, // Whether to automatically call margin
      "availableCloseSize": 0, // Available quantity (Cont)
      "breakPrice": 0, // Blowout price
      "calMarkPrice": 0, // Calculated mark price
      "closeOrderSize": 0, // Quantity of open order (Cont)
      "contractType": "", // Contract Types: PERPETUAL (Perpetual Contract), PREDICT (Predict Contract)
      "entryPrice": 0, // Average opening price
      "floatingPL": 0, // Unrealized profit or loss
      "isolatedMargin": 0, // Warehouse-by-warehouse margin
      "leverage": 0, // Leverage ratio
      "openOrderMarginFrozen": 0, // Occupation of deposit for opening order
      "openOrderSize": 0, // Opening warehouse orders occupied
      "positionSide": "", // Position direction
      "positionSize": 0, // Position quantity (Cont)
      "positionType": "", // Position type: CROSSED (full position); ISOLATED (warehouse by warehouse)
      "profitId": 0, // Take profit and stop loss id
      "realizedProfit": 0, // Realized profit and loss
      "symbol": "", // trading pair
      "triggerPriceType": "", // Trigger price type 1. Index price 2: Mark price (reasonable price); 3: Latest price
      "triggerProfitPrice": 0, // Take profit trigger price
      "triggerStopPrice": 0, // Stop loss trigger price
      "welfareAccount": true
    }
  ],
  "returnCode": 0
}
```

## Get Position Information

`GET` `/future/user/v1/position/list`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | false | N/A | Trading pair (see the position information of all trading pairs if don't pass parameters) | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
      "autoMargin": false, //Whether to automatically call margin
      "availableCloseSize": 0, //Available quantity (Cont)
      "closeOrderSize": 0, //Pending order quantity (Cont)
      "entryPrice": 0, //Open position average price
      "isolatedMargin": 0, //Isolated Margin
      "leverage": 0, //Leverage
      "openOrderMarginFrozen": 0, //Occupied open position margin
      "positionSide": "", //Position side
      "positionSize": 0, //Position quantity (Cont)
      "positionType": "", //Position type
      "realizedProfit": 0, //Realized profit and loss
      "symbol": "" //Trading pair
    }
  ],
  "returnCode": 0
}
```

## Get User's Step Rate

`GET` `/future/user/v1/user/step-rate`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "success",
  "result": {
    "makerFee":"0.00004",
    "takerFee": "0.00001"
  },
  "returnCode": 0
}
```

## Adjust Leverage

`POST` `/future/user/v1/position/adjust-leverage`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pair | |
| positionSide | string | true | N/A | Position side | LONG;SHORT |
| leverage | integer | true | N/A | Leverage | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## Alter Margin

`POST` `/future/user/v1/position/margin`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pair | |
| margin | number | false | N/A | Quantity | |
| positionSide | string | false | N/A | Position side:LONG;SHORT | |
| type | string | false | N/A | Adjust direction (add isolated margin, reduce isolated margin) | ADD;SUB |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## Close All

`POST` `/future/user/v1/position/close-all`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## Get ADL Information

`GET` `/future/user/v1/position/adl`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
      "longQuantile": 0, //long position adl
      "shortQuantile": 0, //Short position adl
      "symbol": "" //Trading pair
    }
  ],
  "returnCode": 0
}
```

## Collect Trading Pair

`POST` `/future/user/v1/user/collection/add`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pair | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## Cancel Trading Pair Collection

`POST` `/future/user/v1/user/collection/cancel`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pair | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": true,
  "returnCode": 0
}
```

## List of Collected Trading Pairs

`GET` `/future/user/v1/user/collection/list`

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [],
  "returnCode": 0
}
```

## Change Position Type

`POST` `/future/user/v1/position/change-type`

Content-Type = application/x-www-form-urlencoded && application/json

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | true | N/A | Trading pair | |
| positionSide | string | true | N/A | Position side | LONG;SHORT |
| positionType | string | true | N/A | Position type | CROSSED;ISOLATED |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": {},
  "returnCode": 0
}
```

## Get Margin Call Information

`GET` `/future/user/v1/position/break-list`

**Parameters**

| Parameter | Type | mandatory | Default | Description | Ranges |
| - | - | - | - | - | - |
| symbol | string | false | N/A | Trading pair (see the margin call of all trading pairs if don't pass parameters) | |

### Limit Flow Rules

200/s/apikey

```json Response theme={null}
{
  "error": {
    "code": "",
    "msg": ""
  },
  "msgInfo": "",
  "result": [
    {
      "breakPrice": 0,    //Margin call price. 0 means no margin call
      "calMarkPrice": 0,  //Mark price
      "contractType": "", //Futures type: PERPETUAL;PREDICT
      "entryPrice": 0,    //Open position average price
      "isolatedMargin": 0,//Isolated Margin
      "leverage": 0,      //Leverage
      "positionSide": "", //Position side:LONG;SHORT
      "positionSize": 0,  //Position quantity (Cont)
      "positionType": "", //Position type:CROSSED;ISOLATED
      "symbol": ""        //Symbol
    }
  ],
  "returnCode": 0
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.