from compass_api_sdk import CompassAPI
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.earn.earn_positions_all(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.earn.earnPositionsAll({
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/earn/positions_all \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/earn/positions_all', 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/positions_all",
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/positions_all"
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/positions_all")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/earn/positions_all")
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{
"chains": {
"arbitrum": {
"aave": [],
"pendle_pt": [],
"vaults": []
},
"base": {
"aave": [
{
"balance": "1250.5432100000",
"deposits": [],
"pnl": {
"current_value": "1250.5432100000",
"realized_pnl": "0.0000000000",
"total_deposited": "1200.0000000000",
"total_pnl": "50.5432100000",
"total_pnl_percent": "4.2119341667",
"unrealized_pnl": "50.5432100000"
},
"reserve_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"reserve_symbol": "USDC",
"type": "AAVE",
"withdrawals": []
}
],
"pendle_pt": [],
"total_usd_value": "1250.54",
"vaults": []
},
"ethereum": {
"aave": [],
"pendle_pt": [],
"total_usd_value": "5000.12",
"vaults": [
{
"balance": "5000.1234560000",
"deposits": [],
"pnl": {
"current_value": "5000.1234560000",
"realized_pnl": "0.0000000000",
"total_deposited": "4800.0000000000",
"total_pnl": "200.1234560000",
"total_pnl_percent": "4.1692386667",
"unrealized_pnl": "200.1234560000"
},
"type": "VAULT",
"underlying_symbol": "USDC",
"vault_address": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
"vault_name": "Steakhouse USDC",
"withdrawals": []
}
]
}
},
"total_usd_value": "6250.66"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}List earn positions across all chains
List all Earn positions across all supported chains (Ethereum, Base, Arbitrum).
Returns positions grouped by chain, with per-chain and total USD values. Each chain includes Aave, vault, and Pendle PT positions. Chains where the user has no earn account return empty position lists.
Use this endpoint for a cross-chain portfolio overview instead of making separate calls per chain to /positions.
from compass_api_sdk import CompassAPI
with CompassAPI(
api_key_auth="<YOUR_API_KEY_HERE>",
) as compass_api:
res = compass_api.earn.earn_positions_all(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.earn.earnPositionsAll({
owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
});
console.log(result);
}
run();curl --request GET \
--url https://api.compasslabs.ai/v2/earn/positions_all \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.compasslabs.ai/v2/earn/positions_all', 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/positions_all",
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/positions_all"
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/positions_all")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compasslabs.ai/v2/earn/positions_all")
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{
"chains": {
"arbitrum": {
"aave": [],
"pendle_pt": [],
"vaults": []
},
"base": {
"aave": [
{
"balance": "1250.5432100000",
"deposits": [],
"pnl": {
"current_value": "1250.5432100000",
"realized_pnl": "0.0000000000",
"total_deposited": "1200.0000000000",
"total_pnl": "50.5432100000",
"total_pnl_percent": "4.2119341667",
"unrealized_pnl": "50.5432100000"
},
"reserve_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"reserve_symbol": "USDC",
"type": "AAVE",
"withdrawals": []
}
],
"pendle_pt": [],
"total_usd_value": "1250.54",
"vaults": []
},
"ethereum": {
"aave": [],
"pendle_pt": [],
"total_usd_value": "5000.12",
"vaults": [
{
"balance": "5000.1234560000",
"deposits": [],
"pnl": {
"current_value": "5000.1234560000",
"realized_pnl": "0.0000000000",
"total_deposited": "4800.0000000000",
"total_pnl": "200.1234560000",
"total_pnl_percent": "4.1692386667",
"unrealized_pnl": "200.1234560000"
},
"type": "VAULT",
"underlying_symbol": "USDC",
"vault_address": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
"vault_name": "Steakhouse USDC",
"withdrawals": []
}
]
}
},
"total_usd_value": "6250.66"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Query Parameters
The address of the owner of the earn account.
Response
Successful Response
Positions across all chains, grouped by chain name.
Each chain key maps to an EarnPositionsResponse containing that chain's aave, vaults, and pendle_pt positions with per-chain total_usd_value.
Positions grouped by chain. Keys: 'ethereum', 'base', 'arbitrum'.
Show child attributes
Show child attributes
{
"arbitrum": { "aave": [], "pendle_pt": [], "vaults": [] },
"base": {
"aave": [
{
"balance": "1250.5432100000",
"deposits": [],
"pnl": {
"current_value": "1250.5432100000",
"realized_pnl": "0.0000000000",
"total_deposited": "1200.0000000000",
"total_pnl": "50.5432100000",
"total_pnl_percent": "4.2119341667",
"unrealized_pnl": "50.5432100000"
},
"reserve_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"reserve_symbol": "USDC",
"type": "AAVE",
"withdrawals": []
}
],
"pendle_pt": [],
"total_usd_value": "1250.54",
"vaults": []
},
"ethereum": {
"aave": [],
"pendle_pt": [],
"total_usd_value": "5000.12",
"vaults": [
{
"balance": "5000.1234560000",
"deposits": [],
"pnl": {
"current_value": "5000.1234560000",
"realized_pnl": "0.0000000000",
"total_deposited": "4800.0000000000",
"total_pnl": "200.1234560000",
"total_pnl_percent": "4.1692386667",
"unrealized_pnl": "200.1234560000"
},
"type": "VAULT",
"underlying_symbol": "USDC",
"vault_address": "0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB",
"vault_name": "Steakhouse USDC",
"withdrawals": []
}
]
}
}
Total USD value of all positions across all chains.
"6250.66"
Was this page helpful?