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

# Interest Rates

> Returns the latest APY and APR rates for a specified token on Aave, for both
deposits and loans.

**Annual percentage yield (APY)** is the yearly return/cost after continuous
compounding of the per-second rate stored on-chain. This value is the same value as
seen the on [app.aave.com](
https://app.aave.com/)
but more up-to-date as it is taken directly from the
blockchain every time this endpoint is called.

**Annual percentage rate (APR)** is the yearly simple interest rate (no
compounding).

For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.



## OpenAPI

````yaml /v1/combined_spec.json get /v1/aave/rate
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/rate:
    get:
      tags:
        - Aave V3
      summary: Interest Rates
      description: >-
        Returns the latest APY and APR rates for a specified token on Aave, for
        both

        deposits and loans.


        **Annual percentage yield (APY)** is the yearly return/cost after
        continuous

        compounding of the per-second rate stored on-chain. This value is the
        same value as

        seen the on [app.aave.com](

        https://app.aave.com/)

        but more up-to-date as it is taken directly from the

        blockchain every time this endpoint is called.


        **Annual percentage rate (APR)** is the yearly simple interest rate (no

        compounding).


        For APY/APR on loans Aave offers both stable and fixed rates on certain
        tokens.
      operationId: v1_aave_rate
      parameters:
        - name: chain
          in: query
          required: true
          schema:
            type: string
            enum:
              - arbitrum
              - base
              - ethereum
            title: Chain
            default: arbitrum
        - name: block
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Block
          description: Optional block number (defaults to latest).
        - 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 token to fetch the user's position on..
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AaveRateResponse'
        '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_rate(chain=models.V1AaveRateChain.ARBITRUM, token="USDC")

                # 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.aaveRate({
                chain: "arbitrum",
                token: "USDC",
              });

              console.log(result);
            }

            run();
components:
  schemas:
    AaveRateResponse:
      properties:
        supply_apy_variable_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Supply Apy Variable Rate
          description: Variable rate APY for deposits.
        supply_apr_variable_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Supply Apr Variable Rate
          description: Variable rate APR for deposits.
        borrow_apy_variable_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrow Apy Variable Rate
          description: Variable rate APY for loans.
        borrow_apr_variable_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrow Apr Variable Rate
          description: Variable rate APR for loans.
        borrow_apy_fixed_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrow Apy Fixed Rate
          description: Fixed rate APY for loans.
        borrow_apr_fixed_rate:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Borrow Apr Fixed Rate
          description: Fixed rate APR for loans.
      type: object
      required:
        - supply_apy_variable_rate
        - supply_apr_variable_rate
        - borrow_apy_variable_rate
        - borrow_apr_variable_rate
        - borrow_apy_fixed_rate
        - borrow_apr_fixed_rate
      title: AaveRateResponse
    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).

````