Key Definitions
- positionValue: Total value of the position (positive for long, negative for short)
- positionQuantity: Size of the position (positive for long, negative for short)
- indexPrice: Current market index price for the asset
- avgEntryPrice: Average entry price for the position
Calculation Formulas
| Field | Formula | Description |
|---|---|---|
| avgEntryPrice | positionValue / positionQuantity | Average entry price for the position |
| unrealizedPnl | (indexPrice - avgEntryPrice) × positionQuantity | Profit/loss on open positions |
Usage in API
These calculations are used in the Get Account Positions response to show the current unrealized profit or loss for each of your open positions. Bothvalue and quantity fields are included in the response, allowing you to verify or calculate the average entry price.