> ## 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 per-code performance for a referrer

> Redemptions and traded volume per referral code. Not paginated: an affiliate is capped
at a handful of codes, so the whole set fits one response.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/code-performance
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/code-performance:
    get:
      tags:
        - Referrals
      summary: Get per-code performance for a referrer
      description: >-
        Redemptions and traded volume per referral code. Not paginated: an
        affiliate is capped

        at a handful of codes, so the whole set fits one response.
      operationId: handle_code_performance
      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
      responses:
        '200':
          description: Per-code redemption and volume stats
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CodePerformance'
        '400':
          description: Invalid address
        '500':
          description: Database error
components:
  schemas:
    CodePerformance:
      type: object
      description: What one referral code brought in.
      required:
        - referral_code
        - unique_users
        - users_who_traded
        - taker_volume_usd
        - maker_volume_usd
        - earnings_usd
      properties:
        earnings_usd:
          type: number
          format: double
          description: >-
            Everything this code brought in: the L1 commission of the people who
            used it, plus the

            L2 override their own referrals generated. Credited to the code the
            sub-affiliate

            arrived through, so the codes sum to the affiliate's whole
            commission with nothing

            stranded outside every row.
        maker_volume_usd:
          type: number
          format: double
        referral_code:
          type: string
        taker_volume_usd:
          type: number
          format: double
        unique_users:
          type: integer
          format: int64
          description: Distinct wallets that redeemed this code, all-time
          minimum: 0
        users_who_traded:
          type: integer
          format: int64
          description: How many of those traded inside the window
          minimum: 0
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````