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

# DeFi Metrics



## OpenAPI

````yaml openapi.json GET /gateway/v1/project/defi/metrics
openapi: 3.1.0
info:
  title: Hermod
  version: 0.0.1
servers:
  - url: https://api.asksurf.ai
security: []
paths:
  /gateway/v1/project/defi/metrics:
    get:
      tags:
        - Project
      summary: Project DeFi Metrics
      description: >-
        Returns time-series DeFi metrics for a project.


        **Available metrics:** `volume`, `fee`, `fees`, `revenue`, `tvl`,
        `users`.


        **Lookup:** by UUID (`id`) or name (`q`). Filter by `chain` and date
        range (`from`/`to`). Returns 404 if the project is not found.


        **Note:** this endpoint only returns data for DeFi protocol projects
        (e.g. `aave`, `uniswap`, `lido`, `makerdao`). Use `q` with a DeFi
        protocol name.
      operationId: project-defi-metrics
      parameters:
        - description: >-
            Surf project UUID. PREFERRED — always use this when available from a
            previous response (e.g. project_id from /fund/portfolio or id from
            /search/project). Takes priority over q.
          explode: false
          in: query
          name: id
          schema:
            description: >-
              Surf project UUID. PREFERRED — always use this when available from
              a previous response (e.g. project_id from /fund/portfolio or id
              from /search/project). Takes priority over q.
            examples:
              - 25c6612a-395c-4974-94eb-3b5f9f4b2ed7
            type: string
        - description: >-
            Fuzzy entity name search. Only use when 'id' is not available. May
            return unexpected results for ambiguous names.
          explode: false
          in: query
          name: q
          schema:
            description: >-
              Fuzzy entity name search. Only use when 'id' is not available. May
              return unexpected results for ambiguous names.
            examples:
              - uniswap
            type: string
        - description: >-
            Metric to query. Can be `volume`, `fees` (or `fee` alias),
            `revenue`, `tvl`, or `users`.
          explode: false
          in: query
          name: metric
          required: true
          schema:
            description: >-
              Metric to query. Can be `volume`, `fees` (or `fee` alias),
              `revenue`, `tvl`, or `users`.
            enum:
              - volume
              - fee
              - fees
              - revenue
              - tvl
              - users
            examples:
              - tvl
            type: string
        - description: >-
            Start of time range. Accepts Unix seconds (`1704067200`) or date
            string (`2024-01-01`)
          explode: false
          in: query
          name: from
          schema:
            description: >-
              Start of time range. Accepts Unix seconds (`1704067200`) or date
              string (`2024-01-01`)
            examples:
              - '2024-01-01'
            type: string
        - description: >-
            End of time range. Accepts Unix seconds (`1706745600`) or date
            string (`2024-02-01`)
          explode: false
          in: query
          name: to
          schema:
            description: >-
              End of time range. Accepts Unix seconds (`1706745600`) or date
              string (`2024-02-01`)
            examples:
              - '2024-02-01'
            type: string
        - description: >-
            Filter by chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`,
            `optimism`, `base`, `avalanche`, `fantom`, or `solana`.
          explode: false
          in: query
          name: chain
          schema:
            description: >-
              Filter by chain. Can be `ethereum`, `polygon`, `bsc`, `arbitrum`,
              `optimism`, `base`, `avalanche`, `fantom`, or `solana`.
            enum:
              - ethereum
              - polygon
              - bsc
              - arbitrum
              - optimism
              - base
              - avalanche
              - fantom
              - solana
            examples:
              - ethereum
            type: string
        - description: Results per page
          explode: false
          in: query
          name: limit
          schema:
            default: 20
            description: Results per page
            examples:
              - 20
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Pagination offset
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Pagination offset
            examples:
              - 0
            format: int64
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResponseProjectMetricPoint'
          description: OK
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataAPIError'
          description: Error
      security:
        - AccessToken: []
components:
  schemas:
    DataResponseProjectMetricPoint:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/DataResponseProjectMetricPoint.json
          format: uri
          readOnly: true
          type: string
        data:
          items:
            $ref: '#/components/schemas/ProjectMetricPoint'
          type:
            - array
            - 'null'
        meta:
          $ref: '#/components/schemas/OffsetMeta'
      required:
        - data
        - meta
      type: object
    DataAPIError:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/DataAPIError.json
          format: uri
          readOnly: true
          type: string
        error:
          $ref: '#/components/schemas/DataAPIErrorDetail'
      required:
        - error
      type: object
    ProjectMetricPoint:
      additionalProperties: false
      properties:
        timestamp:
          description: Unix timestamp in seconds for this data point
          format: int64
          type: integer
        value:
          description: Metric value at this timestamp
          format: double
          type: number
      required:
        - timestamp
        - value
      type: object
    OffsetMeta:
      additionalProperties: false
      properties:
        cached:
          description: Whether this response was served from cache
          type: boolean
        credits_used:
          description: Credits deducted for this request
          format: int64
          type: integer
        limit:
          description: Maximum number of items returned in this response
          format: int64
          type: integer
        offset:
          description: Number of items skipped (pagination offset)
          format: int64
          type: integer
        total:
          description: >-
            Total number of matching items (before pagination). Omitted when
            total is unknown.
          format: int64
          type: integer
      required:
        - limit
        - offset
        - credits_used
        - cached
      type: object
    DataAPIErrorDetail:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object

````