Skip to main content

Position

Subscribe to the position stream to see changes to your position size, position setting changes, etc.

Topic:
user.position.unifiedAccount

Response Parameters

ParameterTypeComments
idstringMessage id
topicstringTopic name
typestringMessage type. snapshot
tsnumberThe timestamp (ms) that system generates the data.
dataObject
> versionintegerVersion
> resultarrayObject
>> symbolstringSymbol name
>> sidestringPosition side. Buy,Sell
>> sizestringPosition size
>> positionIdxintegerUsed to identify positions in different position modes
>> riskIdintegerRisk limit id. Note: for portfolio margin mode, it returns 0, which the risk limit rule is invalid
>> leveragestringLeverage. Note: for portfolio margin mode, it returns "", which the leverage rule is invalid
>> entryPricestringAverage entry price
>> markPricestringCurrent mark price
>> positionValuestringPosition value
>> positionIMstringPosition initial margin. Note: for portfolio margin mode, it returns ""
>> positionMMstringPosition maintenance margin. Note: for portfolio margin mode, it returns ""
>> tpslModestringTP/SL mode. Full,Partial
>> takeProfitstringTake profit price
>> stopLossstringStop loss price
>> trailingStopstringTrailing stop
>> unrealisedPnlstringUnrealised PnL
>> cumRealisedPnlstringCumulative realised PnL
>> sessionAvgPricestringSession avg price. option does not have this field
>> createdTimenumberCreated timestamp (ms)
>> updatedTimenumberUpdated 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"
}