Skip to content

position#

WS wss://api.pro.anboto.xyz/api/v2/ws

Channel for subscribing to account position updates for a specific exchange

Authenticate the connection with a listenKey — see WebSocket.

Subscribe message#

topic string required
position
exchange string required
Trading exchange, case-insensitive
Example: BINANCE
method enum required
subscribe / unsubscribe

Update message fields#

collateral decimal
Collateral amount for the position
contracts decimal
Number of contracts
entryPrice decimal
Average entry price
leverage decimal
Position leverage
liquidationPrice decimal
Liquidation price
marginMode enum
Margin mode for the position — CROSS, ISOLATED
markPrice decimal
Current mark price
notional decimal
Notional value of the position
side enum
Position side — LONG, SHORT, BOTH
symbol string required
Trading symbol
timestamp integer required
Unix timestamp in milliseconds
unrealizedPnl decimal
Unrealized profit and loss
instrument Instrument
Trading instrument details
instrument.assetClass enum
Asset class of the instrument — UNDEFINED, SPOT, FUTURE, OPTION, CFD
instrument.assetId string
Unique asset identifier
instrument.baseAsset string
Base asset symbol
instrument.contractSize number
Contract size
instrument.enabled boolean required
Whether the instrument is enabled for trading
instrument.exchangeAssetClass string
Exchange-specific asset class
instrument.exchangeSymbol string
Symbol as used on the exchange
instrument.maxCostLimit number
Maximum cost limit
instrument.maxMarketLimit number
Maximum market order limit
instrument.maxPriceLimit number
Maximum price limit
instrument.maxQuantityLimit number
Maximum quantity limit
instrument.minCostLimit number
Minimum cost limit
instrument.minMarketLimit number
Minimum market order limit
instrument.minPriceLimit number
Minimum price limit
instrument.minQuantityLimit number
Minimum quantity limit
instrument.pricePrecision integer
Price decimal precision
instrument.priceSignificantFigure integer
Price significant figures
instrument.quantityPrecision integer
Quantity decimal precision
instrument.quantitySignificantFigure integer
Quantity significant figures
instrument.quoteAsset string
Quote asset symbol
instrument.symbol string
Instrument symbol
instrument.timestamp date-time
Last update timestamp

Responses#

code 0 Acknowledgment of successful subscription
code ≠ 0 Error response for failed subscription — see Errors
{
  "topic": "position",
  "exchange": "BINANCE",
  "method": "subscribe"
}
{
  "topic": "position",
  "exchange": "BINANCE",
  "method": "unsubscribe"
}

Update position

{
  "collateral": "50000.00",
  "contracts": "2.5",
  "entryPrice": "45000.00",
  "leverage": "10.0",
  "liquidationPrice": "40500.00",
  "marginMode": "CROSS",
  "markPrice": "46000.00",
  "notional": "115000.00",
  "side": "LONG",
  "symbol": "BTC-USDT",
  "timestamp": 1708840800000,
  "unrealizedPnl": "2500.00",
  "instrument": {
    "assetClass": "FUTURE",
    "symbol": "BTC-USDT",
    "baseAsset": "BTC",
    "quoteAsset": "USDT"
  }
}

Ack code 0

{
  "code": 0,
  "message": "string"
}