Skip to main content

Get Position Info

Query real-time position data, such as position size, cumulative realizedPNL.

Normal account covers: USDT perpetual / Inverse contract

HTTP Request

GET /cloud/trade/v3/position/list

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • Normal account: linear, inverse. Please note that category is not involved with business logic
symbolfalsestringSymbol name
  • If symbol passed, it returns data regardless of having position or not.
  • If symbol=null and settleCoin specified, it returns position size greater than zero.
baseCoinfalsestringBase coin.
settleCoinfalsestringSettle coin. For linear & inverse, either symbol or settleCoin is required. symbol has a higher priority
limitfalseintegerLimit for data size per page. [1, 200]. Default: 20
cursorfalsestringCursor. Use the nextPageCursor token from the response to retrieve the next page of the result set

Response Parameters

ParameterTypeComments
categorystringProduct type
listarrayObject
> positionIdxintegerPosition idx, used to identify positions in different position modes
  • 0: One-Way Mode
  • 1: Buy side of both side mode
  • 2: Sell side of both side mode
> riskIdintegerRisk limit ID.
> riskLimitValuestringRisk limit value.
> symbolstringSymbol name
> sidestringPosition side. Buy: long, Sell: short. Note: under one-way mode, it returns None if empty position
> sizestringPosition size
> avgPricestringAverage entry price
> positionValuestringPosition value
> tradeModeintegerTrade mode
  • Normal: 0: cross-margin, 1: isolated margin
> positionStatusStringPosition status. Normal, Liq, Adl
> leveragestringPosition leverage. Valid for contract.
> markPricestringLast mark price
> liqPricestringPosition liquidation price
  • it is the real price for isolated and cross positions.
> bustPricestringBankruptcy price.
> positionIMstringInitial margin.
> positionMMstringMaintenance margin.
> positionBalancestringPosition margin.
> tpslModestringDepreciated, meaningless here, always "Full".
> takeProfitstringTake profit price
> stopLossstringStop loss price
> trailingStopstringTrailing stop (The distance from market price)
> unrealisedPnlstringUnrealised PnL
> cumRealisedPnlstringCumulative realised pnl
> adlRankIndicatorintegerAuto-deleverage rank indicator. What is Auto-Deleveraging?
> createdTimestringPosition created timestamp (ms)
> updatedTimestringPosition updated timestamp (ms)
nextPageCursorstringRefer to the cursor request parameter

Request Example

GET /cloud/trade/v3/position/list?category=inverse&symbol=BTCUSD HTTP/1.1
Host: openapi-testnet.zoomex.com
X-BAPI-SIGN: XXXXX
X-BAPI-API-KEY: XXXXX
X-BAPI-TIMESTAMP: 1672280218882
X-BAPI-RECV-WINDOW: 5000

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"positionIdx": 0,
"riskId": 1,
"riskLimitValue": "150",
"symbol": "BTCUSD",
"side": "Sell",
"size": "299",
"avgPrice": "30004.5006751",
"positionValue": "0.00996518",
"tradeMode": 0,
"positionStatus": "Normal",
"autoAddMargin": 1,
"adlRankIndicator": 2,
"leverage": "10",
"positionBalance": "0.00100189",
"markPrice": "26926.00",
"liqPrice": "999999.00",
"bustPrice": "999999.00",
"positionMM": "0.0000015",
"positionIM": "0.00009965",
"tpslMode": "Full",
"takeProfit": "0.00",
"stopLoss": "0.00",
"trailingStop": "0.00",
"unrealisedPnl": "0.00113932",
"cumRealisedPnl": "-0.00121275",
"createdTime": "1676538056258",
"updatedTime": "1684742400015"
}
],
"nextPageCursor": "",
"category": "inverse"
},
"retExtInfo": {},
"time": 1684767531904
}