from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.aave_v3.aave_user_position_summary(chain=models.V1AaveUserPositionSummaryChain.BASE, user="0x3254f3b1918637ba924e3F18968Cb74219974b63")
# 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.aaveV3.aaveUserPositionSummary({
chain: "base",
user: "0x3254f3b1918637ba924e3F18968Cb74219974b63",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/aave/user_position_summary \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/aave/user_position_summary', 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/aave/user_position_summary",
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/aave/user_position_summary"
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/aave/user_position_summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/aave/user_position_summary")
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{
"maximum_loan_to_value_ratio": "<string>",
"health_factor": "<string>",
"total_collateral": "<string>",
"total_debt": "<string>",
"available_borrows": "<string>",
"liquidation_threshold": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Positions - Total
This endpoint retrieves a comprehensive summary of a user’s position on the AAVE platform.
It provides key financial metrics including the total collateral deposited, total debt accrued, available borrowing capacity, liquidation threshold, maximum loan-to- value ratio, and the health factor of the user’s account. These metrics are calculated by aggregating data across all open positions held by the user, offering a holistic view of their financial standing within the AAVE ecosystem.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.aave_v3.aave_user_position_summary(chain=models.V1AaveUserPositionSummaryChain.BASE, user="0x3254f3b1918637ba924e3F18968Cb74219974b63")
# 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.aaveV3.aaveUserPositionSummary({
chain: "base",
user: "0x3254f3b1918637ba924e3F18968Cb74219974b63",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v1/aave/user_position_summary \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v1/aave/user_position_summary', 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/aave/user_position_summary",
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/aave/user_position_summary"
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/aave/user_position_summary")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v1/aave/user_position_summary")
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{
"maximum_loan_to_value_ratio": "<string>",
"health_factor": "<string>",
"total_collateral": "<string>",
"total_debt": "<string>",
"available_borrows": "<string>",
"liquidation_threshold": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
arbitrum, base, ethereum Optional block number (defaults to latest).
The user to get position summary for.
Response
Successful Response
The loan to value ratio of a user.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The health factor of a user. If this is above 1 it is safe; below 1 and the user is in risk of liquidation. This number might be very high (which would mean the user is safe!)
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The total collateral (in USD) of a user.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The total debt (in USD) of a user.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The available borrows (in USD) of a user.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$The liquidation threshold of a user. A user might exceed this due to changing asset values.
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Was this page helpful?