curl --request GET \
--url https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix \
--header 'Authorization: Bearer <token>'import requests
url = "https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix', 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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix",
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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix"
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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix")
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{
"vault": "So11111111111111111111111111111111111111112",
"data": {
"status": "none",
"usdcVault": true,
"traderAccount": "So11111111111111111111111111111111111111112",
"markets": [
{
"symbol": "<string>",
"name": "<string>",
"category": "crypto",
"logoUri": "<string>",
"color": "<string>",
"maxLeverage": 123,
"maintenanceFactor": 123,
"markPrice": "<string>",
"tickSize": 123,
"baseLotsDecimals": 123,
"takerFee": 123,
"makerFee": 123
}
],
"openOrders": [
{
"symbol": "<string>",
"side": "long",
"price": "<string>",
"size": "<string>",
"priceInTicks": "<string>",
"orderSequenceNumber": "<string>",
"reduceOnly": true
}
],
"withdrawable": "<string>",
"account": {
"collateral": "<string>",
"equity": "<string>",
"initialMargin": "<string>",
"maintenanceMargin": "<string>",
"withdrawable": "<string>",
"riskState": "<string>",
"liquidationPrices": {}
}
}
}{
"error": {
"code": "Validation",
"message": "vault must be a public key"
}
}{
"error": {
"code": "Unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "Forbidden",
"message": "Action is not enabled for this key"
}
}{
"error": {
"code": "NotFound",
"message": "Vault not found"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests, slow down"
}
}{
"error": {
"code": "Internal",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "RpcUnavailable",
"message": "Service temporarily unavailable"
}
}Get Phoenix state
Requires key scope read.
Returns the vault’s Phoenix trader status, markets, open orders, withdrawable collateral, and margin account. openOrders carries the priceInTicks and orderSequenceNumber that a by-id phoenix/cancel needs. Fields that come from Phoenix are null when Phoenix data is unavailable. The data can be up to 10 seconds old.
curl --request GET \
--url https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix \
--header 'Authorization: Bearer <token>'import requests
url = "https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix', 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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix",
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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix"
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://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/vaults/{vault}/phoenix")
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{
"vault": "So11111111111111111111111111111111111111112",
"data": {
"status": "none",
"usdcVault": true,
"traderAccount": "So11111111111111111111111111111111111111112",
"markets": [
{
"symbol": "<string>",
"name": "<string>",
"category": "crypto",
"logoUri": "<string>",
"color": "<string>",
"maxLeverage": 123,
"maintenanceFactor": 123,
"markPrice": "<string>",
"tickSize": 123,
"baseLotsDecimals": 123,
"takerFee": 123,
"makerFee": 123
}
],
"openOrders": [
{
"symbol": "<string>",
"side": "long",
"price": "<string>",
"size": "<string>",
"priceInTicks": "<string>",
"orderSequenceNumber": "<string>",
"reduceOnly": true
}
],
"withdrawable": "<string>",
"account": {
"collateral": "<string>",
"equity": "<string>",
"initialMargin": "<string>",
"maintenanceMargin": "<string>",
"withdrawable": "<string>",
"riskState": "<string>",
"liquidationPrices": {}
}
}
}{
"error": {
"code": "Validation",
"message": "vault must be a public key"
}
}{
"error": {
"code": "Unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "Forbidden",
"message": "Action is not enabled for this key"
}
}{
"error": {
"code": "NotFound",
"message": "Vault not found"
}
}{
"error": {
"code": "RateLimited",
"message": "Too many requests, slow down"
}
}{
"error": {
"code": "Internal",
"message": "Service temporarily unavailable"
}
}{
"error": {
"code": "RpcUnavailable",
"message": "Service temporarily unavailable"
}
}Authorizations
API key issued by a Hedgin administrator, in the form hv1_<id>_<secret>. <id> is 1 to 48 characters and <secret> is 32 to 128 characters, both from [A-Za-z0-9_-].
Path Parameters
Vault public key. Must be in the key's allowlist when the key has one, and the key's manager must be the vault's current on-chain authority. Base58 Solana public key. The server decodes it and rejects anything that is not 32 bytes.
^[1-9A-HJ-NP-Za-km-z]{32,44}$"So11111111111111111111111111111111111111112"
