from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.credit.credit_positions(chain=models.V2CreditPositionsChain.BASE, owner="0x06A9aF046187895AcFc7258450B15397CAc67400")
# 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.credit.creditPositions({
chain: "base",
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/credit/positions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/credit/positions', 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/credit/positions",
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/credit/positions"
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/credit/positions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/credit/positions")
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{
"account_summary": {
"available_borrows_usd": "250.0000000000",
"emode_category_id": 0,
"health_factor": "2.1300000000",
"ltv": "75.0000000000",
"protocol": "AAVE",
"total_collateral_usd": "5000.0000000000",
"total_debt_usd": "3750.0000000000"
},
"collateral_positions": [
{
"amount_supplied": "5000.0000000000",
"events": [
{
"amount": "5000.0000000000",
"block_number": 25000000,
"block_timestamp": "2025-01-15T10:30:00Z",
"event_type": "supply",
"symbol": "USDC",
"transaction_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_earned": "12.3456780000",
"max_ltv": "80.0000000000",
"supply_apy": "3.2500000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"total_deposited": "5000.0000000000",
"total_withdrawn": "0.0000000000",
"usd_value": "5000.0000000000"
}
],
"debt_positions": [
{
"amount_borrowed": "1.5000000000",
"borrow_apy": "2.8500000000",
"events": [
{
"amount": "1.5000000000",
"block_number": 25000100,
"block_timestamp": "2025-01-15T10:35:00Z",
"event_type": "borrow",
"symbol": "WETH",
"transaction_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_paid": "0.0023450000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006",
"total_borrowed": "1.5000000000",
"total_repaid": "0.0000000000",
"usd_value": "3750.0000000000"
}
],
"euler_account_summaries": [],
"euler_account_summary": {
"health_factor": "<string>",
"total_collateral_usd": "<string>",
"total_debt_usd": "<string>",
"available_borrows_usd": "<string>",
"ltv": "<string>",
"protocol": "AAVE",
"sub_account_id": 123,
"emode_category_id": 0,
"emode_label": "<string>"
},
"euler_borrowable_tokens": [],
"borrowable_tokens": [
{
"borrow_apy": "2.8500000000",
"max_borrowable_amount": "0.1000000000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006"
},
{
"borrow_apy": "5.1200000000",
"max_borrowable_amount": "250.0000000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"total_usd_value": "1250.0000000000"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List credit positions
List all Credit positions for a given owner.
Returns a unified list of positions (collateral and debt) and an account summary with health factor and LTV. Each position includes event history.
from compass_api_sdk import CompassAPI, models
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.credit.credit_positions(chain=models.V2CreditPositionsChain.BASE, owner="0x06A9aF046187895AcFc7258450B15397CAc67400")
# 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.credit.creditPositions({
chain: "base",
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/credit/positions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/credit/positions', 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/credit/positions",
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/credit/positions"
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/credit/positions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/credit/positions")
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{
"account_summary": {
"available_borrows_usd": "250.0000000000",
"emode_category_id": 0,
"health_factor": "2.1300000000",
"ltv": "75.0000000000",
"protocol": "AAVE",
"total_collateral_usd": "5000.0000000000",
"total_debt_usd": "3750.0000000000"
},
"collateral_positions": [
{
"amount_supplied": "5000.0000000000",
"events": [
{
"amount": "5000.0000000000",
"block_number": 25000000,
"block_timestamp": "2025-01-15T10:30:00Z",
"event_type": "supply",
"symbol": "USDC",
"transaction_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_earned": "12.3456780000",
"max_ltv": "80.0000000000",
"supply_apy": "3.2500000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"total_deposited": "5000.0000000000",
"total_withdrawn": "0.0000000000",
"usd_value": "5000.0000000000"
}
],
"debt_positions": [
{
"amount_borrowed": "1.5000000000",
"borrow_apy": "2.8500000000",
"events": [
{
"amount": "1.5000000000",
"block_number": 25000100,
"block_timestamp": "2025-01-15T10:35:00Z",
"event_type": "borrow",
"symbol": "WETH",
"transaction_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_paid": "0.0023450000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006",
"total_borrowed": "1.5000000000",
"total_repaid": "0.0000000000",
"usd_value": "3750.0000000000"
}
],
"euler_account_summaries": [],
"euler_account_summary": {
"health_factor": "<string>",
"total_collateral_usd": "<string>",
"total_debt_usd": "<string>",
"available_borrows_usd": "<string>",
"ltv": "<string>",
"protocol": "AAVE",
"sub_account_id": 123,
"emode_category_id": 0,
"emode_label": "<string>"
},
"euler_borrowable_tokens": [],
"borrowable_tokens": [
{
"borrow_apy": "2.8500000000",
"max_borrowable_amount": "0.1000000000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006"
},
{
"borrow_apy": "5.1200000000",
"max_borrowable_amount": "250.0000000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
],
"total_usd_value": "1250.0000000000"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
arbitrum, base, bsc, ethereum, hyperevm, tempo The address of the owner of the credit account to get positions for.
Response
Successful Response
Credit account positions response with per-reserve positions and account summary.
Aave account-level summary (health factor, LTV, etc.).
Show child attributes
Show child attributes
{
"available_borrows_usd": "250.0000000000",
"emode_category_id": 0,
"health_factor": "2.1300000000",
"ltv": "75.0000000000",
"protocol": "AAVE",
"total_collateral_usd": "5000.0000000000",
"total_debt_usd": "3750.0000000000"
}
All collateral positions, one per reserve.
Show child attributes
Show child attributes
[
{
"amount_supplied": "5000.0000000000",
"events": [
{
"amount": "5000.0000000000",
"block_number": 25000000,
"block_timestamp": "2025-01-15T10:30:00Z",
"event_type": "supply",
"symbol": "USDC",
"transaction_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_earned": "12.3456780000",
"max_ltv": "80.0000000000",
"supply_apy": "3.2500000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"total_deposited": "5000.0000000000",
"total_withdrawn": "0.0000000000",
"usd_value": "5000.0000000000"
}
]
All debt positions, one per reserve.
Show child attributes
Show child attributes
[
{
"amount_borrowed": "1.5000000000",
"borrow_apy": "2.8500000000",
"events": [
{
"amount": "1.5000000000",
"block_number": 25000100,
"block_timestamp": "2025-01-15T10:35:00Z",
"event_type": "borrow",
"symbol": "WETH",
"transaction_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"interest_paid": "0.0023450000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006",
"total_borrowed": "1.5000000000",
"total_repaid": "0.0000000000",
"usd_value": "3750.0000000000"
}
]
Euler account-level summaries — ONE PER ACTIVE EVC SUB-ACCOUNT (Euler health is per-sub-account, so an owner with positions on sub-accounts 0 and 3 gets two entries, each carrying its sub_account_id and independent health factor). Empty for accounts with no Euler positions. Supersedes the singular euler_account_summary.
Show child attributes
Show child attributes
DEPRECATED (use euler_account_summaries): the sub-account-0 Euler account-level summary, kept for one release for backwards compatibility. Present only when the account holds Euler positions; for a multi-sub-account owner it reflects only sub-account 0 (or the first active sub-account if 0 is empty). Null for Aave-only accounts.
Show child attributes
Show child attributes
Euler-only: additional borrowable amounts given the account's current Euler controller (i.e. borrow more of the controller's asset). Empty for accounts with no Euler borrow position — use /credit/euler_markets to discover a new market to borrow from.
Show child attributes
Show child attributes
All tokens available for borrowing with max amounts based on current collateral.
Show child attributes
Show child attributes
[
{
"borrow_apy": "2.8500000000",
"max_borrowable_amount": "0.1000000000",
"symbol": "WETH",
"token": "0x4200000000000000000000000000000000000006"
},
{
"borrow_apy": "5.1200000000",
"max_borrowable_amount": "250.0000000000",
"symbol": "USDC",
"token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
}
]
Net position value in USD (total collateral - total debt). Null if prices unavailable.
"1250.0000000000"
Was this page helpful?