Position
Subscribe to the position stream to see changes to your position size, position setting changes, etc.
Topic:
user.position.unifiedAccount
Response Parameters
| Parameter | Type | Comments |
|---|---|---|
| id | string | Message id |
| topic | string | Topic name |
| type | string | Message type. snapshot |
| ts | number | The timestamp (ms) that system generates the data. |
| data | Object | |
| > version | integer | Version |
| > result | array | Object |
| >> symbol | string | Symbol name |
| >> side | string | Position side. Buy,Sell |
| >> size | string | Position size |
| >> positionIdx | integer | Used to identify positions in different position modes |
| >> riskId | integer | Risk limit id. Note: for portfolio margin mode, it returns 0, which the risk limit rule is invalid |
| >> leverage | string | Leverage. Note: for portfolio margin mode, it returns "", which the leverage rule is invalid |
| >> entryPrice | string | Average entry price |
| >> markPrice | string | Current mark price |
| >> positionValue | string | Position value |
| >> positionIM | string | Position initial margin. Note: for portfolio margin mode, it returns "" |
| >> positionMM | string | Position maintenance margin. Note: for portfolio margin mode, it returns "" |
| >> tpslMode | string | TP/SL mode. Full,Partial |
| >> takeProfit | string | Take profit price |
| >> stopLoss | string | Stop loss price |
| >> trailingStop | string | Trailing stop |
| >> unrealisedPnl | string | Unrealised PnL |
| >> cumRealisedPnl | string | Cumulative realised PnL |
| >> sessionAvgPrice | string | Session avg price. option does not have this field |
| >> createdTime | number | Created timestamp (ms) |
| >> updatedTime | number | Updated timestamp (ms) |
Stream Example
{
"id": "533285d3534ad0-0cab-477b-95fa-d8efa92e3a00",
"topic": "user.position.unifiedAccount",
"ts": 1672103585576,
"data": {
"result": [
{
"positionIdx": 0,
"riskId": 11,
"symbol": "ETHUSDT",
"side": "Buy",
"size": "0.15",
"entryPrice": "1072.54285714",
"leverage": "11",
"markPrice": "1215.38",
"positionIM": "14.71334027",
"positionMM": "0.89216153",
"takeProfit": "0",
"stopLoss": "0",
"trailingStop": "0",
"positionValue": "160.88142858",
"unrealisedPnl": "21.42557142",
"cumRealisedPnl": "80.35333206",
"createdTime": 0,
"updatedTime": 1672103585565,
"tpslMode": "Partial"
}
],
"version": 58085
},
"type": "snapshot"
}