Get holdings
curl --request GET \
--url https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings \
--header 'Authorization: Bearer <token>'import requests
url = "https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings"
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}/holdings', 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}/holdings",
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}/holdings"
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}/holdings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings")
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": {
"depositToken": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"totalValue": "1000000",
"totalUsd": 123,
"navTotalAssets": "1000000",
"navDeltaBps": 123,
"partial": true,
"unpriced": [
"<string>"
],
"tokens": [
{
"value": "<string>",
"usd": 123,
"shareBps": 123,
"token": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"amount": "1000000"
}
],
"positions": [
{
"value": "<string>",
"usd": 123,
"shareBps": 123,
"kind": "idle",
"token": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"amount": "1000000"
}
]
}
}{
"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"
}
}Vault reads
Get holdings
Requires key scope read.
Returns a live valuation of idle tokens and every open strategy. The data can be up to 15 seconds old. When partial is true, at least one price was unavailable. A missing valuation is not zero.
GET
/
vaults
/
{vault}
/
holdings
Get holdings
curl --request GET \
--url https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings \
--header 'Authorization: Bearer <token>'import requests
url = "https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings"
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}/holdings', 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}/holdings",
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}/holdings"
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}/holdings")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://hedgin.xyz/api/external/v1/vaults/{vault}/holdings")
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": {
"depositToken": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"totalValue": "1000000",
"totalUsd": 123,
"navTotalAssets": "1000000",
"navDeltaBps": 123,
"partial": true,
"unpriced": [
"<string>"
],
"tokens": [
{
"value": "<string>",
"usd": 123,
"shareBps": 123,
"token": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"amount": "1000000"
}
],
"positions": [
{
"value": "<string>",
"usd": 123,
"shareBps": 123,
"kind": "idle",
"token": {
"mint": "So11111111111111111111111111111111111111112",
"symbol": "<string>",
"decimals": 123,
"logo": "<string>",
"priceUsd": 123,
"name": "<string>",
"uiMultiplier": 123
},
"amount": "1000000"
}
]
}
}{
"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.
Pattern:
^[1-9A-HJ-NP-Za-km-z]{32,44}$Example:
"So11111111111111111111111111111111111111112"
