Skip to main content

parse_position

Function parse_position 

Source
pub fn parse_position(data: &Value, symbol: &str) -> Result<Position>
Expand description

Parse position data from Bitget position response.

Bitget position fields:

  • symbol: exchange symbol
  • holdSide: position side (long/short)
  • total: total position size
  • available: available position size
  • averageOpenPrice: average entry price
  • markPrice: mark price
  • unrealizedPL: unrealized PnL
  • leverage: leverage multiplier
  • liquidationPrice: liquidation price
  • marginMode: margin mode (crossed/isolated)
  • margin: position margin
  • achievedProfits: realized PnL