Skip to main content
GET
/
v1
/
vaults
/
apy
Fetch the APY of a vault
curl --request GET \
  --url https://api.paxoslabs.com/v1/vaults/apy
import requests

url = "https://api.paxoslabs.com/v1/vaults/apy"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.paxoslabs.com/v1/vaults/apy', 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.paxoslabs.com/v1/vaults/apy",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.paxoslabs.com/v1/vaults/apy"

	req, _ := http.NewRequest("GET", url, nil)

	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.paxoslabs.com/v1/vaults/apy")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.paxoslabs.com/v1/vaults/apy")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "apy": 12.5,
  "error": null
}
{
  "apy": 0,
  "error": "token_address is not a valid address"
}
{
  "apy": 0,
  "error": "error while fetching exchange rates, review runtime logs for more details"
}

Query Parameters

token_address
string
required

The address of the vault.

Example:

"0x19e099B7aEd41FA52718D780dDA74678113C0b32"

block_number
integer

Block number to calculate the APY at. Optional. Defaults to the latest block.

lookback_days
integer

Number of days to look back for the APY calculation. Defaults to 7 if not provided.

Example:

7

Response

Successful response with APY details

apy
number

Calculated APY value.

Example:

12.5

error
string | null

Error message if any occurred.

Example:

null