> ## 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.

# Handler to get referrer statistics.
Non-affiliate referrers must meet the minimum trade volume threshold
to see their referral codes. Affiliate referrers always see all codes.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/stats/{account}
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: 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: Predeposit Rewards
    description: Season 0 predeposit USDC rewards
  - name: Referrals
    description: Referral code management and tracking
paths:
  /api/v1/referrals/stats/{account}:
    get:
      tags:
        - Referrals
      summary: |-
        Handler to get referrer statistics.
        Non-affiliate referrers must meet the minimum trade volume threshold
        to see their referral codes. Affiliate referrers always see all codes.
      operationId: handle_get_referrer_stats
      parameters:
        - name: account
          in: path
          description: The referrer's wallet address (not a subaccount address)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved referrer stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReferrerStatsDto'
        '404':
          description: Referrer not found
        '500':
          description: Internal server error
components:
  schemas:
    ReferrerStatsDto:
      type: object
      description: Referrer statistics — aggregate stats for a referrer account
      required:
        - referrer_account
        - total_referrals
        - total_codes_created
        - is_affiliate
        - codes
        - volume_threshold_met
      properties:
        codes:
          type: array
          items:
            type: string
          description: >-
            List of referral codes visible to this referrer.

            Non-affiliate referrers must meet the volume threshold to see their
            codes.
        is_affiliate:
          type: boolean
          description: |-
            Whether this referrer has any affiliate-designated codes.
            Affiliates always see all their codes regardless of trade volume.
        referrer_account:
          type: string
          description: The referrer's wallet address
        total_codes_created:
          type: integer
          format: int64
          description: >-
            Total number of referral codes created by this referrer.

            Always accurate regardless of code visibility (non-affiliates below
            the

            volume threshold will see an empty `codes` array but this still
            reflects

            the true count).
          minimum: 0
        total_referrals:
          type: integer
          format: int64
          description: Total number of users referred
          minimum: 0
        volume_threshold_met:
          type: boolean
          description: |-
            Whether the account meets the minimum trade volume threshold
            to see non-affiliate referral codes
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````