Positions History Channel
Get the closed position history
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| op | string | Yes | Operation, subscribe unsubscribe |
| args | list | Yes | List of channels to request subscription |
| > instType | string | Yes | Product type: USDT-FUTURES |
| > channel | string | Yes | Channel name: positions-history |
| > instId | string | No | Product ID (optional) |
Request Example
{
"op": "subscribe",
"args": [
{
"instType": "USDT-FUTURES",
"channel": "positions-history",
"instId": "default"
}
]
}
Response Example
{
"event": "subscribe",
"arg": {
"instType": "USDT-FUTURES",
"channel": "positions-history",
"instId": "default"
}
}
Push Parameters
| Parameter | Type | Description |
|---|---|---|
| action | string | Push data action |
| arg | object | Channels with successful subscription |
| > instType | string | Product type |
| > channel | string | Channel name |
| > instId | string | Product ID |
| data | object | History position data |
| > positionId | number | Position ID |
| > symbol | string | Symbol |
| > marginCoin | string | Margin coin |
| > holdSide | string | Position side: long / short |
| > openAvgPrice | string | Average open price |
| > closeAvgPrice | string | Average close price |
| > marginMode | string | Margin mode: isolated / cross |
| > openTotalPos | string | Total opened position size |
| > closeTotalPos | string | Total closed position size |
| > pnl | string | Profit and loss |
| > netProfit | string | Net profit (after fees) |
| > totalFunding | string | Total funding |
| > openFee | string | Open position fee |
| > closeFee | string | Close position fee |
| > uTime | number | Update time (close time) |
| > cTime | number | Create time (open time) |
| ts | number | Push timestamp |
Push Data
{
"action": "snapshot",
"arg": {
"instType": "USDT-FUTURES",
"channel": "positions-history",
"instId": "default"
},
"data": {
"positionId": 123456,
"symbol": "BTCUSDT",
"marginCoin": "USDT",
"holdSide": "long",
"openAvgPrice": "27000.0",
"closeAvgPrice": "27500.0",
"marginMode": "isolated",
"openTotalPos": "0.1",
"closeTotalPos": "0.1",
"pnl": "50.00",
"netProfit": "44.60",
"totalFunding": "275.40",
"openFee": "2.70",
"closeFee": "2.70",
"uTime": 1695716760565,
"cTime": 1695716700000
},
"ts": 1695716761589
}