> ## Documentation Index
> Fetch the complete documentation index at: https://docs.predexon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet Builder Fees

> Total builder fees a wallet has paid, with a per-builder breakdown

Total builder fees a single wallet has paid over a rolling window, plus a per-builder breakdown. Each fill is scored at the `(taker_bps, maker_bps)` rate that was actually in effect at the fill's `block_timestamp` (ASOF join against the builder fee-rate history), so historical rate changes are accounted for correctly.

<Note>
  **V2-only.** Builder attribution is a Polymarket V2 concept - V1 fills are excluded from all metrics.
</Note>

### Time range

By default the endpoint uses a rolling `window`: `24h`, `7d`, `30d`, or `all` (default). To score fees over an exact interval instead, pass `start_time` and/or `end_time` as Unix seconds — when either is set it **overrides** `window`.

| Parameter      | Description                                                                                              |
| -------------- | -------------------------------------------------------------------------------------------------------- |
| `window`       | Rolling window: `24h`, `7d`, `30d`, or `all` (default). Ignored if `start_time`/`end_time` are provided. |
| `start_time`   | Unix seconds, inclusive. Overrides `window`.                                                             |
| `end_time`     | Unix seconds, exclusive. Overrides `window`.                                                             |
| `builder_code` | Restrict the result to a single builder (bytes32 hex).                                                   |
| `limit`        | Caps the number of per-builder breakdown rows returned.                                                  |

The response echoes the effective `start_time`, `end_time`, and `builder_code` that were applied to the query.


## OpenAPI

````yaml GET /v2/polymarket/builders/wallet/{wallet}
openapi: 3.1.0
info:
  title: Predexon API
  description: Prediction market data aggregation and matching API
  version: 2.0.0
servers:
  - url: https://api.predexon.com
security:
  - apiKey: []
paths:
  /v2/polymarket/builders/wallet/{wallet}:
    get:
      tags:
        - polymarket
      summary: Get Wallet Builder Fees
      description: |-
        Total builder fees a wallet has paid, with per-builder breakdown.

        PK-probes `order_filled_by_maker` (sorted by `maker`). Each fill is
        scored at the (taker_bps, maker_bps) that was actually in effect at
        `block_timestamp` — ASOF join against `builder_fee_rates FINAL`, with
        a synthesized epoch-anchored row per builder so fills that predate the
        refresh worker's first observation also get scored.

        Time range: pass `window` (24h/7d/30d/all) for convenience, or
        `start_time` + `end_time` (Unix seconds) for arbitrary ranges. If
        either timestamp is set, `window` is ignored.

        Optional `builder_code` filters to a single builder.

        On V2, OrderFilled.taker is the exchange contract — user identity is
        always `maker`, and `is_taker=1` flags which leg is the taker side.
      operationId: get_wallet_builder_fees_v2_polymarket_builders_wallet__wallet__get
      parameters:
        - name: wallet
          in: path
          required: true
          schema:
            type: string
            description: Wallet address (0x + 40 hex)
            title: Wallet
          description: Wallet address (0x + 40 hex)
        - name: window
          in: query
          required: false
          schema:
            type: string
            description: >-
              Rolling window: 24h, 7d, 30d, or all. Ignored if
              start_time/end_time provided.
            default: all
            title: Window
          description: >-
            Rolling window: 24h, 7d, 30d, or all. Ignored if start_time/end_time
            provided.
        - name: start_time
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Unix seconds, inclusive. Overrides `window` if set.
            title: Start Time
          description: Unix seconds, inclusive. Overrides `window` if set.
        - name: end_time
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Unix seconds, exclusive. Overrides `window` if set.
            title: End Time
          description: Unix seconds, exclusive. Overrides `window` if set.
        - name: builder_code
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Restrict to a single builder (bytes32 hex).
            title: Builder Code
          description: Restrict to a single builder (bytes32 hex).
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Max per-builder breakdown rows
            default: 50
            title: Limit
          description: Max per-builder breakdown rows
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletBuilderFeesResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    WalletBuilderFeesResponse:
      properties:
        wallet_address:
          type: string
          title: Wallet Address
          description: Wallet address (lowercased)
        window:
          type: string
          title: Window
          description: >-
            Time window: 24h, 7d, 30d, all, or 'custom' when start_time/end_time
            supplied
        start_time:
          anyOf:
            - type: integer
            - type: 'null'
          title: Start Time
          description: Echo of start_time query param (Unix seconds), if provided
        end_time:
          anyOf:
            - type: integer
            - type: 'null'
          title: End Time
          description: Echo of end_time query param (Unix seconds), if provided
        builder_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Builder Code
          description: Echo of builder_code filter, if provided
        total_builder_fee_usd:
          type: number
          title: Total Builder Fee Usd
          description: Total builder fees this wallet paid across all (filtered) builders
        total_volume_usd:
          type: number
          title: Total Volume Usd
          description: Wallet's total attributed V2 trade notional
        total_trade_count:
          type: integer
          title: Total Trade Count
          description: Total attributed fill legs
        builder_count:
          type: integer
          title: Builder Count
          description: Distinct builders this wallet traded via (within filter)
        breakdown:
          items:
            $ref: '#/components/schemas/WalletBuilderFeeBreakdownEntry'
          type: array
          title: Breakdown
          description: Per-builder breakdown, ranked by builder_fee_usd desc
      type: object
      required:
        - wallet_address
        - window
        - total_builder_fee_usd
        - total_volume_usd
        - total_trade_count
        - builder_count
      title: WalletBuilderFeesResponse
      description: Builder fees a wallet has paid, with optional per-builder breakdown.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WalletBuilderFeeBreakdownEntry:
      properties:
        builder_code:
          type: string
          title: Builder Code
          description: Builder code, bytes32 hex
        builder_fee_usd:
          type: number
          title: Builder Fee Usd
          description: Builder fees this wallet paid to this builder
        volume_usd:
          type: number
          title: Volume Usd
          description: Wallet's attributed trade notional via this builder
        trade_count:
          type: integer
          title: Trade Count
          description: Number of attributed fill legs
        taker_fill_count:
          type: integer
          title: Taker Fill Count
          description: Fill legs where wallet was the taker
        maker_fill_count:
          type: integer
          title: Maker Fill Count
          description: Fill legs where wallet was the maker
        current_taker_bps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Current Taker Bps
          description: Current taker bps for this builder
        current_maker_bps:
          anyOf:
            - type: integer
            - type: 'null'
          title: Current Maker Bps
          description: Current maker bps for this builder
      type: object
      required:
        - builder_code
        - builder_fee_usd
        - volume_usd
        - trade_count
        - taker_fill_count
        - maker_fill_count
      title: WalletBuilderFeeBreakdownEntry
      description: Per-builder breakdown of fees a single wallet paid.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````