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

# Positions - Total

> This endpoint retrieves a comprehensive summary of a user's position on the AAVE
platform.

It provides key financial metrics including the total collateral deposited, total
debt accrued, available borrowing capacity, liquidation threshold, maximum loan-to-
value ratio, and the health factor of the user's account. These metrics are
calculated by aggregating data across all open positions held by the user, offering
a holistic view of their financial standing within the AAVE ecosystem.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/aave/user_position_summary
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:
  /v1/aave/user_position_summary:
    get:
      tags:
        - Aave V3
      summary: Positions - Total
      description: >-
        This endpoint retrieves a comprehensive summary of a user's position on
        the AAVE

        platform.


        It provides key financial metrics including the total collateral
        deposited, total

        debt accrued, available borrowing capacity, liquidation threshold,
        maximum loan-to-

        value ratio, and the health factor of the user's account. These metrics
        are

        calculated by aggregating data across all open positions held by the
        user, offering

        a holistic view of their financial standing within the AAVE ecosystem.
      operationId: v1_aave_user_position_summary
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: base
        - name: block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Block
          description: Optional block number (defaults to latest).
        - name: user
          in: query
          required: true
          schema:
            type: string
            title: User
            default: '0x3254f3b1918637ba924e3F18968Cb74219974b63'
          description: The user to get position summary for.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AaveUserPositionSummaryResponse'
        '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.aave_v3.aave_user_position_summary(chain=models.V1AaveUserPositionSummaryChain.BASE, user="0x3254f3b1918637ba924e3F18968Cb74219974b63")

                # 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.aaveV3.aaveUserPositionSummary({
                chain: "base",
                user: "0x3254f3b1918637ba924e3F18968Cb74219974b63",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    AaveUserPositionSummaryResponse:
      properties:
        maximum_loan_to_value_ratio:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Maximum Loan To Value Ratio
          description: The loan to value ratio of a user.
        health_factor:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Health Factor
          description: >-
            The health factor of a user. If this is above 1 it is safe; below 1
            and the
                    user is in risk of liquidation. This number might be very high (which would mean the user is
                    safe!)
        total_collateral:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Collateral
          description: The total collateral (in USD) of a user.
        total_debt:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Debt
          description: The total debt (in USD) of a user.
        available_borrows:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Available Borrows
          description: The available borrows (in USD) of a user.
        liquidation_threshold:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Liquidation Threshold
          description: >-
            The liquidation threshold of a user. A user might exceed this due to
            changing
                    asset values.
      type: object
      required:
        - maximum_loan_to_value_ratio
        - health_factor
        - total_collateral
        - total_debt
        - available_borrows
        - liquidation_threshold
      title: AaveUserPositionSummaryResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your Compass API Key. Get your key
        [here](https://www.compasslabs.ai/dashboard).

````