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

# Filter Wallets by Markets

> Filter wallets by market trades with AND/OR logic

Find wallets that traded specific markets with configurable logic. Use AND to find wallets that traded *all* specified markets, or OR to find wallets that traded *any* of them. Filter by combined performance metrics across those markets.

<Note>**Requires Dev or Pro tier.** This endpoint is not available on the Free tier.</Note>

<Warning>
  **Rolling total PnL accuracy timeline** - Total PnL (realized + unrealized - net fees) uses rolling windows that need time to accumulate full data:

  * **All-time total PnL**: accurate immediately (February 10, 2026)
  * **1-day rolling total PnL**: fully accurate starting February 11, 2026
  * **7-day rolling total PnL**: fully accurate starting February 17, 2026
  * **30-day rolling total PnL**: fully accurate starting March 12, 2026
</Warning>

| Constraint | Value               |
| ---------- | ------------------- |
| `limit`    | 1–100 (default 100) |


## OpenAPI

````yaml GET /v2/polymarket/wallets/filter
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/wallets/filter:
    get:
      tags:
        - polymarket
        - smart-wallet
      summary: Filter Wallets By Markets
      description: >-
        Filter wallets by market trades with AND/OR logic, with metric filters
        on combined performance.


        **Use Cases:**

        - Find all wallets that traded Market A AND Market B AND Market C
        (intersection)

        - Find all wallets that traded Market A OR Market B OR Market C (union)

        - Filter by combined performance: wallets with combined win_rate > 50%
        across these markets


        **Query Logic:**

        - AND: Returns wallets that have traded ALL specified markets

        - OR: Returns wallets that have traded ANY of the specified markets


        **Metrics:**

        All metrics (realized_pnl, volume, win_rate, roi, profit_factor) are
        aggregated across the

        specified markets only. Derived metrics (win_rate, ROI, profit_factor)
        are properly

        calculated from underlying sums, not averaged.


        Uses ClickHouse for fast aggregation across markets.
      operationId: filter_wallets_by_markets_v2_polymarket_wallets_filter_get
      parameters:
        - name: markets
          in: query
          required: true
          schema:
            type: string
            description: Comma-separated market condition IDs (1-10 markets)
            examples:
              - 0x123,0x456,0x789
            title: Markets
          description: Comma-separated market condition IDs (1-10 markets)
        - name: market_logic
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/MarketFilterLogic'
            description: AND = traded ALL markets, OR = traded ANY market
            default: and
          description: AND = traded ALL markets, OR = traded ANY market
        - name: window
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/TimeWindow'
            description: Time window for metrics
            default: all_time
          description: Time window for metrics
        - name: sort_by
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/LeaderboardSortBy'
            description: Sort field (based on combined metrics)
            default: total_pnl
          description: Sort field (based on combined metrics)
        - name: order
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/OrderDirection'
            description: Sort order
            default: desc
          description: Sort order
        - name: min_realized_pnl
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: Minimum combined realized PnL across specified markets (USD)
            title: Min Realized Pnl
          description: Minimum combined realized PnL across specified markets (USD)
        - name: max_realized_pnl
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: Maximum combined realized PnL across specified markets (USD)
            title: Max Realized Pnl
          description: Maximum combined realized PnL across specified markets (USD)
        - name: min_total_pnl
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              Minimum combined total PnL across specified markets (USD, net of
              fees)
            title: Min Total Pnl
          description: >-
            Minimum combined total PnL across specified markets (USD, net of
            fees)
        - name: max_total_pnl
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: >-
              Maximum combined total PnL across specified markets (USD, net of
              fees)
            title: Max Total Pnl
          description: >-
            Maximum combined total PnL across specified markets (USD, net of
            fees)
        - name: min_volume
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                minimum: 0
              - type: 'null'
            description: Minimum combined volume across specified markets (USD)
            title: Min Volume
          description: Minimum combined volume across specified markets (USD)
        - name: min_trades
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: Minimum combined trade count across specified markets
            title: Min Trades
          description: Minimum combined trade count across specified markets
        - name: min_roi
          in: query
          required: false
          schema:
            anyOf:
              - type: number
              - type: 'null'
            description: Minimum combined ROI across specified markets (decimal)
            title: Min Roi
          description: Minimum combined ROI across specified markets (decimal)
        - name: min_profit_factor
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                minimum: 0
              - type: 'null'
            description: Minimum combined profit factor
            title: Min Profit Factor
          description: Minimum combined profit factor
        - name: min_win_rate
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: 0
              - type: 'null'
            description: Minimum combined win rate (decimal)
            title: Min Win Rate
          description: Minimum combined win rate (decimal)
        - name: min_avg_buy_price
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: 0
              - type: 'null'
            description: Minimum combined avg buy price (0-1)
            title: Min Avg Buy Price
          description: Minimum combined avg buy price (0-1)
        - name: max_avg_buy_price
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: 0
              - type: 'null'
            description: Maximum combined avg buy price (0-1)
            title: Max Avg Buy Price
          description: Maximum combined avg buy price (0-1)
        - name: min_avg_sell_price
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: 0
              - type: 'null'
            description: Minimum combined avg sell price (0-1)
            title: Min Avg Sell Price
          description: Minimum combined avg sell price (0-1)
        - name: max_avg_sell_price
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: 0
              - type: 'null'
            description: Maximum combined avg sell price (0-1)
            title: Max Avg Sell Price
          description: Maximum combined avg sell price (0-1)
        - name: min_entry_edge
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: -1
              - type: 'null'
            description: Minimum combined entry edge
            title: Min Entry Edge
          description: Minimum combined entry edge
        - name: max_entry_edge
          in: query
          required: false
          schema:
            anyOf:
              - type: number
                maximum: 1
                minimum: -1
              - type: 'null'
            description: Maximum combined entry edge
            title: Max Entry Edge
          description: Maximum combined entry edge
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Results per page
            default: 100
            title: Limit
          description: Results per page
        - name: pagination_key
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Cursor for pagination
            title: Pagination Key
          description: Cursor for pagination
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletFilterResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
components:
  schemas:
    MarketFilterLogic:
      type: string
      enum:
        - and
        - or
      title: MarketFilterLogic
      description: Logic for combining market filters.
    TimeWindow:
      type: string
      enum:
        - 1d
        - 7d
        - 30d
        - all_time
      title: TimeWindow
      description: Time window for rolling metrics.
    LeaderboardSortBy:
      type: string
      enum:
        - realized_pnl
        - total_pnl
        - volume
        - roi
        - profit_factor
        - win_rate
        - trades
      title: LeaderboardSortBy
      description: Sort options for leaderboard.
    OrderDirection:
      type: string
      enum:
        - asc
        - desc
      title: OrderDirection
      description: Sort order direction enum.
    WalletFilterResponse:
      properties:
        markets:
          items:
            type: string
          type: array
          title: Markets
          description: Market condition IDs used in filter
        market_logic:
          $ref: '#/components/schemas/MarketFilterLogic'
          description: 'Logic used: AND or OR'
        window:
          $ref: '#/components/schemas/TimeWindow'
          description: Time window for metrics
        sort_by:
          $ref: '#/components/schemas/LeaderboardSortBy'
          description: Sort field used
        entries:
          items:
            $ref: '#/components/schemas/WalletFilterEntry'
          type: array
          title: Entries
          description: Matching wallets
        pagination:
          $ref: '#/components/schemas/CursorPagination'
          description: Pagination info
      type: object
      required:
        - markets
        - market_logic
        - window
        - sort_by
        - entries
        - pagination
      title: WalletFilterResponse
      description: Response for wallet filter by markets endpoint.
    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
    WalletFilterEntry:
      properties:
        rank:
          type: integer
          title: Rank
          description: Position in results (1-indexed)
        user:
          type: string
          title: User
          description: Wallet address
        metrics:
          $ref: '#/components/schemas/WindowMetrics'
          description: >-
            Combined metrics across specified markets (aggregated from
            per-market data)
        entry_edge:
          anyOf:
            - type: number
            - type: 'null'
          title: Entry Edge
          description: Combined price edge across specified markets (avg_sell - avg_buy)
        markets_matched:
          type: integer
          title: Markets Matched
          description: Number of specified markets this wallet traded
      type: object
      required:
        - rank
        - user
        - metrics
        - markets_matched
      title: WalletFilterEntry
      description: Single entry in wallet filter results.
    CursorPagination:
      properties:
        limit:
          type: integer
          title: Limit
          description: Requested limit
        count:
          type: integer
          title: Count
          description: Number of items in current response
        pagination_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagination Key
          description: Base64-encoded cursor for next page
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more items available
      type: object
      required:
        - limit
        - count
        - has_more
      title: CursorPagination
      description: Cursor-based pagination for endpoints that don't support offset.
    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
    WindowMetrics:
      properties:
        realized_pnl:
          type: number
          title: Realized Pnl
          description: Realized profit/loss in USD (from closed positions)
        total_pnl:
          anyOf:
            - type: number
            - type: 'null'
          title: Total Pnl
          description: Total PnL in USD (realized + unrealized - net fees)
        volume:
          type: number
          title: Volume
          description: Trading volume in USD
        roi:
          type: number
          title: Roi
          description: Return on investment (decimal, e.g., 0.5 = 50%)
        trades:
          type: integer
          title: Trades
          description: Number of trades
        wins:
          type: integer
          title: Wins
          description: Number of winning positions closed
        losses:
          type: integer
          title: Losses
          description: Number of losing positions closed
        win_rate:
          type: number
          title: Win Rate
          description: Win rate (decimal, e.g., 0.6 = 60%)
        profit_factor:
          type: number
          title: Profit Factor
          description: Profit factor (gross profit / gross loss)
        positions_closed:
          type: integer
          title: Positions Closed
          description: Number of positions closed
        avg_buy_price:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Buy Price
          description: Volume-weighted average buy price (0-1)
        avg_sell_price:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Sell Price
          description: Volume-weighted average sell price (0-1)
        fees_paid:
          type: number
          title: Fees Paid
          description: Taker fees paid in USD
          default: 0
        fees_refunded:
          type: number
          title: Fees Refunded
          description: 'DEPRECATED: always 0. Refunds are already netted into fees_paid.'
          default: 0
      type: object
      required:
        - realized_pnl
        - volume
        - roi
        - trades
        - wins
        - losses
        - win_rate
        - profit_factor
        - positions_closed
      title: WindowMetrics
      description: Metrics for a specific time window.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````