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

# Asset Lens

> This API retrieves information about all of the actions that occurred for a specific asset on the protocol within a certain timespan.



## OpenAPI

````yaml get /lending/{protocolId}/assets/{asset}
openapi: 3.1.0
info:
  title: Defi API
  version: '2'
servers:
  - url: https://api.amberdata.com/defi
security:
  - sec0: []
paths:
  /lending/{protocolId}/assets/{asset}:
    get:
      summary: Asset Lens
      description: >-
        This API retrieves information about all of the actions that occurred
        for a specific asset on the protocol within a certain timespan.
      operationId: defi-lending-asset-lens
      parameters:
        - name: protocolId
          in: path
          schema:
            type: string
            enum:
              - aavev2
              - aavev3
              - compoundv2
              - makerdao
            default: aavev2
          required: true
        - name: startDate
          in: query
          description: >-
            **[Optional]** Payload only includes data after this date
            (inclusive).<BR>**[Formats]** `seconds | milliseconds |
            iso8601`<BR>**[Examples]** `1578531600 | 1578531600000 |
            2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: >-
            **[Optional]** Payload only includes data before this date
            (exclusive).<BR>**[Formats]** `seconds | milliseconds |
            iso8601`<BR>**[Examples]** `1578531600 | 1578531600000 |
            2020-09-01T01:00:00`
          schema:
            type: string
            format: date-time
        - name: size
          in: query
          description: >-
            **[Optional]** Number of records per page. If not specified, the API
            will default to and try to return 1000 actions under
            **payload.data**.
          schema:
            type: integer
            format: int32
        - name: direction
          in: query
          description: >-
            **[Optional]** The order in which to return the results (ascending
            or descending). By default. records are returned in ascending order,
            so the oldest records are returned first.
          schema:
            type: string
            enum:
              - asc
              - desc
        - 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
        - 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.
          schema:
            type: string
            enum:
              - ethereum-mainnet
              - polygon-mainnet
              - avalanche-mainnet
              - arbitrum-mainnet
              - optimism-mainnet
        - name: asset
          in: path
          description: '**[Examples]** `WETH` The token symbol'
          schema:
            type: string
            default: WETH
          required: true
        - name: action
          in: query
          description: >-
            **[Optional]** Payload only includes data filtered by the
            action.<BR>**[Examples]**
            `UseReserveAsCollateral|Deposit|Withdraw|LiquidationCall|Repay|Borrow|FlashLoan`
          schema:
            type: string
            enum:
              - Deposit
              - Withdraw
              - LiquidationCall
              - Repay
              - Borrow
              - FlashLoan
      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: >-
                              https://api.amberdata.com/defi/lending/aavev2/assets/WETH?cursor=N4IgDgTg9gLlDGUA2BJAJiAXCAhjgbgKb4BMIANCALY4QDWhMWAdgK5JKUCWz8SraQgEEOAFQg5mAZxzwYXKMwCiRZjClYAZjiRTCleVUIAxKBBpNsAC1Y1mAJUI40OAEZJCFEGi4RCchWYsECEAZQBhLykYWhgAERwYT0wARgA2NJSABgAOFJSAFgBWLNLKQmY0BKSsdMyUkjSC0pbKKS4AL2SQAGYvQSIkKDBCCABZKEEtHT1KTTMLYIArKUUvMBwAc2SUyjMuTZ4dUJiIeMSdjOyAdgBONJaykH3D5h0lSurL%2Bsbmx8ocFI9DB0MEsgAPeBZEh4HA9W6uEgkHqaQg5NBZHBZQhFeAFTQka5ONC3XI9eDXIppeDwMgAXyAA
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            action:
                              type: string
                              example: Withdraw
                            timestamp:
                              type: string
                              example: 2022-08-21 11:09:05 000
                            blockNumber:
                              type: integer
                              example: 15383647
                              default: 0
                            transactionHash:
                              type: string
                              example: >-
                                0xc03a13328450f14094551250865c7e3b3f97ccae37a3cc1079efed098033c2b7
                            logIndex:
                              type: integer
                              example: 669
                              default: 0
                            assetId:
                              type: string
                              example: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
                            assetSymbol:
                              type: string
                              example: WETH
                            marketId:
                              type: string
                              example: '0xb53c1a33016b2dc2ff3653530bff1848a515c8c5'
                            market:
                              type: string
                              example: main
                            amount:
                              type: number
                              example: 0.4072108498457563
                              default: 0
                            user:
                              type: string
                              example: '0xe26684de8d5a40a35c3fc15c9328c7f3a523759b'
                            to:
                              type: string
                              example: '0xe26684de8d5a40a35c3fc15c9328c7f3a523759b'
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Result:
                  value: '{}'
              schema:
                type: object
                properties: {}
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      x-default: API_KEY
      name: x-api-key

````