> ## 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 an affiliate's accrued commission

> What the affiliate has earned: today, since Monday, and over all time, plus a daily
breakdown carrying the tier and any anti-farming penalty that was in force each day.

This is not what is claimable. Claimable commission is an on-chain campaign allocation
and comes from the campaigns endpoints; this is the off-chain ledger of what is owed.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/referrals/commissions
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/commissions:
    get:
      tags:
        - Referrals
      summary: Get an affiliate's accrued commission
      description: >-
        What the affiliate has earned: today, since Monday, and over all time,
        plus a daily

        breakdown carrying the tier and any anti-farming penalty that was in
        force each day.


        This is not what is claimable. Claimable commission is an on-chain
        campaign allocation

        and comes from the campaigns endpoints; this is the off-chain ledger of
        what is owed.
      operationId: handle_referral_commissions
      parameters:
        - name: affiliate_account
          in: query
          description: The affiliate's wallet address (not a subaccount address)
          required: true
          schema:
            type: string
        - name: days
          in: query
          description: >-
            Trailing UTC days of daily breakdown to return. Defaults to 30,
            clamped to 180.
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
      responses:
        '200':
          description: The affiliate's accrued commission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateCommissions'
        '400':
          description: Invalid address
        '500':
          description: Database error
components:
  schemas:
    AffiliateCommissions:
      type: object
      description: >-
        An affiliate's accrued commission: today, the running week, and
        lifetime.


        Distinct from what is *claimable*, which lives on chain in
        `campaign_claims`. This

        endpoint answers "what have I earned"; the chain answers "what can I
        take". Keeping them

        apart is what makes "accrued but not yet swept" and "accrued but
        forfeited" answerable

        without trusting either side alone.
      required:
        - accrued_today_usd
        - accrued_this_week_usd
        - lifetime_accrued_usd
        - week_start_date
        - previous_week_usd
        - previous_week_status
        - previous_week_campaign_id
        - minimum_payout_usd
        - meets_minimum
        - progress_to_minimum
        - mode
        - pending_mode
        - pending_effective_from
        - days
        - weeks
        - current_tier
        - current_nuv_usd
        - nuv_window_days
        - tiers
      properties:
        accrued_this_week_usd:
          type: number
          format: double
          description: >-
            Accrued since Monday. This is what the weekly sweep will pay, or
            forfeit.
        accrued_today_usd:
          type: number
          format: double
          description: Accrued so far today. Provisional until the week is swept.
        current_nuv_usd:
          type: number
          format: double
          description: The trailing-window NUV that rung was derived from.
        current_tier:
          type: string
          description: >-
            The rung in force, from the most recent accrual. `bronze` when there
            is no history:

            an affiliate whose network brings nobody new still earns, at the
            lowest rate.
        days:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateCommissionDay'
          description: >-
            Daily breakdown, oldest first. Days with no activity are absent, not
            zero-filled.
        lifetime_accrued_usd:
          type: number
          format: double
          description: Accrued over all time, including weeks already paid.
        meets_minimum:
          type: boolean
          description: Whether the running week currently clears the floor
        minimum_payout_usd:
          type: number
          format: double
          description: The floor a week must clear to be paid at all
        mode:
          type: string
          description: >-
            `points` | `usd`, as stamped on the most recent accrual. Absent
            history reads

            `points`, which is the status quo for every affiliate today.
        nuv_window_days:
          type: integer
          format: int32
          description: >-
            Days in the NUV window. Sent so the caller can label it without
            hardcoding 30.
          minimum: 0
        pending_effective_from:
          type: string
          description: >-
            The Monday `pending_mode` starts, `YYYY-MM-DD`, or empty when
            nothing is pending.
        pending_mode:
          type: string
          description: >-
            A recorded election that has not taken effect yet, or empty.


            Published because `mode` alone cannot express it. An election lands
            on a future Monday, so

            between signing it and that day the affiliate is still earning the
            old currency and the

            ledger still stamps it — a screen reading only `mode` shows no trace
            of a decision that has

            already been made, irreversibly. The affiliate concludes it failed
            and tries again.
        previous_week_campaign_id:
          type: integer
          format: int64
          description: >-
            On-chain campaign carrying the previous week, or 0 when it is not on
            chain yet. A

            non-zero id means the money is claimable through the campaigns
            endpoints, not here.
          minimum: 0
        previous_week_status:
          type: string
          description: >-
            What the sweep decided about that week: `paid`, `forfeited`,
            `withheld`, or empty

            when it has not been swept yet. Empty is the common case early in a
            week.
        previous_week_usd:
          type: number
          format: double
          description: >-
            Accrued over the week before this one. Non-zero for the two or three
            days between a

            week closing and its sweep paying out — the window in which the
            running week reads

            near zero while real money is still owed.
        progress_to_minimum:
          type: number
          format: double
          description: 0.0–1.0 progress toward the floor, for a progress indicator
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/CommissionTier'
          description: >-
            The whole ladder, highest rung first. Static config, published so no
            client keeps a

            second copy of the rate table.
        week_start_date:
          type: string
          description: Monday of the running week, `YYYY-MM-DD`
        weeks:
          type: array
          items:
            $ref: '#/components/schemas/AffiliateCommissionWeek'
          description: >-
            Weekly history, newest first: what each week accrued and what the
            sweep decided.


            Separate from `days` because the two answer different questions —
            `days` is how the

            figure was built, `weeks` is what happened to it.
    AffiliateCommissionDay:
      type: object
      description: >-
        One UTC day of accrual, with the rules that produced it.


        The tier and penalty are the values that were in force on that day, read
        off the row

        rather than recomputed — which is the whole reason the ledger stamps
        them.
      required:
        - date
        - accrued_usd
        - basis_l1_usd
        - basis_l2_usd
        - tier
        - rate_l1
        - rate_l2
        - penalty_multiplier
      properties:
        accrued_usd:
          type: number
          format: double
          description: Commission accrued that day, after any anti-farming penalty
        basis_l1_usd:
          type: number
          format: double
          description: Fee basis from direct referrals
        basis_l2_usd:
          type: number
          format: double
          description: Fee basis from second-level referrals
        date:
          type: string
          description: UTC date, `YYYY-MM-DD`
        penalty_multiplier:
          type: number
          format: double
          description: >-
            1.0 when unpenalised. Below that, an anti-farming override was in
            force.


            The multiplier is here and the *reason* is deliberately not. The
            reason string is the

            detection's own working notes — `SYBIL_REFERRAL_FARM_ORCHESTRATOR:
            5-member R2 cluster of

            89 activated, flag_ratio 0.20` — and serving it told anyone who
            asked both that a wallet

            was flagged and exactly what tripped it, which is how an anti-abuse
            system stops working.

            It also labelled an address as a fraud in a public response. An
            affiliate needs to know

            their commission was reduced, which the multiplier says; why it was
            reduced is a

            conversation with support, not a field.
        rate_l1:
          type: number
          format: double
          description: >-
            The L1 share that applied that day, as a fraction — 0.25 for bronze.


            Sent rather than left for the client to derive from `tier`, which
            would put a second

            copy of the rate table in the frontend. The server stamped these; it
            should report

            them. A caller splitting commission by level needs the day's own
            rate because the

            tier moves inside a 30-day window.
        rate_l2:
          type: number
          format: double
          description: >-
            The L2 override share that applied that day, as a fraction — 0.10
            for bronze.
        tier:
          type: string
          description: '`bronze` | `silver` | `gold`, as stamped that day'
    CommissionTier:
      type: object
      description: >-
        One rung of the commission ladder, as the affiliate sees it.


        Published by the server rather than restated in the client, for the same
        reason the daily

        rates are: a second copy of the rate table would let a screen quote a
        rate the ledger never

        paid, and an affiliate who read the wrong number read it wrong for good.
      required:
        - tier
        - nuv_threshold_usd
        - rate_l1
        - rate_l2
      properties:
        nuv_threshold_usd:
          type: number
          format: double
          description: >-
            Trailing-window NUV, in USD, at or above which this rung applies.
            Inclusive.
        rate_l1:
          type: number
          format: double
          description: >-
            Share of the direct-referral fee basis, as a fraction — 0.25 for
            bronze.
        rate_l2:
          type: number
          format: double
          description: >-
            Share of the second-level fee basis, as a fraction — 0.10 for
            bronze.
        tier:
          type: string
          description: '`bronze` | `silver` | `gold`'
    AffiliateCommissionWeek:
      type: object
      description: >-
        One week of accrual and what the sweep decided about it.


        The row exists as soon as the week has accruals, whether or not it has
        been swept. That

        is the point: an unswept week is money still coming, and a screen that
        only listed swept

        weeks would make the current one vanish.
      required:
        - week_start_date
        - accrued_usd
        - status
        - reason
        - allocated_usd
        - campaign_id
        - minimum_usd
      properties:
        accrued_usd:
          type: number
          format: double
          description: What the seven days accrued, from the ledger.
        allocated_usd:
          type: number
          format: double
          description: >-
            What the sweep actually allocated. Zero on a forfeited or unswept
            week, which is why

            it is reported alongside `accrued_usd` rather than instead of it.
        campaign_id:
          type: integer
          format: int64
          description: >-
            On-chain campaign, or 0 when the allocation has not been pushed to
            one yet.
          minimum: 0
        minimum_usd:
          type: number
          format: double
          description: >-
            The floor in force that week. Stored per sweep because it is program
            config that can

            change, and a past week must be explainable under the rule it was
            judged by.
        reason:
          type: string
          description: >-
            `below_minimum` | `flagged`, or empty. The answer to "why was I not
            paid?".
        status:
          type: string
          description: >-
            `paid` | `forfeited` | `withheld`, or empty when the sweep has not
            run.
        week_start_date:
          type: string
          description: Monday of the week, `YYYY-MM-DD`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from Geomi. See
        [Authentication](/api-reference/rest/authentication) for setup
        instructions.

````