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

# Liquidity Index

> This endpoint retrieves the change in the reserve liquidity index between two
provided blocks.

This is then converted to a percentage change. The liquidity index represents the
change in debt and interest accrual over each block. Aave does not store individual
user balances directly. Instead, it keeps a scaled balance and uses the liquidity
index to compute real balances dynamically. If a user was to have deposited tokens
at the start block, a positive liquidity index change will represent accrued
interest and a profit. If tokens were borrowed at the start block, this debt will
increase, compound on itself and represent large debt. The reverse in both cases is
true if the liquidity index is negative.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/aave/liquidity/change
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/liquidity/change:
    get:
      tags:
        - Aave V3
      summary: Liquidity Index
      description: >-
        This endpoint retrieves the change in the reserve liquidity index
        between two

        provided blocks.


        This is then converted to a percentage change. The liquidity index
        represents the

        change in debt and interest accrual over each block. Aave does not store
        individual

        user balances directly. Instead, it keeps a scaled balance and uses the
        liquidity

        index to compute real balances dynamically. If a user was to have
        deposited tokens

        at the start block, a positive liquidity index change will represent
        accrued

        interest and a profit. If tokens were borrowed at the start block, this
        debt will

        increase, compound on itself and represent large debt. The reverse in
        both cases is

        true if the liquidity index is negative.
      operationId: v1_aave_liquidity_change
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: token
          in: query
          required: true
          schema:
            type: string
            title: Token
            description: >-
              A token identifier - either a supported symbol (e.g., USDC, WETH)
              or a valid Ethereum address (0x...)
            examples:
              - USDC
              - WETH
              - '0xA0b86a33E6441ccF30EE5DdEF1E9b652C91ac1c8'
            default: USDC
          description: The symbol or address of the asset to get liquidity change for..
        - name: start_block
          in: query
          required: true
          schema:
            type: integer
            minimum: 0
            title: Start Block
            default: 0
          description: The start block to calculate liquidity change from.
        - name: end_block
          in: query
          required: true
          schema:
            type: integer
            minimum: 0
            title: End Block
            default: 319407231
          description: The end block to calculate liquidity change to.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AaveLiquidityChangeResponse'
        '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_liquidity_change(chain=models.V1AaveLiquidityChangeChain.ARBITRUM, token="USDC", start_block=0, end_block=319407231)

                # 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.aaveLiquidityChange({
                chain: "arbitrum",
                token: "USDC",
                startBlock: 0,
                endBlock: 319407231,
              });

              console.log(result);
            }

            run();
components:
  schemas:
    AaveLiquidityChangeResponse:
      properties:
        liquidity_change:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Liquidity Change
          description: >-
            The change in the liquidity index between the two times, expressed
            as a percentage.
        start_time:
          type: string
          format: date-time
          title: Start Time
          description: Dateime of starting block
        end_time:
          type: string
          format: date-time
          title: End Time
          description: Datetime of ending block
      type: object
      required:
        - liquidity_change
        - start_time
        - end_time
      title: AaveLiquidityChangeResponse
    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).

````