curl --request GET \
--url https://perp-api.phoenix.trade/v1/view/trader/{pubkey} \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/view/trader/{pubkey}"
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/view/trader/{pubkey}', 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/view/trader/{pubkey}",
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/view/trader/{pubkey}"
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/view/trader/{pubkey}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/view/trader/{pubkey}")
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{
"accumulatedFunding": "<string>",
"authority": "<string>",
"cancelMargin": "<string>",
"capabilities": {
"depositCollateral": {
"immediate": true,
"viaColdActivation": true
},
"placeLimitOrder": {
"immediate": true,
"viaColdActivation": true
},
"placeMarketOrder": {
"immediate": true,
"viaColdActivation": true
},
"riskIncreasingTrade": {
"immediate": true,
"viaColdActivation": true
},
"riskReducingTrade": {
"immediate": true,
"viaColdActivation": true
},
"withdrawCollateral": {
"immediate": true,
"viaColdActivation": true
}
},
"collateralBalance": "<string>",
"discountedUnrealizedPnl": "<string>",
"effectiveCollateral": "<string>",
"effectiveCollateralForWithdrawals": "<string>",
"flags": 1,
"initialMargin": "<string>",
"initialMarginForWithdrawals": "<string>",
"isInActiveTraders": true,
"lastDepositSlot": 1,
"limitOrders": {},
"maintenanceMargin": "<string>",
"makerFeeOverrideMultiplier": 123,
"maxPositions": 1,
"numMarketsWithSplines": 1,
"portfolioValue": "<string>",
"positions": [
{
"accumulatedFunding": "<string>",
"backstopMargin": "<string>",
"discountedUnrealizedPnl": "<string>",
"entryPrice": "<string>",
"initialMargin": "<string>",
"limitOrderMargin": "<string>",
"liquidationPrice": "<string>",
"maintenanceMargin": "<string>",
"positionInitialMargin": "<string>",
"positionSize": "<string>",
"positionValue": "<string>",
"symbol": "<string>",
"unrealizedPnl": "<string>",
"unsettledFunding": "<string>",
"virtualQuotePosition": "<string>",
"stopLossPrice": "<string>",
"takeProfitPrice": "<string>"
}
],
"riskState": "healthy",
"riskTier": "safe",
"slot": 1,
"slotIndex": 1,
"state": "uninitialized",
"takerFeeOverrideMultiplier": 123,
"traderKey": "<string>",
"traderPdaIndex": 1,
"traderSubaccountIndex": 1,
"unrealizedPnl": "<string>",
"unsettledFundingOwed": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Get trader
Handles GET /v1/view/trader/{pubkey} via get.v1.view.trader.by_pubkey.
curl --request GET \
--url https://perp-api.phoenix.trade/v1/view/trader/{pubkey} \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/view/trader/{pubkey}"
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/view/trader/{pubkey}', 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/view/trader/{pubkey}",
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/view/trader/{pubkey}"
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/view/trader/{pubkey}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/view/trader/{pubkey}")
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{
"accumulatedFunding": "<string>",
"authority": "<string>",
"cancelMargin": "<string>",
"capabilities": {
"depositCollateral": {
"immediate": true,
"viaColdActivation": true
},
"placeLimitOrder": {
"immediate": true,
"viaColdActivation": true
},
"placeMarketOrder": {
"immediate": true,
"viaColdActivation": true
},
"riskIncreasingTrade": {
"immediate": true,
"viaColdActivation": true
},
"riskReducingTrade": {
"immediate": true,
"viaColdActivation": true
},
"withdrawCollateral": {
"immediate": true,
"viaColdActivation": true
}
},
"collateralBalance": "<string>",
"discountedUnrealizedPnl": "<string>",
"effectiveCollateral": "<string>",
"effectiveCollateralForWithdrawals": "<string>",
"flags": 1,
"initialMargin": "<string>",
"initialMarginForWithdrawals": "<string>",
"isInActiveTraders": true,
"lastDepositSlot": 1,
"limitOrders": {},
"maintenanceMargin": "<string>",
"makerFeeOverrideMultiplier": 123,
"maxPositions": 1,
"numMarketsWithSplines": 1,
"portfolioValue": "<string>",
"positions": [
{
"accumulatedFunding": "<string>",
"backstopMargin": "<string>",
"discountedUnrealizedPnl": "<string>",
"entryPrice": "<string>",
"initialMargin": "<string>",
"limitOrderMargin": "<string>",
"liquidationPrice": "<string>",
"maintenanceMargin": "<string>",
"positionInitialMargin": "<string>",
"positionSize": "<string>",
"positionValue": "<string>",
"symbol": "<string>",
"unrealizedPnl": "<string>",
"unsettledFunding": "<string>",
"virtualQuotePosition": "<string>",
"stopLossPrice": "<string>",
"takeProfitPrice": "<string>"
}
],
"riskState": "healthy",
"riskTier": "safe",
"slot": 1,
"slotIndex": 1,
"state": "uninitialized",
"takerFeeOverrideMultiplier": 123,
"traderKey": "<string>",
"traderPdaIndex": 1,
"traderSubaccountIndex": 1,
"unrealizedPnl": "<string>",
"unsettledFundingOwed": "<string>"
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Bearer access token issued by /v1/auth/* login endpoints.
Path Parameters
Base58 encoded trader account pubkey
Response
Phoenix Eternal trader
Trader view with all trading information
Accumulated funding amount.
Trader authority public key.
Margin threshold used for cancellation checks.
Derived capability matrix.
Show child attributes
Show child attributes
Collateral balance.
Discounted unrealized PnL used in risk calculations.
Effective collateral used for risk checks.
Effective collateral used for withdrawal checks.
Raw trader capability flags.
x >= 0Required initial margin.
Initial margin used for withdrawal checks.
Whether trader is currently in the active-trader buffer.
Last collateral deposit slot.
x >= 0Open limit orders grouped by symbol.
Show child attributes
Show child attributes
Required maintenance margin.
Maker fee multiplier (1.0 = default, <1.0 = discount, >1.0 = premium).
Maximum number of positions allowed.
x >= 0Number of markets where this trader has registered splines
x >= 0Current portfolio value.
Open positions.
Show child attributes
Show child attributes
Current risk state.
healthy, unhealthy, underwater, zeroCollateralNoPositions Current risk tier.
safe, atRisk, cancellable, liquidatable, backstopLiquidatable, highRisk Solana slot of the state snapshot used to build this trader view.
x >= 0Intra-slot sequence index of the state snapshot used to build this trader view.
x >= 0Derived high-level trader state.
uninitialized, cold, active, reduceOnly, frozen Taker fee multiplier (1.0 = default, <1.0 = discount, >1.0 = premium).
Trader PDA public key.
Trader PDA index under the authority.
x >= 0Trader subaccount index.
x >= 0Total unrealized PnL.
Unsettled funding amount owed to the trader.
- Positive value = funding you will receive when settled (increases collateral)
- Negative value = funding you owe when settled (decreases collateral)