Average entry price on BitMEX is the weighted average of all fill prices for a position. Convert each fill to its satoshi value (lot size / fill price), weight by the number of contracts, sum them, and divide by total contracts. Then convert back to USD: Average Entry Price = 1 / (average entry price in satoshis / lot size).
What Is the Formula for Average Entry Price?
The average entry price represents the average price at which you entered a position. The calculation uses satoshi values for precision.
Average Entry Price in Satoshis = ((satoshi value 1 x (contracts 1 / lot size)) + (satoshi value 2 x (contracts 2 / lot size)) + …) / (total contracts / lot size)- Lot size can be found on the contract's specification page.
Where Satoshi Value is:
Satoshi Value = lot size / fill price.Rounding rules:
- For short XBT positions: round the satoshi value to eight decimal places.
- For long XBT positions: floor the satoshi value to eight decimal places.
To convert back to USD:
Average Entry Price in USD = 1/(average entry price in satoshis/lot size)
How Do You Calculate Average Entry Price Step by Step?
Example: You buy 300 XBTUSD contracts (lot size 100) in two fills: 100 contracts at $29,800 and 200 contracts at $30,000.
Step 1 – Calculate satoshi values:
- Formula: Satoshi Value = lot size / fill price.
- 100 contracts at $29,800: Satoshi Value = 100 / 29,800 = 0.00335570
- 200 contracts at $30,000: Satoshi Value = 100 / 30,000 = 0.00333333
Step 2 – Calculate average entry price in satoshis:
- Formula: Average Entry Price in Satoshis = ((satoshi value 1 x (contracts 1 / lot size)) + (satoshi value 2 x (contracts 2 / lot size)) + …) / (total contracts / lot size)
- ((0.00335570 x (100/100)) + (0.00333333 x (200/100))) / (300/100)
- (0.00335570 + 0.00666666) / 3 = 0.003340787
Step 3 – Convert to USD:
- Formula: Average Entry Price in USD = 1 / (average entry price in satoshis / lot size).
- 1 / (0.003340787 / 100) - = $29,933.07
The average entry price for this position is $29,933.07 per contract.