Skip to main content
GET
/
v2
/
credit
/
positions
Python (SDK)
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="0x01E62835dd7F52173546A325294762143eE4a882")

    # Handle response
    print(res)
{
  "account_summary": {
    "available_borrows_usd": "250.0000000000",
    "emode_category_id": 0,
    "health_factor": "2.1300000000",
    "ltv": "75.0000000000",
    "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"
    }
  ],
  "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"
}

Authorizations

x-api-key
string
header
required

Your Compass API Key. Get your key here.

Query Parameters

chain
enum<string>
default:base
required
Available options:
arbitrum,
base,
ethereum
owner
string
default:0x01E62835dd7F52173546A325294762143eE4a882
required

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.

account_summary
AccountSummary · object
required

Aave account-level summary (health factor, LTV, etc.).

Example:
{
"available_borrows_usd": "250.0000000000",
"emode_category_id": 0,
"health_factor": "2.1300000000",
"ltv": "75.0000000000",
"total_collateral_usd": "5000.0000000000",
"total_debt_usd": "3750.0000000000"
}
collateral_positions
CollateralPosition · object[]

All collateral positions, one per reserve.

Example:
[
{
"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
DebtPosition · object[]

All debt positions, one per reserve.

Example:
[
{
"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"
}
]
borrowable_tokens
BorrowableToken · object[]

All tokens available for borrowing with max amounts based on current collateral.

Example:
[
{
"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
string | null

Net position value in USD (total collateral - total debt). Null if prices unavailable.

Example:

"1250.0000000000"