from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.ethena.ethena_vault(chain=models.V1EthenaVaultChain.ETHEREUM, 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.ethena.ethenaVault({
chain: "ethereum",
userAddress: "0xb8340945eBc917D2Aa0368a5e4E79C849c461511",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/ethena/vault \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/ethena/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/ethena/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/ethena/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/ethena/vault")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/ethena/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>"
},
"cooldown_duration_days": 123,
"user_position": {
"amount_of_shares": "<string>",
"amount_in_underlying_token": "<string>"
},
"cooldown_position": {
"amount_in_underlying_asset": "<string>",
"cooldown_end": "2023-11-07T05:31:56Z",
"can_be_withdrawn": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Get Vault & User Position
Get data & user Position for the Ethena vault on Ethereum.
Vault address: 0x9d39a5de30e57443bff2a8307a4256c8797a3497
The user position is only included in the response if ‘user_address’ parameter is included in the request.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.ethena.ethena_vault(chain=models.V1EthenaVaultChain.ETHEREUM, 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.ethena.ethenaVault({
chain: "ethereum",
userAddress: "0xb8340945eBc917D2Aa0368a5e4E79C849c461511",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/ethena/vault \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/ethena/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/ethena/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/ethena/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/ethena/vault")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/ethena/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>"
},
"cooldown_duration_days": 123,
"user_position": {
"amount_of_shares": "<string>",
"amount_in_underlying_token": "<string>"
},
"cooldown_position": {
"amount_in_underlying_asset": "<string>",
"cooldown_end": "2023-11-07T05:31:56Z",
"can_be_withdrawn": true
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
ethereum Optional block number (defaults to latest).
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 duration of days that must pass before a position can be withdrawn from the Ethena vault after a request to withdraw has been made.
The user's position in the vault.
Show child attributes
Show child attributes
The user's cooldown position.
Show child attributes
Show child attributes
Was this page helpful?