Skip to main content
GET
/
v2
/
credit
/
looped_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_looped_positions(chain=models.V2CreditLoopedPositionsChain.BASE, owner="0x06A9aF046187895AcFc7258450B15397CAc67400")

    # Handle response
    print(res)
{
  "credit_account_address": "<string>",
  "positions": [
    {
      "collateral_symbol": "WETH",
      "collateral_token": "0x4200000000000000000000000000000000000006",
      "current": {
        "collateral_amount": "3.0000000000",
        "collateral_usd": "9000.0000000000",
        "debt_amount": "5000.0000000000",
        "debt_usd": "5000.0000000000",
        "health_factor": "1.5480000000",
        "health_factor_scope": "market",
        "leverage": "2.2500000000",
        "net_usd_value": "4000.0000000000"
      },
      "debt_symbol": "USDC",
      "debt_token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "history": [
        {
          "block_number": 25000000,
          "block_timestamp": "2025-01-15T10:30:00Z",
          "classification": "loop_open",
          "collateral_delta": "3.0000000000",
          "debt_delta": "5000.0000000000",
          "events": [],
          "iterations": 2,
          "swap": {
            "bought_amount": "1.6600000000",
            "bought_symbol": "WETH",
            "bought_token": "0x4200000000000000000000000000000000000006",
            "sold_amount": "5000.0000000000",
            "sold_symbol": "USDC",
            "sold_token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
          },
          "transaction_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890"
        }
      ],
      "market_id": "0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda",
      "opened_at": "2025-01-15T10:30:00Z",
      "protocol": "MORPHO",
      "status": "OPEN",
      "totals": {
        "liquidation_count": 0,
        "loop_tx_count": 1,
        "total_collateral_added": "3.0000000000",
        "total_collateral_removed": "0.0000000000",
        "total_debt_added": "5000.0000000000",
        "total_debt_removed": "0.0000000000",
        "unwind_tx_count": 0
      }
    }
  ],
  "aave_account_summary": {
    "health_factor": "<string>",
    "total_collateral_usd": "<string>",
    "total_debt_usd": "<string>",
    "available_borrows_usd": "<string>",
    "ltv": "<string>",
    "protocol": "AAVE",
    "emode_category_id": 0,
    "emode_label": "<string>"
  }
}

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,
bsc,
ethereum,
tempo
owner
string
default:0x06A9aF046187895AcFc7258450B15397CAc67400
required

The address of the owner of the credit account to get looped positions for.

Response

Successful Response

Looped positions across Aave V3 and Morpho Blue for a credit account.

credit_account_address
string
required

The credit product account address derived from the owner.

positions
LoopedPosition · object[]

All looped positions, on both Aave and Morpho.

Example:
[
{
"collateral_symbol": "WETH",
"collateral_token": "0x4200000000000000000000000000000000000006",
"current": {
"collateral_amount": "3.0000000000",
"collateral_usd": "9000.0000000000",
"debt_amount": "5000.0000000000",
"debt_usd": "5000.0000000000",
"health_factor": "1.5480000000",
"health_factor_scope": "market",
"leverage": "2.2500000000",
"net_usd_value": "4000.0000000000"
},
"debt_symbol": "USDC",
"debt_token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"history": [
{
"block_number": 25000000,
"block_timestamp": "2025-01-15T10:30:00Z",
"classification": "loop_open",
"collateral_delta": "3.0000000000",
"debt_delta": "5000.0000000000",
"events": [],
"iterations": 2,
"swap": {
"bought_amount": "1.6600000000",
"bought_symbol": "WETH",
"bought_token": "0x4200000000000000000000000000000000000006",
"sold_amount": "5000.0000000000",
"sold_symbol": "USDC",
"sold_token": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
},
"transaction_hash": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef1234567890abcdef1234567890"
}
],
"market_id": "0x8793cf302b8ffd655ab97bd1c695dbd967807e8367a65cb2f4edaf1380ba1bda",
"opened_at": "2025-01-15T10:30:00Z",
"protocol": "MORPHO",
"status": "OPEN",
"totals": {
"liquidation_count": 0,
"loop_tx_count": 1,
"total_collateral_added": "3.0000000000",
"total_collateral_removed": "0.0000000000",
"total_debt_added": "5000.0000000000",
"total_debt_removed": "0.0000000000",
"unwind_tx_count": 0
}
}
]
aave_account_summary
AccountSummary · object | null

Aave account-level summary (health factor, LTV, borrow capacity). Present when the account holds any open Aave looped position, since Aave collateral is pooled and health is account-level. Null for Morpho-only accounts.