Private
Positions Channel
Description
Data will be pushed when the following events occur:
- Push on the first-time subscription
- Push incremental data when close-position orders are placed in the unified trading account
- Push incremental data when futures positions are opened in the unified trading account
- Push incremental data when futures positions are closed in the unified trading account
- Push incremental data when futures close-position orders are modified in the unified trading account
- Push incremental data when futures close-position orders are cancelled in the unified trading account
Code
Request Parameters
| Parameters | Type | Description |
|---|---|---|
| op | String | Operation subscribe Subscribe unsubscribe Unsubscribe |
| args | List<Object> | Subscribed channel |
| > instType | String | Product type UTA Unified trading account |
| > topic | String | Topic position Position |
Code
Response Parameters
| Parameters | Type | Description |
|---|---|---|
| event | String | Operation subscribe Subscription unsubscribe Unsubscription error Parameter error |
| arg | Object | Subscribed channel |
| > instType | String | Product type UTA Unified trading account |
| > topic | String | Topic position Position |
| code | String | Error code |
| msg | String | Error message |
| connId | String | Connection ID |
Code
Push Parameters
| Parameter | Type | Description |
|---|---|---|
| arg | Object | Subscribed channel |
| > instType | String | Product type UTA Unified Account |
| > topic | String | Topic position Position channel |
| action | String | Action snapshot Full data update Incremental data |
| data | List<Object> | Subscribed data |
| > symbol | String | Symbol name |
| > marginCoin | String | Margin coin |
| > marginSize | String | Margin size |
| > marginMode | String | Margin modecrossed Cross marginisolated Isolated margin |
| > posSide | String | Position side long/short |
| > holdMode | String | Holding mode one_way_mode/hedge_mode |
| > positionStatus | String | Position status opening Ongoing ended Completed |
| > size | String | Position size size = available + frozen |
| > available | String | Available position size |
| > frozen | String | Frozen position size |
| > avgPrice | String | Average open price |
| > leverage | String | Leverage multiple |
| > curRealisedPnl | String | Realised PnL |
| > unrealisedPnl | String | Unrealised PnL |
| > liqPrice | String | Estimated liquidation price |
| > mmr | String | Maintain margin rate |
| > marginRate | String | Margin rate |
| > markPrice | String | Mark Price |
| > openFeeTotal | String | Total opening fee |
| > closeFeeTotal | String | Total closing fee |
| > breakEvenPrice | String | Break-even price |
| > profitRate | String | Profit rate Profit rate = Unrealized PnL ÷ Initial margin Initial margin = Average open price × Position size ÷ Leverage ÷ Margin coin index price |
| > totalFundingFee | String | Total funding fee over the position's lifetime0 indicates that no funding fee has been charged yet |
| > cashDividend | String | Cash dividend, unit: USDT |
| > createdTime | String | Position creation time A Unix timestamp in milliseconds. e.g., 1597026383085 |
| > updatedTime | String | Latest position update time 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
