> ## 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 a referrer's referred clients with lifecycle segments

> Segment counts across the whole referral set, plus a filtered page of clients ordered
by window volume. Carries no commission amounts: the accrual ledger is not built yet.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/clients
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/clients:
    get:
      tags:
        - Referrals
      summary: Get a referrer's referred clients with lifecycle segments
      description: >-
        Segment counts across the whole referral set, plus a filtered page of
        clients ordered

        by window volume. Carries no commission amounts: the accrual ledger is
        not built yet.
      operationId: handle_referral_clients
      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 the volume columns cover. Defaults to 30, clamped
            to 90.
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: limit
          in: query
          description: Clients per page. Defaults to 25, clamped to 200.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: offset
          in: query
          description: Clients to skip. Clamped to 10000.
          required: false
          schema:
            type: integer
            format: int32
            minimum: 0
        - name: segment
          in: query
          description: >-
            Keep only one lifecycle bucket: active, at_risk, dormant or
            never_traded.
          required: false
          schema:
            type: string
        - name: search
          in: query
          description: Case-insensitive substring match on the client address.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Segment counts and a page of clients
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferralClientsResponse'
        '400':
          description: Invalid address or unknown segment
        '500':
          description: Database error
components:
  schemas:
    ReferralClientsResponse:
      type: object
      required:
        - referrer_account
        - segments
        - clients
        - total_count
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/ReferralClient'
        referrer_account:
          type: string
        segments:
          $ref: '#/components/schemas/ClientSegments'
        total_count:
          type: integer
          format: int64
          description: Clients matching the current filter, for pagination
          minimum: 0
    ReferralClient:
      type: object
      description: One referred client.
      required:
        - client
        - source_code
        - joined_unix_ms
        - last_trade_unix_ms
        - trades
        - taker_volume_usd
        - maker_volume_usd
        - amps_all_time
        - commission_usd
        - segment
      properties:
        amps_all_time:
          type: number
          format: double
          description: >-
            All-time Amps from the canonical audit table, every bucket,
            post-clawback
        client:
          type: string
          description: Full owner address, matching `/affiliates/earnings`
        commission_usd:
          type: number
          format: double
          description: >-
            Commission this client generated for the affiliate inside the
            window, at each day's own

            stamped rate and penalty. Excludes anything this client's own
            referrals generated — that

            is the L2 override and belongs to the sub-affiliates screen.
        joined_unix_ms:
          type: integer
          format: int64
        last_trade_unix_ms:
          type: integer
          format: int64
          description: 0 when the client has never traded
        maker_volume_usd:
          type: number
          format: double
        segment:
          $ref: '#/components/schemas/ClientSegment'
        source_code:
          type: string
          description: Code this client redeemed
        taker_volume_usd:
          type: number
          format: double
        trades:
          type: integer
          format: int64
          description: Trades inside the requested window
          minimum: 0
    ClientSegments:
      type: object
      description: >-
        How many clients sit in each lifecycle bucket. Always the whole referral
        set, never

        the filtered page, so the four counts sum to the affiliate's referral
        total.
      required:
        - active
        - at_risk
        - dormant
        - never_traded
      properties:
        active:
          type: integer
          format: int64
          minimum: 0
        at_risk:
          type: integer
          format: int64
          minimum: 0
        dormant:
          type: integer
          format: int64
          minimum: 0
        never_traded:
          type: integer
          format: int64
          minimum: 0
    ClientSegment:
      type: string
      description: >-
        Where a client sits in the lifecycle, by how recently it last traded.


        `NeverTraded` is its own bucket rather than folded into `Dormant`: on
        real data it is

        the overwhelming majority (16k of 17k referrals for one mainnet
        affiliate), and

        merging it would hide the affiliate's actual problem, which is
        activation rather than

        retention. The four buckets partition the referral set, so they sum to
        the total.
      enum:
        - active
        - at_risk
        - dormant
        - never_traded
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````