Get trader market PnL
curl --request GET \
--url https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets",
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://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets"
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://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets")
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[
{
"baseDecimals": 123,
"marketId": 123,
"points": [
{
"baseLots": 123,
"cumulativeFundingPayment": 123,
"cumulativePnl": 123,
"cumulativeTakerFee": 123,
"endTime": 123,
"markPrice": 123,
"realizedPnl": 123,
"startTime": 123,
"timestamp": 123,
"totalTakerFee": 123,
"unrealizedPnl": 123,
"virtualQuoteLots": 123
}
],
"symbol": "<string>",
"tickSize": 123
}
]Trader
Get trader market PnL
Handles GET /v1/traders/{trader_pubkey}/pnl/markets via get.v1.traders.by_trader_pubkey.pnl.markets.
GET
/
v1
/
traders
/
{trader_pubkey}
/
pnl
/
markets
Get trader market PnL
curl --request GET \
--url https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets",
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://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets"
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://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/traders/{trader_pubkey}/pnl/markets")
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[
{
"baseDecimals": 123,
"marketId": 123,
"points": [
{
"baseLots": 123,
"cumulativeFundingPayment": 123,
"cumulativePnl": 123,
"cumulativeTakerFee": 123,
"endTime": 123,
"markPrice": 123,
"realizedPnl": 123,
"startTime": 123,
"timestamp": 123,
"totalTakerFee": 123,
"unrealizedPnl": 123,
"virtualQuoteLots": 123
}
],
"symbol": "<string>",
"tickSize": 123
}
]Authorizations
Bearer access token issued by /v1/auth/* login endpoints.
Path Parameters
Trader public key (base58 encoded)
Query Parameters
Resolution/timeframe: 1m, 5m, 15m, 1h, 4h, 1d
Start time in milliseconds since Unix epoch (max range: 1 year)
End time in milliseconds since Unix epoch (max range: 1 year)
Max number of data points per market (default: 1000, max: 1000)
Comma separated list of market symbols to filter (defaults to all)
Response
200 - application/json
Base decimals used for this market
Market identifier
Time-series points
Show child attributes
Show child attributes
Market symbol (e.g. BTC, SOL, ETH)
Tick size in quote lots per base lot per tick