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

# Get Builder Code Statistics

> Returns trading volume and builder fees attributed to the builder code owned by the authenticated account. Time bounds are inclusive. Omit endTime for live statistics; live results use a five-minute start-time bucket and are cached for one hour. Historical requests include endTime and are cached for 24 hours. An explicit endTime must be at least one minute in the past.



## OpenAPI

````yaml /api-reference/rest-spec.json get /v1/builder_code/stats
openapi: 3.0.3
info:
  title: Ondo Perps REST API
  version: '1.0'
  description: >-
    REST API for Ondo Perps: account, wallet, deposits/withdrawals, API keys,
    and perpetual futures trading.
servers:
  - url: https://api.ondoperps.xyz
security:
  - BearerAuth: []
paths:
  /v1/builder_code/stats:
    get:
      tags:
        - Builder Code
      summary: Get Builder Code Statistics
      description: >-
        Returns trading volume and builder fees attributed to the builder code
        owned by the authenticated account. Time bounds are inclusive. Omit
        endTime for live statistics; live results use a five-minute start-time
        bucket and are cached for one hour. Historical requests include endTime
        and are cached for 24 hours. An explicit endTime must be at least one
        minute in the past.
      operationId: getBuilderCodeStats
      parameters:
        - name: startTime
          in: query
          description: >-
            Required inclusive start time in Unix milliseconds. For live
            requests, the server rounds this value down to a five-minute
            boundary and returns the effective value in the response.
          required: true
          schema:
            type: integer
            format: int64
            minimum: -62135596800000
            maximum: 253402300799999
            example: 1789725600000
        - name: endTime
          in: query
          description: >-
            Optional inclusive end time in Unix milliseconds. Omit this
            parameter for live statistics. When provided, it must be at least
            one minute in the past and must not be before startTime.
          required: false
          schema:
            type: integer
            format: int64
            minimum: -62135596800000
            maximum: 253402300799999
            example: 1789729200000
      responses:
        '200':
          description: >-
            Builder-code volume and fee statistics for the effective inclusive
            time window
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/GenericResponse'
                  - type: object
                    properties:
                      result:
                        $ref: '#/components/schemas/BuilderCodeStatsResult'
              example:
                success: true
                result:
                  startTime: 1789725600000
                  endTime: 1789729200000
                  totalVolume: '12500.123456789'
                  totalBuilderFee: '12.500123456789'
                  accounts:
                    - accountId: '2564891920043613872'
                      walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18'
                      totalVolume: '10000.123456789'
                      builderFee: '10.000123456789'
                    - accountId: '2564891920043613873'
                      walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18'
                      totalVolume: '2500'
                      builderFee: '2.5'
        '400':
          description: >-
            Bad request. The query parameters were malformed or failed
            validation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    description: Human-readable error message
                  error_code:
                    type: string
                    enum:
                      - bad_query_param
              example:
                success: false
                error: >-
                  endTime must be at least 1 minute in the past; omit endTime
                  for live statistics
                error_code: bad_query_param
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: The authenticated account does not own a builder code.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    description: Human-readable error message
                  error_code:
                    type: string
                    enum:
                      - builder_code_not_found
              example:
                success: false
                error: No builder code found for this account.
                error_code: builder_code_not_found
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
        - ApiKeyAuth: []
components:
  schemas:
    GenericResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: Whether the request was successful
          example: true
        error:
          type: string
          description: Error message, present only on failure
          example: ''
        error_code:
          type: string
          description: >-
            Semantic error code. See each endpoint's error responses for the
            specific codes it can return.
        deprecated:
          type: string
          description: Deprecation notice, if applicable
          example: ''
    BuilderCodeStatsResult:
      type: object
      required:
        - startTime
        - endTime
        - totalVolume
        - totalBuilderFee
        - accounts
      properties:
        startTime:
          type: integer
          format: int64
          description: >-
            Effective inclusive start time in Unix milliseconds. Live requests
            return the requested start rounded down to a five-minute boundary.
          example: 1789725600000
        endTime:
          type: integer
          format: int64
          description: >-
            Effective inclusive end time in Unix milliseconds. For live
            requests, this is the cached query snapshot time and can be earlier
            than the current request time.
          example: 1789729200000
        totalVolume:
          type: string
          description: >-
            Exact, non-scientific decimal string containing the sum of
            totalVolume across all returned accounts.
          example: '12500.123456789'
        totalBuilderFee:
          type: string
          description: >-
            Exact, non-scientific decimal string containing the sum of
            builderFee across all returned accounts.
          example: '12.500123456789'
        accounts:
          type: array
          description: >-
            Statistics grouped by raw fill account ID. Subaccounts are separate
            entries, ordering is not guaranteed, and the array is not paginated.
            An empty window returns an empty array.
          items:
            $ref: '#/components/schemas/BuilderCodeStatsAccount'
    BuilderCodeStatsAccount:
      type: object
      required:
        - accountId
        - walletAddress
        - totalVolume
        - builderFee
      properties:
        accountId:
          type: string
          description: >-
            Raw account ID associated with the qualifying fills. Main accounts
            and subaccounts are returned as separate entries.
          example: '2564891920043613872'
        walletAddress:
          type: string
          description: >-
            Primary wallet address of the account's main account. A main account
            and its subaccounts therefore share this value.
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18'
        totalVolume:
          type: string
          description: >-
            Exact, non-scientific decimal string containing the account's
            qualifying USD fill volume.
          example: '10000.123456789'
        builderFee:
          type: string
          description: >-
            Exact, non-scientific decimal string containing the builder fees
            attributed to this account's fills.
          example: '10.000123456789'
  responses:
    Unauthorized:
      description: Authentication required. Provide a valid JWT or API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                description: Human-readable error message
              error_code:
                type: string
                enum:
                  - api_key_not_found
                  - auth_expired
                  - auth_invalid
                  - auth_missing
                  - failed_to_decode_hex_signature
                  - failed_to_parse_timestamp
                  - signature_mismatch
                  - timestamp_too_far
          example:
            success: false
            error: Description of the error
            error_code: auth_missing
    Forbidden:
      description: Access denied. The authenticated account does not have permission.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                description: Human-readable error message
              error_code:
                type: string
                enum:
                  - account_closed
                  - account_not_allowed
                  - forbidden
                  - ip_not_permitted
                  - key_doesnt_have_scope
          example:
            success: false
            error: Description of the error
            error_code: account_not_allowed
    TooManyRequests:
      description: Rate limit exceeded. Slow down request frequency.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                description: Human-readable error message
              error_code:
                type: string
                enum:
                  - too_many_requests
          example:
            success: false
            error: Description of the error
            error_code: too_many_requests
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              error:
                type: string
                description: Human-readable error message
              error_code:
                type: string
                enum:
                  - server_is_busy
                  - service_unavailable
                  - unknown
          example:
            success: false
            error: Description of the error
            error_code: unknown
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY-ID

````