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

# Track Positions - Lending Wallets

> This API retrieves the balances of a given address within supported lending protocols.



## OpenAPI

````yaml get /lending/{protocolId}/wallets/{address}/portfolio
openapi: 3.1.0
info:
  title: Defi API
  version: '2'
servers:
  - url: https://api.amberdata.com/defi
security:
  - sec0: []
paths:
  /lending/{protocolId}/wallets/{address}/portfolio:
    get:
      summary: Track Positions - Lending Wallets
      description: >-
        This API retrieves the balances of a given address within supported
        lending protocols.
      operationId: track-positions-lending-wallet
      parameters:
        - name: protocolId
          in: path
          schema:
            type: string
            enum:
              - aavev2
              - aavev3
              - compoundv2
              - compoundv3
              - makerdao
            default: aavev3
          required: true
        - name: x-amberdata-blockchain-id
          in: header
          description: >-
            **[Optional]** The id of the blockchain for which you want protocol
            data from. Defaults to `ethereum-mainnet` if not specified. Use the
            [Information
            Protocols](https://docs.amberdata.io/reference/defi-lending-information-protocols)
            API to view the supported protocol and blockchain id combinations.
          required: true
          schema:
            type: string
            enum:
              - ethereum-mainnet
              - polygon-mainnet
              - avalanche-mainnet
              - arbitrum-mainnet
              - optimism-mainnet
            default: polygon-mainnet
        - name: address
          in: path
          description: >-
            The address for which the portfolio summary is desired. Example
            address is for `aavev3` plus `polygon-mainnet` **only**.
          schema:
            type: string
            default: '0x884d6fa3a4b349880486ad4d7c833ca968c785d8'
          required: true
        - name: timeFormat
          in: query
          description: '**[Optional]** Time format of the timestamps in the return payload.'
          schema:
            type: string
            enum:
              - milliseconds
              - ms
              - iso
              - iso8601
              - hr
              - human_readable
            default: hr
        - name: endDate
          in: query
          description: >-
            **[Optional]** If provided, returns the balances of the address at
            this date. Enables historical look-back of the
            portfolio.<BR>**[Formats]** `seconds | milliseconds |
            iso8601`<BR>**[Examples]** `1578531600 | 1578531600000 |
            2020-09-01T01:00:00`<BR>**[Warning]** Cannot be combined with
            `blockNumber`, use only one, either `endDate` or `blockNumber`.
          schema:
            type: string
        - name: blockNumber
          in: query
          description: >-
            **[Optional]** If provided, returns the balances of the address when
            this block was finalized. Enables historical look-back of the
            portfolio.<BR>**[Warning]** Cannot be combined with `endDate`, use
            only one, either `blockNumber` or `endDate`.
          schema:
            type: integer
            format: int32
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                    default: 0
                  title:
                    type: string
                    example: OK
                  description:
                    type: string
                    example: Successful request
                  payload:
                    type: object
                    properties:
                      metadata:
                        type: object
                        properties:
                          next:
                            type: string
                            example: null
                      data:
                        type: object
                        properties:
                          timestamp:
                            type: string
                            example: 2022-11-07 20:02:00 000
                          totalLiquidityETH:
                            type: number
                            example: 1.960386955045967
                            default: 0
                          totalLiquidityUSD:
                            type: number
                            example: 3141.9905883303727
                            default: 0
                          totalCollateralETH:
                            type: number
                            example: 1.960386955045967
                            default: 0
                          totalCollateralUSD:
                            type: number
                            example: 3141.9905883303727
                            default: 0
                          totalBorrowedETH:
                            type: number
                            example: 0.8354476352995496
                            default: 0
                          totalBorrowedUSD:
                            type: number
                            example: 1339.005343
                            default: 0
                          availableToBorrowETH:
                            type: number
                            example: 0.5745894213541245
                            default: 0
                          availableToBorrowUSD:
                            type: number
                            example: 920.9174491811094
                            default: 0
                          netWorthETH:
                            type: number
                            example: 1.1249393197464175
                            default: 0
                          netWorthUSD:
                            type: number
                            example: 1802.985245330373
                            default: 0
                          lifetimeRewardsETH:
                            type: integer
                            example: 0
                            default: 0
                          lifetimeRewardsUSD:
                            type: integer
                            example: 0
                            default: 0
                          unclaimedRewardsETH:
                            type: integer
                            example: 0
                            default: 0
                          unclaimedRewardsUSD:
                            type: integer
                            example: 0
                            default: 0
                          healthFactor:
                            type: number
                            example: 1.805087884251727
                            default: 0
                          loanToValueRatio:
                            type: number
                            example: 0.719264659981688
                            default: 0
                          liquidationThresholdRatio:
                            type: number
                            example: 0.769264659981688
                            default: 0
                          positions:
                            type: array
                            items:
                              type: object
                              properties:
                                assetId:
                                  type: string
                                  example: '0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6'
                                assetSymbol:
                                  type: string
                                  example: WBTC
                                positionType:
                                  type: string
                                  example: Lend
                                isCollateral:
                                  type: boolean
                                  example: true
                                  default: true
                                loanToValueRatio:
                                  type: number
                                  example: 0.7
                                  default: 0
                                liquidationThresholdRatio:
                                  type: number
                                  example: 0.75
                                  default: 0
                                amountNative:
                                  type: number
                                  example: 0.09259605
                                  default: 0
                                amountUSD:
                                  type: number
                                  example: 1931.4029813334043
                                  default: 0
                                interestRateAPY:
                                  type: number
                                  example: 0.00035615996484214454
                                  default: 0
                                interestRateType:
                                  type: string
                                  example: Stable
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      x-default: API_KEY
      name: x-api-key

````