Private
Position Channel
Description
Subscribe the position channel
Data will be pushed when the following events occurred:
- Open/Close orders are created
- Open/Close orders are filled
- Orders are canceled
Code
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| op | String | Yes | Operation, subscribe unsubscribe |
| args | List<Object> | Yes | List of channels to request subscription |
| > channel | String | Yes | Channel name: positions |
| > instType | String | Yes | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > instId | String | Yes | Symbol name,defaultrepresents all the symbols,Only default is supported now |
Code
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| event | String | Event |
| arg | Object | Subscribed channels |
| > channel | String | Channel name: positions |
| > instType | String | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > instId | String | default |
| code | String | Error code |
| msg | String | Error message |
Code
Push Parameters
| Parameter | Type | Description |
|---|---|---|
| action | String | 'snapshot' |
| arg | Object | Channels with successful subscription |
| > channel | String | Channel name: positions |
| > instType | String | Product typeUSDT-FUTURES USDT-M FuturesCOIN-FUTURES Coin-M FuturesUSDC-FUTURES USDC-M Futures |
| > instId | String | default |
| data | List<Object> | Subscription data |
| > posId | String | Position ID |
| > instId | String | Product ID, delivery contract reference:https://www.bitget.com/api-doc/common/release-note |
| > marginCoin | String | Currency of occupied margin |
| > marginSize | String | Occupied margin (amount) |
| > marginMode | String | Margin mode |
| > holdSide | String | Position direction |
| > posMode | String | Position mode |
| > total | String | Open position size |
| > available | String | Size of positions that can be closed |
| > frozen | String | Amount of frozen margin |
| > openPriceAvg | String | Average entry price |
| > leverage | String | Leverage |
| > achievedProfits | String | Realized PnL |
| > unrealizedPL | String | Unrealized PnL |
| > unrealizedPLR | String | Unrealized ROI |
| > liquidationPrice | String | Estimated liquidation price |
| > keepMarginRate | String | Maintenance margin rate |
| > isolatedMarginRate | String | Actual margin ratio under isolated margin mode |
| > marginRate | String | Occupancy rate of margin |
| > breakEvenPrice | String | Position breakeven price |
| > totalFee | String | Funding fee, the accumulated value of funding fee during the position,The initial value is empty, indicating that no funding fee has been charged yet. |
| > deductedFee | String | Deducted transaction fees: transaction fees deducted during the position |
| > markPrice | String | Mark Price |
| > cashDividend | String | Cash dividend, unit: USDT |
| > assetMode | String | Account Modeunion: Union Margin single: Single Margin |
| > cTime | String | Position creation time, milliseconds format of Unix timestamp, e.g.1597026383085 |
| > uTime | String | Lastest position update time, milliseconds format of Unix timestamp, e.g.1597026383085 |
