Get open positions with real-time P&L
Returns all currently open positions for the authenticated user. Each position shows the contract, net quantity (positive = long, negative = short), average entry price, unrealized P&L and realized P&L from partial closes.
unrealized_pnl is marked at read time. It is computed when you call this endpoint, from the current mark price and the contract’s point value: the same price and formula as WebSocket PositionUpdate events. Futures are marked at the last trade, kept within the current best bid/ask (outside trading hours, the last trade of the session); perpetuals at the venue’s mark price. mark_price and marked_at give the price and time used. If no current price is available for a contract, unrealized_pnl is the value stored at the position’s last change and mark_price/marked_at are omitted.
updated_at is when the position itself last changed (a fill or a margin change); it does not move when the position is re-marked. On WebSocket PositionUpdate events, updated_at also advances with each revaluation.
data.positions holds the positions; data.account_versions maps each account to the state version the positions were read at (compare with state_version on WebSocket updates to discard older data).
For a live monitor, subscribe to WebSocket PositionUpdate events (up to about 4 per second per account while positions are open) and use this endpoint for the initial load and reconciliation.
const response = await fetch('/trade/positions', {
headers: { 'Authorization': `Bearer ${token}` }
});
const { data: positions } = await response.json();
positions.forEach(p => {
console.log(`${p.contract}: ${p.quantity} @ ${p.avg_entry_price}, P&L: $${p.unrealized_pnl}`);
});curl --request GET \
--url https://api.hyperprop.com/trade/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperprop.com/trade/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperprop.com/trade/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperprop.com/trade/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperprop.com/trade/positions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"account_versions": {
"550e8400-e29b-41d4-a716-446655440001": 12
},
"positions": [
{
"account_id": "550e8400-e29b-41d4-a716-446655440001",
"avg_entry_price": 6045.5,
"contract": "ESH6",
"mark_price": 6046.75,
"marked_at": "2026-03-02T14:41:07.250Z",
"opened_at": "2026-03-02T14:30:00Z",
"quantity": 2,
"realized_pnl": 0,
"state_version": 12,
"unrealized_pnl": 125,
"updated_at": "2026-03-02T14:30:00Z",
"user_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}Authorizations
const response = await fetch('/trade/positions', {
headers: { 'Authorization': `Bearer ${token}` }
});
const { data: positions } = await response.json();
positions.forEach(p => {
console.log(`${p.contract}: ${p.quantity} @ ${p.avg_entry_price}, P&L: $${p.unrealized_pnl}`);
});curl --request GET \
--url https://api.hyperprop.com/trade/positions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.hyperprop.com/trade/positions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperprop.com/trade/positions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.hyperprop.com/trade/positions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.hyperprop.com/trade/positions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/positions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"account_versions": {
"550e8400-e29b-41d4-a716-446655440001": 12
},
"positions": [
{
"account_id": "550e8400-e29b-41d4-a716-446655440001",
"avg_entry_price": 6045.5,
"contract": "ESH6",
"mark_price": 6046.75,
"marked_at": "2026-03-02T14:41:07.250Z",
"opened_at": "2026-03-02T14:30:00Z",
"quantity": 2,
"realized_pnl": 0,
"state_version": 12,
"unrealized_pnl": 125,
"updated_at": "2026-03-02T14:30:00Z",
"user_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}