Skip to main content

Get Position Info

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

info

UTA2.0(inverse)

  1. you can query all holding positions with "/v5/position/list?category=inverse";
  2. Not supported to query multiple symbols in one request

UTA1.0(inverse) & Classic (inverse)

  1. you can query all holding positions with "/v5/position/list?category=inverse";
  2. symbol parameter is supported to be passed with multiple symbols up to 10, e.g., "symbol=BTCUSD,ETHUSD"

HTTP Request

GET /v5/position/list

Request Parameters

ParameterRequiredTypeComments
categorytruestringProduct type
  • UTA2.0, UTA1.0: linear, inverse, option
  • Classic account: linear, inverse
symbolfalsestringSymbol name, like BTCUSDT, uppercase only
  • 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, uppercase only. option only. Return all option positions if not passed
settleCoinfalsestringSettle coin
  • linear: 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
    nextPageCursorstringRefer to the cursor request parameter
    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 tier ID
    for portfolio margin mode, this field returns 0, which means risk limit rules are invalid
    > riskLimitValuestringRisk limit value
    for portfolio margin mode, this field returns 0, which means risk limit rules are invalid
    > symbolstringSymbol name
    > sidestringPosition side. Buy: long, Sell: short
    • one-way mode: classic & UTA1.0(inverse), an empty position returns None.
    • UTA2.0(linear, inverse) & UTA1.0(linear): either one-way or hedge mode returns an empty string "" for an empty position.
    > sizestringPosition size, always positive
    > avgPricestringAverage entry price
  • For USDC Perp & Futures, it indicates average entry price, and it will not be changed with 8-hour session settlement
  • > positionValuestringPosition value
    > tradeModeintegerTrade mode
    > autoAddMarginintegerWhether to add margin automatically when using isolated margin mode
  • 0: false
  • 1: true
  • > positionStatusStringPosition status. Normal, Liq, Adl
    > leveragestringPosition leverage
    for portfolio margin mode, this field returns "", which means leverage rules are invalid
    > markPricestringMark price
    > liqPricestringPosition liquidation price
    • UTA2.0(isolated margin), UTA1.0(isolated margin), UTA1.0(inverse), Classic account:
      it is the real price for isolated and cross positions, and keeps "" when liqPrice <= minPrice or liqPrice >= maxPrice
    • UTA2.0(Cross margin), UTA1.0(Cross margin):
      Please note that this is est. liquidation price and for reference only. Do note that liquidation is triggered when account maintenance margin rate reaches 100%, and keeps "" when liqPrice <= minPrice or liqPrice >= maxPrice
    this field is empty for Portfolio Margin Mode, and no liquidation price will be provided
    > bustPricestringBankruptcy price
    > positionIMstringInitial margin
  • Classic & UTA1.0(inverse): ignore this field
  • UTA portfolio margin mode, it returns ""
  • > positionMMstringMaintenance margin
  • Classic & UTA1.0(inverse): ignore this field
  • UTA portfolio margin mode, it returns ""
  • > positionBalancestringPosition margin
  • Classic & UTA1.0(inverse) can refer to this field to get the position initial margin plus position closing fee
  • > takeProfitstringTake profit price
    > stopLossstringStop loss price
    > trailingStopstringTrailing stop (The distance from market price)
    > sessionAvgPricestringUSDC contract session avg price, it is the same figure as avg entry price shown in the web UI
    > deltastringDelta
    > gammastringGamma
    > vegastringVega
    > thetastringTheta
    > unrealisedPnlstringUnrealised PnL
    > curRealisedPnlstringThe realised PnL for the current holding position
    > cumRealisedPnlstringCumulative realised pnl
    • Futures & Perps: it is the all time cumulative realised P&L
    • Option: always "", meaningless
    > adlRankIndicatorintegerAuto-deleverage rank indicator. What is Auto-Deleveraging?
    > createdTimestringTimestamp of the first time a position was created on this symbol (ms)
    > updatedTimestringPosition updated timestamp (ms)
    > seqlongCross sequence, used to associate each fill and each position update
    • Different symbols may have the same seq, please use seq + symbol to check unique
    • Returns "-1" if the symbol has never been traded
    • Returns the seq updated by the last transaction when there are settings like leverage, risk limit
    > isReduceOnlybooleanUseful when Bybit lower the risk limit
    • true: Only allowed to reduce the position. You can consider a series of measures, e.g., lower the risk limit, decrease leverage or reduce the position, add margin, or cancel orders, after these operations, you can call confirm new risk limit endpoint to check if your position can be removed the reduceOnly mark
    • false: There is no restriction, and it means your position is under the risk when the risk limit is systematically adjusted
    • Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
    > mmrSysUpdatedTimestringUseful when Bybit lower the risk limit
    • When isReduceOnly=true: the timestamp (ms) when the MMR will be forcibly adjusted by the system
    • When isReduceOnly=false: the timestamp when the MMR had been adjusted by system
    • It returns the timestamp when the system operates, and if you manually operate, there is no timestamp
    • Keeps "" by default, if there was a lower risk limit system adjustment previously, it shows that system operation timestamp
    • Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
    > leverageSysUpdatedTimestringUseful when Bybit lower the risk limit
    • When isReduceOnly=true: the timestamp (ms) when the leverage will be forcibly adjusted by the system
    • When isReduceOnly=false: the timestamp when the leverage had been adjusted by system
    • It returns the timestamp when the system operates, and if you manually operate, there is no timestamp
    • Keeps "" by default, if there was a lower risk limit system adjustment previously, it shows that system operation timestamp
    • Only meaningful for isolated margin & cross margin of USDT Perp, USDC Perp, USDC Futures, Inverse Perp and Inverse Futures, meaningless for others
    > tpslModestringdeprecated, always "Full"

    Request Example

    GET /v5/position/list?category=inverse&symbol=BTCUSD HTTP/1.1
    Host: api-testnet.bybit.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": "300",
    "avgPrice": "27464.50441675",
    "positionValue": "0.01092319",
    "tradeMode": 0,
    "positionStatus": "Normal",
    "autoAddMargin": 1,
    "adlRankIndicator": 2,
    "leverage": "10",
    "positionBalance": "0.00139186",
    "markPrice": "28224.50",
    "liqPrice": "",
    "bustPrice": "999999.00",
    "positionMM": "0.0000015",
    "positionIM": "0.00010923",
    "tpslMode": "Full",
    "takeProfit": "0.00",
    "stopLoss": "0.00",
    "trailingStop": "0.00",
    "unrealisedPnl": "-0.00029413",
    "curRealisedPnl": "0.00013123",
    "cumRealisedPnl": "-0.00096902",
    "seq": 5723621632,
    "isReduceOnly": false,
    "mmrSysUpdateTime": "",
    "leverageSysUpdatedTime": "",
    "sessionAvgPrice": "",
    "createdTime": "1676538056258",
    "updatedTime": "1697673600012"
    }
    ],
    "nextPageCursor": "",
    "category": "inverse"
    },
    "retExtInfo": {},
    "time": 1697684980172
    }