Skip to main content

Positions History Channel

Get the closed position history

Request Parameters

ParameterTypeRequiredDescription
opstringYesOperation, subscribe unsubscribe
argslistYesList of channels to request subscription
> instTypestringYesProduct type: USDT-FUTURES
> channelstringYesChannel name: positions-history
> instIdstringNoProduct 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

ParameterTypeDescription
actionstringPush data action
argobjectChannels with successful subscription
> instTypestringProduct type
> channelstringChannel name
> instIdstringProduct ID
dataobjectHistory position data
> positionIdnumberPosition ID
> symbolstringSymbol
> marginCoinstringMargin coin
> holdSidestringPosition side: long / short
> openAvgPricestringAverage open price
> closeAvgPricestringAverage close price
> marginModestringMargin mode: isolated / cross
> openTotalPosstringTotal opened position size
> closeTotalPosstringTotal closed position size
> pnlstringProfit and loss
> netProfitstringNet profit (after fees)
> totalFundingstringTotal funding
> openFeestringOpen position fee
> closeFeestringClose position fee
> uTimenumberUpdate time (close time)
> cTimenumberCreate time (open time)
tsnumberPush 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
}