Get trader state
curl --request GET \
--url https://perp-api.phoenix.trade/v1/trader/state/{authority_pubkey} \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_pubkey}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/trader/state/{authority_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{
"authority": "<string>",
"slot": 1,
"slotIndex": 1,
"snapshot": {
"capabilities": {
"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
}
},
"flags": 1
},
"makerFeeOverrideMultiplier": 123,
"subaccounts": [
{
"collateral": "<string>",
"sequence": 1,
"subaccountIndex": 1,
"capabilities": {
"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
}
},
"flags": 1
},
"cooldownStatus": {
"cooldownPeriodInSlots": 1,
"lastDepositSlot": 1
},
"orders": [
{
"orders": [
{
"initialSizeLots": "<string>",
"orderSequenceNumber": "<string>",
"orderType": "<string>",
"priceTicks": "<string>",
"priceUsd": "<string>",
"reduceOnly": true,
"sizeRemainingLots": "<string>",
"status": "<string>",
"conditionalKind": "<string>",
"isConditionalOrder": true,
"isStopLoss": true,
"isStopLossDirection": true
}
],
"symbol": "<string>"
}
],
"positions": [
{
"accumulatedFundingQuoteLots": "<string>",
"basePositionLots": "<string>",
"entryPriceTicks": "<string>",
"entryPriceUsd": "<string>",
"positionSequenceNumber": "<string>",
"stopLossTriggers": [
{
"status": "<string>",
"stopLossId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"takeProfitTriggers": [
{
"status": "<string>",
"takeProfitId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"unsettledFundingQuoteLots": "<string>",
"virtualQuotePositionLots": "<string>",
"symbol": "<string>",
"conditionalStopLossTriggers": [
{
"conditionalStopLossId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
],
"conditionalTakeProfitTriggers": [
{
"conditionalTakeProfitId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
]
}
],
"splines": [
{
"askFilledAmountLots": "<string>",
"bidFilledAmountLots": "<string>",
"midPriceTicks": "<string>",
"symbol": "<string>",
"askRegions": [
{
"densityLotsPerTick": "<string>",
"endPriceTicks": "<string>",
"filledSizeLots": "<string>",
"startPriceTicks": "<string>",
"totalSizeLots": "<string>"
}
],
"bidRegions": [
{
"densityLotsPerTick": "<string>",
"endPriceTicks": "<string>",
"filledSizeLots": "<string>",
"startPriceTicks": "<string>",
"totalSizeLots": "<string>"
}
]
}
],
"triggers": [
{
"stopLossTriggers": [
{
"status": "<string>",
"stopLossId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"takeProfitTriggers": [
{
"status": "<string>",
"takeProfitId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"symbol": "<string>",
"conditionalStopLossTriggers": [
{
"conditionalStopLossId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
],
"conditionalTakeProfitTriggers": [
{
"conditionalTakeProfitId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
]
}
]
}
],
"takerFeeOverrideMultiplier": 123,
"version": 1
},
"traderPdaIndex": 1
}Trader
Get trader state
Handles GET /v1/trader/state/{authority_pubkey} via get.v1.trader.state.by_authority_pubkey.
GET
/
v1
/
trader
/
state
/
{authority_pubkey}
Get trader state
curl --request GET \
--url https://perp-api.phoenix.trade/v1/trader/state/{authority_pubkey} \
--header 'Authorization: Bearer <token>'import requests
url = "https://perp-api.phoenix.trade/v1/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_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/trader/state/{authority_pubkey}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/trader/state/{authority_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{
"authority": "<string>",
"slot": 1,
"slotIndex": 1,
"snapshot": {
"capabilities": {
"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
}
},
"flags": 1
},
"makerFeeOverrideMultiplier": 123,
"subaccounts": [
{
"collateral": "<string>",
"sequence": 1,
"subaccountIndex": 1,
"capabilities": {
"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
}
},
"flags": 1
},
"cooldownStatus": {
"cooldownPeriodInSlots": 1,
"lastDepositSlot": 1
},
"orders": [
{
"orders": [
{
"initialSizeLots": "<string>",
"orderSequenceNumber": "<string>",
"orderType": "<string>",
"priceTicks": "<string>",
"priceUsd": "<string>",
"reduceOnly": true,
"sizeRemainingLots": "<string>",
"status": "<string>",
"conditionalKind": "<string>",
"isConditionalOrder": true,
"isStopLoss": true,
"isStopLossDirection": true
}
],
"symbol": "<string>"
}
],
"positions": [
{
"accumulatedFundingQuoteLots": "<string>",
"basePositionLots": "<string>",
"entryPriceTicks": "<string>",
"entryPriceUsd": "<string>",
"positionSequenceNumber": "<string>",
"stopLossTriggers": [
{
"status": "<string>",
"stopLossId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"takeProfitTriggers": [
{
"status": "<string>",
"takeProfitId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"unsettledFundingQuoteLots": "<string>",
"virtualQuotePositionLots": "<string>",
"symbol": "<string>",
"conditionalStopLossTriggers": [
{
"conditionalStopLossId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
],
"conditionalTakeProfitTriggers": [
{
"conditionalTakeProfitId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
]
}
],
"splines": [
{
"askFilledAmountLots": "<string>",
"bidFilledAmountLots": "<string>",
"midPriceTicks": "<string>",
"symbol": "<string>",
"askRegions": [
{
"densityLotsPerTick": "<string>",
"endPriceTicks": "<string>",
"filledSizeLots": "<string>",
"startPriceTicks": "<string>",
"totalSizeLots": "<string>"
}
],
"bidRegions": [
{
"densityLotsPerTick": "<string>",
"endPriceTicks": "<string>",
"filledSizeLots": "<string>",
"startPriceTicks": "<string>",
"totalSizeLots": "<string>"
}
]
}
],
"triggers": [
{
"stopLossTriggers": [
{
"status": "<string>",
"stopLossId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"takeProfitTriggers": [
{
"status": "<string>",
"takeProfitId": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>"
}
}
],
"symbol": "<string>",
"conditionalStopLossTriggers": [
{
"conditionalStopLossId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
],
"conditionalTakeProfitTriggers": [
{
"conditionalTakeProfitId": "<string>",
"status": "<string>",
"trigger": {
"executionPriceTicks": "<string>",
"triggerPriceTicks": "<string>",
"fillableSizeLots": "<string>",
"filledSizeLots": "<string>",
"maxSizeLots": "<string>",
"percent": 1,
"usePercent": true,
"attachedOrderSequenceNumber": "<string>"
}
}
]
}
]
}
],
"takerFeeOverrideMultiplier": 123,
"version": 1
},
"traderPdaIndex": 1
}Authorizations
Bearer access token issued by /v1/auth/* login endpoints.
Path Parameters
Query Parameters
Optional trader PDA index under the authority.
Required range:
x >= 0Response
200 - application/json
REST response wrapper for a trader-state snapshot.
Trader authority public key.
Solana slot for this snapshot.
Required range:
x >= 0Slot-local index used for deterministic ordering.
Required range:
x >= 0Full trader-state snapshot.
Show child attributes
Show child attributes
Trader PDA index under the authority.
Required range:
x >= 0⌘I