Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
Websocket
Introduction
Futures
    Public
    Private
      Account channelEquity ChannelFill ChannelPosition ChannelHistory Position ChannelOrder ChannelTrigger Order ChannelCancel Order ChannelPlace Order ChannelADL Notification Channel
Spot
Margin
Private

Position Channel

Description

Subscribe the position channel

Data will be pushed when the following events occurred:

  1. Open/Close orders are created
  2. Open/Close orders are filled
  3. Orders are canceled
Code
{ "op": "subscribe", "args": [ { "instType": "USDT-FUTURES", "channel": "positions", "instId": "default" } ] }

Request Parameters

ParameterTypeRequiredDescription
opStringYesOperation, subscribe unsubscribe
argsList<Object>YesList of channels to request subscription
> channelStringYesChannel name: positions
> instTypeStringYesProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> instIdStringYesSymbol name,defaultrepresents all the symbols,Only default is supported now
Code
{ "event": "subscribe", "arg": { "instType": "USDT-FUTURES", "channel": "positions", "instId": "default" } }

Response Parameters

ParameterTypeDescription
eventStringEvent
argObjectSubscribed channels
> channelStringChannel name: positions
> instTypeStringProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> instIdStringdefault
codeStringError code
msgStringError message
Code
{ "action": "snapshot", "arg": { "instType": "USDT-FUTURES", "channel": "positions", "instId": "default" }, "data": [ { "posId": "1", "instId": "ETHUSDT", "marginCoin": "USDT", "marginSize": "9.5", "marginMode": "crossed", "holdSide": "short", "posMode": "hedge_mode", "total": "0.1", "available": "0.1", "frozen": "0", "openPriceAvg": "1900", "leverage": 20, "achievedProfits": "0", "unrealizedPL": "0", "unrealizedPLR": "0", "liquidationPrice": "5788.108475905242", "keepMarginRate": "0.005", "marginRate": "0.004416374196", "cTime": "1695649246169", "breakEvenPrice": "24778.97", "totalFee": "1.45", "deductedFee": "0.388", "markPrice": "2500", "cashDividend": "0", "assetMode": "union", "uTime": "1695711602568", "autoMargin": "off" } ], "ts": 1695717430441 }

Push Parameters

ParameterTypeDescription
actionString'snapshot'
argObjectChannels with successful subscription
> channelStringChannel name: positions
> instTypeStringProduct type
USDT-FUTURES USDT-M Futures
COIN-FUTURES Coin-M Futures
USDC-FUTURES USDC-M Futures
> instIdStringdefault
dataList<Object>Subscription data
> posIdStringPosition ID
> instIdStringProduct ID,
delivery contract reference:https://www.bitget.com/api-doc/common/release-note
> marginCoinStringCurrency of occupied margin
> marginSizeStringOccupied margin (amount)
> marginModeStringMargin mode
> holdSideStringPosition direction
> posModeStringPosition mode
> totalStringOpen position size
> availableStringSize of positions that can be closed
> frozenStringAmount of frozen margin
> openPriceAvgStringAverage entry price
> leverageStringLeverage
> achievedProfitsStringRealized PnL
> unrealizedPLStringUnrealized PnL
> unrealizedPLRStringUnrealized ROI
> liquidationPriceStringEstimated liquidation price
> keepMarginRateStringMaintenance margin rate
> isolatedMarginRateStringActual margin ratio under isolated margin mode
> marginRateStringOccupancy rate of margin
> breakEvenPriceStringPosition breakeven price
> totalFeeStringFunding fee, the accumulated value of funding fee during the position,The initial value is empty, indicating that no funding fee has been charged yet.
> deductedFeeStringDeducted transaction fees: transaction fees deducted during the position
> markPriceStringMark Price
> cashDividendStringCash dividend, unit: USDT
> assetModeStringAccount Mode
union: Union Margin
single: Single Margin
> cTimeStringPosition creation time, milliseconds format of Unix timestamp, e.g.1597026383085
> uTimeStringLastest position update time, milliseconds format of Unix timestamp, e.g.1597026383085
Fill ChannelHistory Position Channel
JSON
JSON
JSON