> ## 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 trading activity of a referrer's referred clients

> Per-level window totals plus a page of direct (L1) referrals, each carrying the L2
clients it referred. Carries no commission figures: the accrual ledger those would
come from does not exist yet.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/activity
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/activity:
    get:
      tags:
        - Referrals
      summary: Get trading activity of a referrer's referred clients
      description: >-
        Per-level window totals plus a page of direct (L1) referrals, each
        carrying the L2

        clients it referred. Carries no commission figures: the accrual ledger
        those would

        come from does not exist yet.
      operationId: handle_referral_activity
      parameters:
        - name: referrer_account
          in: query
          description: The referrer's wallet address (not a subaccount address)
          required: true
          schema:
            type: string
        - name: days
          in: query
          description: Trailing UTC days to cover. Defaults to 14, clamped to 90.
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: limit
          in: query
          description: Direct (L1) clients per page. Defaults to 25, clamped to 200.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: offset
          in: query
          description: Direct (L1) clients to skip. Clamped to 10000.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
      responses:
        '200':
          description: Referral activity summary and client page
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralActivityResponse'
        '400':
          description: Invalid address
        '500':
          description: Database error
components:
  schemas:
    ReferralActivityResponse:
      type: object
      description: 'Referral activity: per-level totals plus a page of direct referrals.'
      required:
        - referrer_account
        - summary
        - clients
        - total_count
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ReferralActivityClient'
          description: A page of L1 clients, each carrying its own L2s
        referrer_account:
          type: string
        summary:
          type: array
          items:
            $ref: '#/components/schemas/ReferralActivityLevel'
          description: Levels that traded in the window, level 1 first
        total_count:
          type: integer
          format: int64
          description: >-
            L1 rows the window holds, for pagination. Counts parents, not
            clients: an L1 that

            only appears because its L2s traded still occupies a row.
          minimum: 0
    ReferralActivityClient:
      type: object
      description: >-
        One direct (L1) referral's activity in the window, plus the L2 clients
        it referred.


        Levels are nested rather than interleaved: an L2 client only ever
        reaches an affiliate

        through one of its L1s, so a flat list forces the reader to guess whose
        downline a row

        belongs to.
      required:
        - client
        - level
        - trades
        - taker_volume_usd
        - maker_volume_usd
        - top_market
        - commission_usd
        - traded
        - sub_clients
        - sub_client_count
      properties:
        client:
          type: string
          description: >-
            Full owner address, matching `/affiliates/earnings` — an affiliate
            already sees

            its own referees unmasked there, so masking only here would be
            inconsistent.
        commission_usd:
          type: number
          format: double
          description: >-
            Commission this client generated on its own trading, at the L1 rate
            of each day.

            Excludes what its L2s generated — those carry their own figures.
        level:
          type: integer
          format: int32
          description: >-
            Always 1: this list holds direct referrals, and their L2s hang off
            `sub_clients`.
          minimum: 0
        maker_volume_usd:
          type: number
          format: double
        sub_client_count:
          type: integer
          format: int64
          description: L2 clients that traded in the window, counted before the 25-row cap.
          minimum: 0
        sub_clients:
          type: array
          items:
            $ref: '#/components/schemas/ReferralActivitySubClient'
          description: >-
            This L1's own referred clients that traded in the window, busiest
            first, capped at

            `sub_client_count`'s first 25 rows.
        taker_volume_usd:
          type: number
          format: double
        top_market:
          type: string
          description: >-
            Market carrying the most of this client's volume; empty when
            unresolved.
        traded:
          type: boolean
          description: >-
            False when this L1 did not trade in the window and is listed only as
            the parent of

            L2s that did. Its own columns are then zero, which is a different
            claim from

            "traded zero volume" and should not be rendered as a figure.
        trades:
          type: integer
          format: int64
          minimum: 0
    ReferralActivityLevel:
      type: object
      description: Window totals for one referral level.
      required:
        - level
        - clients
        - trades
        - taker_volume_usd
        - maker_volume_usd
        - commission_usd
      properties:
        clients:
          type: integer
          format: int64
          description: Clients who traded in the window
          minimum: 0
        commission_usd:
          type: number
          format: double
          description: >-
            Commission this level generated in the window, at each day's own
            stamped rate and

            penalty. Zero when the affiliate has no accrual rows — which is the
            state before the

            ledger runs, not a claim that the level earned nothing.
        level:
          type: integer
          format: int32
          description: 1 = direct referral, 2 = sub-affiliate's referral
          minimum: 0
        maker_volume_usd:
          type: number
          format: double
        taker_volume_usd:
          type: number
          format: double
        trades:
          type: integer
          format: int64
          minimum: 0
    ReferralActivitySubClient:
      type: object
      description: One L2 client's activity, nested under the L1 that referred it.
      required:
        - client
        - trades
        - taker_volume_usd
        - maker_volume_usd
        - top_market
        - commission_usd
      properties:
        client:
          type: string
          description: Full owner address, matching the L1 rows.
        commission_usd:
          type: number
          format: double
          description: >-
            Commission this client generated, at the L2 override rate of each
            day.
        maker_volume_usd:
          type: number
          format: double
        taker_volume_usd:
          type: number
          format: double
        top_market:
          type: string
          description: >-
            Market carrying the most of this client's volume; empty when
            unresolved.
        trades:
          type: integer
          format: int64
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````