> ## Documentation Index
> Fetch the complete documentation index at: https://docs.compasslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml /v2/combined_spec.json get /v2/credit/positions
openapi: 3.1.0
info:
  title: Compass API
  description: Compass Labs DeFi API
  version: 0.0.1
servers:
  - url: https://api.compasslabs.ai
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /v2/credit/positions:
    get:
      tags:
        - Credit
      summary: List credit positions
      description: >-
        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.
      operationId: v2_credit_positions
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - bsc
              - ethereum
              - tempo
            title: Chain
            default: base
        - name: owner
          in: query
          required: true
          schema:
            type: string
            title: Owner
            default: '0x06A9aF046187895AcFc7258450B15397CAc67400'
          description: The address of the owner of the credit account to get positions for.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditPositionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: python
          label: Python (SDK)
          source: |-
            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)
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            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();
components:
  schemas:
    CreditPositionsResponse:
      properties:
        collateral_positions:
          items:
            $ref: '#/components/schemas/CollateralPosition'
          type: array
          title: Collateral Positions
          description: All collateral positions, one per reserve.
          default: []
          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:
          items:
            $ref: '#/components/schemas/DebtPosition'
          type: array
          title: Debt Positions
          description: All debt positions, one per reserve.
          default: []
          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'
        account_summary:
          $ref: '#/components/schemas/AccountSummary'
          description: 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'
            protocol: AAVE
            total_collateral_usd: '5000.0000000000'
            total_debt_usd: '3750.0000000000'
        euler_account_summaries:
          items:
            $ref: '#/components/schemas/AccountSummary'
          type: array
          title: Euler Account Summaries
          description: >-
            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.
          default: []
        euler_account_summary:
          anyOf:
            - $ref: '#/components/schemas/AccountSummary'
            - type: 'null'
          description: >-
            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.
        euler_borrowable_tokens:
          items:
            $ref: '#/components/schemas/BorrowableToken'
          type: array
          title: Euler Borrowable Tokens
          description: >-
            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.
          default: []
        borrowable_tokens:
          items:
            $ref: '#/components/schemas/BorrowableToken'
          type: array
          title: Borrowable Tokens
          description: >-
            All tokens available for borrowing with max amounts based on current
            collateral.
          default: []
          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:
          anyOf:
            - type: string
            - type: 'null'
          title: Total Usd Value
          description: >-
            Net position value in USD (total collateral - total debt). Null if
            prices unavailable.
          example: '1250.0000000000'
      type: object
      required:
        - account_summary
      title: CreditPositionsResponse
      description: >-
        Credit account positions response with per-reserve positions and account
        summary.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollateralPosition:
      properties:
        token:
          type: string
          title: Token
          description: Address of the collateral token.
        symbol:
          type: string
          title: Symbol
          description: Symbol of the collateral token (e.g. USDC).
        protocol:
          $ref: '#/components/schemas/CreditProtocol'
          description: Lending protocol this position belongs to.
          default: AAVE
        vault:
          anyOf:
            - type: string
            - type: 'null'
          title: Vault
          description: 'Euler only: the EVK collateral vault holding this position.'
        sub_account_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sub Account Id
          description: >-
            Euler only: the EVC sub-account (0–255) this position belongs to.
            Each sub-account is an independent Euler position with its own
            health. Null for Aave/Morpho.
        market_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Market Id
          description: >-
            Morpho only: the bytes32 id of the isolated market holding this
            position.
        is_pure_supply:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Pure Supply
          description: >-
            Morpho only: true when this is a loan-asset supply position (earning
            supply APY) rather than collateral backing borrows.
        amount_supplied:
          anyOf:
            - type: string
            - type: 'null'
          title: Amount Supplied
          description: >-
            Current on-chain collateral balance (the vault's underlying asset
            for Euler).
        usd_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Usd Value
          description: Collateral value in USD.
        supply_apy:
          anyOf:
            - type: string
            - type: 'null'
          title: Supply Apy
          description: Current supply APY in percentage (e.g. 4.5 means 4.5%).
        total_deposited:
          anyOf:
            - type: string
            - type: 'null'
          title: Total Deposited
          description: Total collateral deposited over all time.
        total_withdrawn:
          anyOf:
            - type: string
            - type: 'null'
          title: Total Withdrawn
          description: Total collateral withdrawn over all time.
        interest_earned:
          anyOf:
            - type: string
            - type: 'null'
          title: Interest Earned
          description: >-
            Interest earned on collateral: on_chain_balance + total_withdrawn -
            total_deposited.
        max_ltv:
          anyOf:
            - type: string
            - type: 'null'
          title: Max Ltv
          description: >-
            Maximum loan-to-value ratio for this collateral in percentage (e.g.
            80 means 80%).
        events:
          items:
            $ref: '#/components/schemas/CreditEvent'
          type: array
          title: Events
          description: All historical events for this collateral reserve.
          default: []
      additionalProperties: false
      type: object
      required:
        - token
        - symbol
        - amount_supplied
      title: CollateralPosition
      description: A per-reserve collateral position.
    DebtPosition:
      properties:
        token:
          type: string
          title: Token
          description: Address of the borrow token.
        symbol:
          type: string
          title: Symbol
          description: Symbol of the borrow token (e.g. WETH).
        protocol:
          $ref: '#/components/schemas/CreditProtocol'
          description: Lending protocol this position belongs to.
          default: AAVE
        vault:
          anyOf:
            - type: string
            - type: 'null'
          title: Vault
          description: 'Euler only: the EVK borrow vault this debt is owed to.'
        sub_account_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sub Account Id
          description: >-
            Euler only: the EVC sub-account (0–255) this debt belongs to. Each
            sub-account is an independent Euler position with its own health.
            Null for Aave/Morpho.
        market_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Market Id
          description: >-
            Morpho only: the bytes32 id of the isolated market this debt is owed
            to.
        health_factor:
          anyOf:
            - type: string
            - type: 'null'
          title: Health Factor
          description: >-
            Morpho only: this market's health factor (markets are isolated, so
            health is per market — below 1 the position is liquidatable). Null
            for other protocols and when the oracle read fails.
        amount_borrowed:
          anyOf:
            - type: string
            - type: 'null'
          title: Amount Borrowed
          description: >-
            Current on-chain debt balance (the vault's underlying asset for
            Euler).
        usd_value:
          anyOf:
            - type: string
            - type: 'null'
          title: Usd Value
          description: Debt value in USD.
        borrow_apy:
          anyOf:
            - type: string
            - type: 'null'
          title: Borrow Apy
          description: Current borrow APY in percentage (e.g. 4.5 means 4.5%).
        total_borrowed:
          anyOf:
            - type: string
            - type: 'null'
          title: Total Borrowed
          description: Total amount borrowed across all borrow events.
        total_repaid:
          anyOf:
            - type: string
            - type: 'null'
          title: Total Repaid
          description: Total amount repaid across all repay events.
        interest_paid:
          anyOf:
            - type: string
            - type: 'null'
          title: Interest Paid
          description: >-
            Interest paid on debt: on_chain_balance + total_repaid -
            total_borrowed.
        events:
          items:
            $ref: '#/components/schemas/CreditEvent'
          type: array
          title: Events
          description: All historical events for this debt reserve.
          default: []
      additionalProperties: false
      type: object
      required:
        - token
        - symbol
        - amount_borrowed
      title: DebtPosition
      description: A per-reserve debt position.
    AccountSummary:
      properties:
        protocol:
          $ref: '#/components/schemas/CreditProtocol'
          description: Lending protocol this summary describes.
          default: AAVE
        sub_account_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sub Account Id
          description: >-
            Euler only: the EVC sub-account (0–255) this summary describes.
            Euler health is per-sub-account. Null for Aave/Morpho.
        health_factor:
          type: string
          title: Health Factor
          description: Health factor. Above 1 is safe; below 1 risks liquidation.
        total_collateral_usd:
          type: string
          title: Total Collateral Usd
          description: Total collateral value in USD.
        total_debt_usd:
          type: string
          title: Total Debt Usd
          description: Total debt value in USD.
        available_borrows_usd:
          type: string
          title: Available Borrows Usd
          description: Available borrow capacity in USD.
        ltv:
          type: string
          title: Ltv
          description: Current loan-to-value ratio.
        emode_category_id:
          type: integer
          title: Emode Category Id
          description: >-
            E-Mode category ID. 0 = disabled. E-Mode gives higher LTV when
            collateral and debt are price-correlated (e.g.
            stablecoin-to-stablecoin or ETH-to-ETH-derivative).
          default: 0
        emode_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Emode Label
          description: >-
            Human-readable E-Mode category name (e.g. 'Stablecoins', 'ETH
            correlated'). Null when E-Mode is disabled (category 0).
      additionalProperties: false
      type: object
      required:
        - health_factor
        - total_collateral_usd
        - total_debt_usd
        - available_borrows_usd
        - ltv
      title: AccountSummary
      description: >-
        Account-level summary for one lending protocol.


        Populated from Aave ``getUserAccountData()`` or, for Euler, from the

        controller vault's risk engine (``accountLiquidity``). The E-Mode fields
        are

        Aave-only and stay at their defaults for Euler.
    BorrowableToken:
      properties:
        token:
          type: string
          title: Token
          description: Address of the borrowable token.
        symbol:
          type: string
          title: Symbol
          description: Symbol of the borrowable token (e.g. WETH).
        vault:
          anyOf:
            - type: string
            - type: 'null'
          title: Vault
          description: >-
            Euler only: the EVK borrow vault to borrow this token from (pass as
            borrow_vault).
        max_borrowable_amount:
          type: string
          title: Max Borrowable Amount
          description: >-
            Maximum amount that can be borrowed based on available borrow
            capacity and token price.
        borrow_apy:
          anyOf:
            - type: string
            - type: 'null'
          title: Borrow Apy
          description: >-
            Current variable borrow APY in percentage (e.g. 4.5 means 4.5%).
            Null if the rate is unavailable.
      additionalProperties: false
      type: object
      required:
        - token
        - symbol
        - max_borrowable_amount
      title: BorrowableToken
      description: A token available for borrowing with the maximum borrowable amount.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CreditProtocol:
      type: string
      enum:
        - AAVE
        - EULER
        - MORPHO
      title: CreditProtocol
      description: >-
        Which lending protocol a credit action targets.


        ``AAVE`` is the default so existing callers (which never send a
        ``protocol``

        field) keep hitting the unchanged Aave code path. ``EULER`` opts in to
        the

        Euler V2 path, where the market is identified by EVK vault address(es).

        ``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id)
        and is

        currently read-only: positions and market discovery only — transaction

        builders land with the looping work (COM-7106/7107/7108), so transact

        endpoints reject it with a 422.
    CreditEvent:
      properties:
        event_type:
          type: string
          enum:
            - supply
            - withdraw
            - borrow
            - repay
            - liquidation
            - transfer_in
            - transfer_out
          title: Event Type
          description: Type of credit event.
        block_number:
          type: integer
          title: Block Number
          description: Block number when the event occurred
        block_timestamp:
          type: string
          format: date-time
          title: Block Timestamp
          description: Timestamp when the event occurred
        transaction_hash:
          type: string
          title: Transaction Hash
          description: Transaction hash of the event
        amount:
          type: string
          title: Amount
          description: Amount involved in the event
        symbol:
          type: string
          title: Symbol
          description: Symbol of the token
      type: object
      required:
        - event_type
        - block_number
        - block_timestamp
        - transaction_hash
        - amount
        - symbol
      title: CreditEvent
      description: A single historical event in a credit position.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````