from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.erc_4626_vaults.vaults_vault(chain=models.V1VaultsVaultChain.ETHEREUM, vault_address="0x182863131F9a4630fF9E27830d945B1413e347E8", user_address="0xb8340945eBc917D2Aa0368a5e4E79C849c461511")
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.erc4626Vaults.vaultsVault({
chain: "ethereum",
vaultAddress: "0x182863131F9a4630fF9E27830d945B1413e347E8",
userAddress: "0xb8340945eBc917D2Aa0368a5e4E79C849c461511",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/vaults/vault \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/vaults/vault', 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://api.compasslabs.ai/v1/vaults/vault",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.compasslabs.ai/v1/vaults/vault"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.compasslabs.ai/v1/vaults/vault")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/vaults/vault")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"total_assets": "<string>",
"total_supply": "<string>",
"share_price": "<string>",
"underlying_token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123
},
"apy": {
"current": "<string>",
"apy_1_day": "<string>",
"apy_7_day": "<string>",
"apy_30_day": "<string>"
},
"user_position": {
"amount_of_shares": "<string>",
"amount_in_underlying_token": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Vault & User Position
Get Vault data & User Position.
The user position is only included if ‘user_address’ parameter is included.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.erc_4626_vaults.vaults_vault(chain=models.V1VaultsVaultChain.ETHEREUM, vault_address="0x182863131F9a4630fF9E27830d945B1413e347E8", user_address="0xb8340945eBc917D2Aa0368a5e4E79C849c461511")
# Handle response
print(res)import { CompassApiSDK } from "@compass-labs/api-sdk";
const compassApiSDK = new CompassApiSDK({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await compassApiSDK.erc4626Vaults.vaultsVault({
chain: "ethereum",
vaultAddress: "0x182863131F9a4630fF9E27830d945B1413e347E8",
userAddress: "0xb8340945eBc917D2Aa0368a5e4E79C849c461511",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/vaults/vault \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/vaults/vault', 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://api.compasslabs.ai/v1/vaults/vault",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://api.compasslabs.ai/v1/vaults/vault"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.compasslabs.ai/v1/vaults/vault")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/vaults/vault")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"total_assets": "<string>",
"total_supply": "<string>",
"share_price": "<string>",
"underlying_token": {
"address": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123
},
"apy": {
"current": "<string>",
"apy_1_day": "<string>",
"apy_7_day": "<string>",
"apy_30_day": "<string>"
},
"user_position": {
"amount_of_shares": "<string>",
"amount_in_underlying_token": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
arbitrum, base, ethereum Optional block number (defaults to latest).
The vault address of the desired vault position.
The user address of the desired vault position. Only include if you would like the user position included in the response. Defaults to None.
Response
Successful Response
Name of the vault.
Symbol of the vault.
Number of decimals used for the vault's share precision.
Total amount of assets deposited in the vault.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Total amount of shares issued from the vault.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The price of one vault share in terms of the underlying asset.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Underlying token (asset) used by the vault.
Show child attributes
Show child attributes
Average APY over various time periods.
Show child attributes
Show child attributes
The user's position in the vault.
Show child attributes
Show child attributes
Was this page helpful?