Skip to main content
GET
/
v2
/
earn
/
aave_markets
Python (SDK)
from compass_api_sdk import CompassAPI


with CompassAPI(
    api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:

    res = compass_api.earn.earn_aave_markets(days=30)

    # 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.earn.earnAaveMarkets({
days: 30,
});

console.log(result);
}

run();
curl --request GET \
--url https://api.compasslabs.ai/v2/earn/aave_markets \
--header 'x-api-key: <api-key>'
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.compasslabs.ai/v2/earn/aave_markets', 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/v2/earn/aave_markets",
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/v2/earn/aave_markets"

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/v2/earn/aave_markets")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.compasslabs.ai/v2/earn/aave_markets")

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
{
  "markets": {
    "USDC": {
      "chains": {
        "arbitrum": {
          "a_token_address": "0x724dc807b04555b71ed48a6896b6F41593b8C637",
          "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
          "available_liquidity": "400000.00",
          "borrow_apy": "4.80",
          "borrow_apy_avg": "4.70",
          "liquidation_threshold": "78.00",
          "ltv": "75.00",
          "reserves": [
            {
              "a_token_address": "0x724dc807b04555b71ed48a6896b6F41593b8C637",
              "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
              "available_liquidity": "400000.00",
              "borrow_apy": "4.80",
              "borrow_apy_avg": "4.70",
              "liquidation_threshold": "78.00",
              "ltv": "75.00",
              "supply_apy": "3.10",
              "supply_apy_avg": "3.05",
              "total_borrowed": "600000.00",
              "utilization_rate": "60.00"
            },
            {
              "a_token_address": "0x625E7708f30cA75bfd92586e17077590C60eb4cD",
              "address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
              "available_liquidity": "100000.00",
              "borrow_apy": "5.60",
              "borrow_apy_avg": "5.50",
              "liquidation_threshold": "0.00",
              "ltv": "0.00",
              "supply_apy": "2.40",
              "supply_apy_avg": "2.35",
              "total_borrowed": "100000.00",
              "utilization_rate": "50.00"
            }
          ],
          "supply_apy": "3.10",
          "supply_apy_avg": "3.05",
          "total_borrowed": "600000.00",
          "utilization_rate": "60.00"
        },
        "base": {
          "a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
          "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
          "available_liquidity": "1234567.68",
          "borrow_apy": "7.35",
          "borrow_apy_avg": "7.10",
          "liquidation_threshold": "80.00",
          "ltv": "77.00",
          "reserves": [
            {
              "a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
              "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
              "available_liquidity": "1234567.68",
              "borrow_apy": "7.35",
              "borrow_apy_avg": "7.10",
              "liquidation_threshold": "80.00",
              "ltv": "77.00",
              "supply_apy": "5.10",
              "supply_apy_avg": "4.95",
              "total_borrowed": "987654.32",
              "utilization_rate": "44.40"
            }
          ],
          "supply_apy": "5.10",
          "supply_apy_avg": "4.95",
          "total_borrowed": "987654.32",
          "utilization_rate": "44.40"
        },
        "ethereum": {
          "a_token_address": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
          "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
          "available_liquidity": "2345678.11",
          "borrow_apy": "6.21",
          "borrow_apy_avg": "6.05",
          "liquidation_threshold": "80.00",
          "ltv": "77.00",
          "reserves": [
            {
              "a_token_address": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
              "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
              "available_liquidity": "2345678.11",
              "borrow_apy": "6.21",
              "borrow_apy_avg": "6.05",
              "liquidation_threshold": "80.00",
              "ltv": "77.00",
              "supply_apy": "4.52",
              "supply_apy_avg": "4.41",
              "total_borrowed": "1234567.89",
              "utilization_rate": "34.50"
            }
          ],
          "supply_apy": "4.52",
          "supply_apy_avg": "4.41",
          "total_borrowed": "1234567.89",
          "utilization_rate": "34.50"
        }
      },
      "max_supply_apy": {
        "a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
        "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "borrow_apy": "7.35",
        "chain": "base",
        "supply_apy": "5.10"
      }
    }
  }
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string> | null

Optional chain filter. If not provided, returns rates for all chains. The chain to use.

Available options:
base,
ethereum,
arbitrum,
hyperevm,
tempo,
bsc
days
integer
default:30

Window in days used to compute supply_apy_avg / borrow_apy_avg. Mirrors the days parameter of the v1 /v1/aave/avg_rate endpoint.

Required range: 1 <= x <= 30

Response

Successful Response

Response containing Aave market rates organized by token symbol.

markets
Markets · object
required

Market data keyed by token symbol. Each token contains chain-specific data and information about which chain has the highest supply APY.

Example:
{
"USDC": {
"chains": {
"arbitrum": {
"a_token_address": "0x724dc807b04555b71ed48a6896b6F41593b8C637",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"available_liquidity": "400000.00",
"borrow_apy": "4.80",
"borrow_apy_avg": "4.70",
"liquidation_threshold": "78.00",
"ltv": "75.00",
"reserves": [
{
"a_token_address": "0x724dc807b04555b71ed48a6896b6F41593b8C637",
"address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
"available_liquidity": "400000.00",
"borrow_apy": "4.80",
"borrow_apy_avg": "4.70",
"liquidation_threshold": "78.00",
"ltv": "75.00",
"supply_apy": "3.10",
"supply_apy_avg": "3.05",
"total_borrowed": "600000.00",
"utilization_rate": "60.00"
},
{
"a_token_address": "0x625E7708f30cA75bfd92586e17077590C60eb4cD",
"address": "0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",
"available_liquidity": "100000.00",
"borrow_apy": "5.60",
"borrow_apy_avg": "5.50",
"liquidation_threshold": "0.00",
"ltv": "0.00",
"supply_apy": "2.40",
"supply_apy_avg": "2.35",
"total_borrowed": "100000.00",
"utilization_rate": "50.00"
}
],
"supply_apy": "3.10",
"supply_apy_avg": "3.05",
"total_borrowed": "600000.00",
"utilization_rate": "60.00"
},
"base": {
"a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"available_liquidity": "1234567.68",
"borrow_apy": "7.35",
"borrow_apy_avg": "7.10",
"liquidation_threshold": "80.00",
"ltv": "77.00",
"reserves": [
{
"a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"available_liquidity": "1234567.68",
"borrow_apy": "7.35",
"borrow_apy_avg": "7.10",
"liquidation_threshold": "80.00",
"ltv": "77.00",
"supply_apy": "5.10",
"supply_apy_avg": "4.95",
"total_borrowed": "987654.32",
"utilization_rate": "44.40"
}
],
"supply_apy": "5.10",
"supply_apy_avg": "4.95",
"total_borrowed": "987654.32",
"utilization_rate": "44.40"
},
"ethereum": {
"a_token_address": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"available_liquidity": "2345678.11",
"borrow_apy": "6.21",
"borrow_apy_avg": "6.05",
"liquidation_threshold": "80.00",
"ltv": "77.00",
"reserves": [
{
"a_token_address": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"available_liquidity": "2345678.11",
"borrow_apy": "6.21",
"borrow_apy_avg": "6.05",
"liquidation_threshold": "80.00",
"ltv": "77.00",
"supply_apy": "4.52",
"supply_apy_avg": "4.41",
"total_borrowed": "1234567.89",
"utilization_rate": "34.50"
}
],
"supply_apy": "4.52",
"supply_apy_avg": "4.41",
"total_borrowed": "1234567.89",
"utilization_rate": "34.50"
}
},
"max_supply_apy": {
"a_token_address": "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
"address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"borrow_apy": "7.35",
"chain": "base",
"supply_apy": "5.10"
}
}
}