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

# Get the builder fees an owner collected

> All-time total plus a daily series over the window, for fills whose `builder_code` is one of
the owner's subaccounts. Perps only.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/builder-fees
openapi: 3.1.0
info:
  title: Decibel Trading API
  description: >-
    RESTful API for Decibel. Provides read-only endpoints for market data,
    trading operations, positions, and analytics.
  contact:
    name: Decibel Team
    url: https://decibel.trade/
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.mainnet.aptoslabs.com/decibel
    description: Mainnet
  - url: https://api.testnet.aptoslabs.com/decibel
    description: Testnet
security:
  - bearerAuth: []
tags:
  - name: Market Data
    description: Market information and real-time data endpoints
  - name: User
    description: User information and account management
  - name: Account
    description: Account-specific endpoints and data
  - name: Trades
    description: Trading operations and history
  - name: Positions
    description: User position management
  - name: Orders
    description: Order management and history
  - name: TWAP
    description: Time-weighted average price orders
  - name: Bulk Orders
    description: Bulk order management
  - name: Vaults
    description: Vault operations and management
  - name: Analytics
    description: Analytics and performance metrics
  - name: Points
    description: Points-related account metrics
  - name: Trading Points
    description: Trading points endpoints
  - name: Trading Hz
    description: Trading Hz endpoints
  - name: Tier
    description: Tier information endpoints
  - name: Streaks
    description: User streak tracking endpoints
  - name: Predeposit Rewards
    description: Season 0 predeposit USDC rewards
  - name: Referrals
    description: Referral code management and tracking
  - name: Affiliates
    description: Affiliate code and earnings endpoints
  - name: Campaigns
    description: On-chain reward campaign endpoints
paths:
  /api/v1/referrals/builder-fees:
    get:
      tags:
        - Referrals
      summary: Get the builder fees an owner collected
      description: >-
        All-time total plus a daily series over the window, for fills whose
        `builder_code` is one of

        the owner's subaccounts. Perps only.
      operationId: handle_builder_fees
      parameters:
        - name: referrer_account
          in: query
          description: >-
            The builder's wallet address (not a subaccount address). Named like
            the other referral

            reads so the web backend's passthrough injects it the same way.
          required: true
          schema:
            type: string
        - name: days
          in: query
          description: >-
            Trailing UTC days for the daily series. Defaults to 30, clamped to
            90.
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
      responses:
        '200':
          description: Builder fees collected by the owner
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BuilderFees'
        '400':
          description: Invalid address
        '500':
          description: Database error
components:
  schemas:
    BuilderFees:
      type: object
      description: >-
        Builder fees an owner collected on fills routed under their builder
        code.


        Informational: builder fees settle on-chain at fill time, so nothing
        here is claimable.
      required:
        - total_fees_usd
        - total_fills
        - window_fees_usd
        - window_fills
        - days
        - daily
      properties:
        daily:
          type: array
          items:
            $ref: '#/components/schemas/BuilderFeesDay'
          description: >-
            Oldest day first. Days without fills are omitted; clients fill the
            gaps.
        days:
          type: integer
          format: int64
          description: The window actually used, after clamping
          minimum: 0
        total_fees_usd:
          type: number
          format: double
          description: All-time builder fees, in USD
        total_fills:
          type: integer
          format: int64
          minimum: 0
        window_fees_usd:
          type: number
          format: double
          description: Sum of `daily`
        window_fills:
          type: integer
          format: int64
          minimum: 0
    BuilderFeesDay:
      type: object
      description: One UTC day of builder fees.
      required:
        - day_start_unix_ms
        - fees_usd
        - fills
      properties:
        day_start_unix_ms:
          type: integer
          format: int64
          description: UTC midnight of the day
        fees_usd:
          type: number
          format: double
          description: Builder fees collected on that day, in USD
        fills:
          type: integer
          format: int64
          description: Fill sides that carried one of the builder's codes
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````