# Positions Channel

### Description

Data will be pushed when the following events occur:
1. Push on the first-time subscription
2. Push incremental data when close-position orders are placed in the unified trading account
3. Push incremental data when futures positions are opened in the unified trading account
4. Push incremental data when futures positions are closed in the unified trading account
5. Push incremental data when futures close-position orders are modified in the unified trading account
6. Push incremental data when futures close-position orders are cancelled in the unified trading account



<div className="api-aligning">

```json title="Request Example"
{
    "op": "subscribe",
    "args": [
        {
            "instType": "UTA",
            "topic": "position"
        }
    ]
}
```

### Request Parameters

| Parameters    |  Type         | Description                                                          | 
|:--------------|:-----------------------|:---------------------------------------------------------------------|
| op            | String                 | Operation <br/> `subscribe` Subscribe <br/>`unsubscribe` Unsubscribe |
| args          | List&lt;Object&gt;     | Subscribed channel                                                   |
| &gt; instType | String                 | Product type <br/>`UTA` Unified trading account                      |
| &gt; topic    | String                 | Topic `position` Position                                            |




</div>

<div className="api-br-10"></div>

<div className="api-aligning">

```json title="Response Example"
{
  "event": "subscribe",
  "arg": {
    "instType": "UTA",
    "topic": "position"
  },
  "code": "",
  "msg": "",
  "connId": "xxxxxxxxxx"
}
```

### Response Parameters

| Parameters    |  Type   | Description                                                                                            | 
|:--------------|:-----------------|:-------------------------------------------------------------------------------------------------------|
| event         | String           | Operation <br/>`subscribe` Subscription <br/>`unsubscribe` Unsubscription <br/>`error` Parameter error |
| arg           | Object           | Subscribed channel                                                                                     |
| &gt; instType | String           | Product type <br/>`UTA` Unified trading account                                                        |
| &gt; topic    | String           | Topic <br/>`position` Position                                                                         |
| code          | String           | Error code                                                                                             |
| msg           | String           | Error message                                                                                          |
| connId        | String           | Connection ID                                                                                          |

</div>



<div className="api-br-10"></div>

<div className="api-aligning">


```json title="Push Data"
{
  "data": [
    {
      "symbol": "BTCUSDT",
      "leverage": "20",
      "openFeeTotal": "",
      "mmr": "",
      "breakEvenPrice": "",
      "available": "0",
      "liqPrice": "",
      "marginMode": "crossed",
      "unrealisedPnl": "0",
      "markPrice": "94987.1",
      "createdTime": "1736378720620",
      "avgPrice": "0",
      "totalFundingFee": "0",
      "cashDividend": "0",
      "updatedTime": "1736378720620",
      "marginCoin": "USDT",
      "frozen": "0",
      "profitRate": "",
      "closeFeeTotal": "",
      "marginSize": "0",
      "curRealisedPnl": "0",
      "size": "0",
      "positionStatus": "ended",
      "posSide": "long",
      "holdMode": "hedge_mode"
    }
  ],
  "arg": {
    "instType": "UTA",
    "topic": "position"
  },
  "action": "snapshot",
  "ts": 1730711666652
}
```



### Push Parameters

| Parameter            | Type               | Description                                                                                                                                                    |
|----------------------|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| arg                  | Object             | Subscribed channel                                                                                                                                             |
| &gt; instType        | String             | Product type <br/>`UTA` Unified Account                                                                                                                        |
| &gt; topic           | String             | Topic <br/>`position` Position channel                                                                                                                         |
| action               | String             | Action <br/>`snapshot` Full data <br/>`update` Incremental data                                                                                                |
| data                 | List&lt;Object&gt; | Subscribed data                                                                                                                                                |
| &gt; symbol          | String             | Symbol name                                                                                                                                                    |
| &gt; marginCoin      | String             | Margin coin                                                                                                                                                    |
| &gt; marginSize      | String             | Margin size                                                                                                                                                    |
| &gt; marginMode      | String             | Margin mode<br/>`crossed` Cross margin<br/>`isolated` Isolated margin                                                                                          |
| &gt; posSide         | String             | Position side <br/>`long`/`short`                                                                                                                              |
| &gt; holdMode        | String             | Holding mode <br/> `one_way_mode`/`hedge_mode`                                                                                                                 |
| &gt; positionStatus  | String             | Position status <br/> `opening` Ongoing <br/> `ended` Completed                                                                                                |
| &gt; size            | String             | Position size <br/>`size` = `available` + `frozen`                                                                                                             |
| &gt; available       | String             | Available position size                                                                                                                                        |
| &gt; frozen          | String             | Frozen position size                                                                                                                                           |
| &gt; avgPrice        | String             | Average open price                                                                                                                                             |
| &gt; leverage        | String             | Leverage multiple                                                                                                                                              |
| &gt; curRealisedPnl  | String             | Realised PnL                                                                                                                                                   |
| &gt; unrealisedPnl   | String             | Unrealised PnL                                                                                                                                                 |
| &gt; liqPrice        | String             | Estimated liquidation price                                                                                                                                    |
| &gt; mmr             | String             | Maintain margin rate                                                                                                                                           |
| &gt; marginRate      | String             | Margin rate                                                                                                                                                    |
| &gt; markPrice       | String             | Mark Price                                                                                                                                                     |
| &gt; openFeeTotal    | String             | Total opening fee                                                                                                                                              |
| &gt; closeFeeTotal   | String             | Total closing fee                                                                                                                                              |
| &gt; breakEvenPrice  | String             | Break-even price                                                                                                                                               |
| &gt; profitRate      | String             | Profit rate<br/>_Profit rate = Unrealized PnL ÷ Initial margin_<br/>_Initial margin = Average open price × Position size ÷ Leverage ÷ Margin coin index price_ |
| &gt; totalFundingFee | String             | Total funding fee over the position's lifetime<br/> `0` indicates that no funding fee has been charged yet                                                     |
| &gt; cashDividend    | String             | Cash dividend, unit: USDT                                                                                                                                      |
| &gt; createdTime     | String             | Position creation time<br/>A Unix timestamp in milliseconds. e.g.,`1597026383085`                                                                              |
| &gt; updatedTime     | String             | Latest position update time<br/>A Unix timestamp in milliseconds. e.g.,`1597026383085`                                                                         |

## Profit Rate Calculation

**Profit Rate = Unrealized PnL / Initial Margin**

### Initial Margin
**Initial Margin = (Average Open Price × Position Size) / Leverage / Margin Coin Index Price**

</div>
