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

# Top traders on a market by total P&L

> Polymarket returns a fast paginated trader leaderboard (`PaginatedMarketTraders`) sorted by market-specific `totalPnlUsd` descending, with persisted public usernames when available. Kalshi returns aggregate `MarketTradeSummary` instead.



## OpenAPI

````yaml /prediction-markets/openapi.json get /v1/markets/{ticker}/traders
openapi: 3.1.0
info:
  title: Prediction Market API (Beta)
  description: >-
    Unified **beta** prediction market API for Kalshi and Polymarket — markets,
    events, full historical trades and candlesticks, orderbooks, crypto up/down
    windows, and Polymarket wallet analytics. Read/market-data only.


    **Auth:** pass your Data API key in the `x-api-key` header.


    **Conventions:** response bodies use camelCase. Query params are snake_case
    (camelCase aliases accepted where noted).


    **Caching:** SWR endpoints may set `X-Cache` (`HIT` | `HIT-STALE` | `MISS`).
    Busy backends may return `503` with `SERVICE_BUSY`.


    **Realtime:** join `pm:*` rooms on
    `wss://datastream.solanatracker.io/{apiKey}` (same Datastream hub as other
    products — see Datastream → Prediction Markets).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://prediction-market-api.solanatracker.io
    description: Public beta
security:
  - apiKey: []
tags:
  - name: Exchange
    description: Exchange status
  - name: Events
    description: >-
      Cross-exchange event groupings (Kalshi event_ticker, Polymarket Gamma
      grouped/negRisk events). Includes metadata: image, icon, description,
      tags, and nested markets with groupItemTitle.
  - name: Crypto
    description: >-
      Polymarket crypto up/down (Chainlink) Price to Beat, final price, chart
      history, and series windows.
  - name: Meta
    description: Categories, series, sports, live data
  - name: Markets
    description: Market data, orderbooks, candles
  - name: Trades
    description: Trade feeds
  - name: Accounts
    description: Polymarket wallet analytics (FIFO PnL)
  - name: Leaderboard
    description: Top wallet PnL rankings (Polymarket; Kalshi has no public wallets)
  - name: Stats
    description: Platform statistics
paths:
  /v1/markets/{ticker}/traders:
    get:
      tags:
        - Markets
      summary: Top traders on a market by total P&L
      description: >-
        Polymarket returns a fast paginated trader leaderboard
        (`PaginatedMarketTraders`) sorted by market-specific `totalPnlUsd`
        descending, with persisted public usernames when available. Kalshi
        returns aggregate `MarketTradeSummary` instead.
      operationId: get_market_traders_path
      parameters:
        - name: ticker
          in: path
          description: Market ticker or condition id
          required: true
          schema:
            type: string
        - name: exchange
          in: query
          description: kalshi, polymarket, or poly
          required: false
          schema:
            type: string
        - name: limit
          in: query
          description: Max results (default 50, max 200)
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: cursor
          in: query
          description: Pagination cursor (Polymarket only)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Trader data (shape varies by exchange)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMarketTraders'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '408':
          description: Request timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
components:
  schemas:
    PaginatedMarketTraders:
      type: object
      required:
        - data
        - count
        - hasMore
      properties:
        count:
          type: integer
          minimum: 0
        cursor:
          type:
            - string
            - 'null'
        data:
          type: array
          items:
            $ref: '#/components/schemas/MarketTrader'
        hasMore:
          type: boolean
    ApiErrorBody:
      type: object
      description: Standard API error response envelope.
      required:
        - error
        - code
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code (duplicated for convenience).
          minimum: 0
        error:
          type: string
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code: RATE_LIMITED, SERVICE_BUSY,
            BAD_REQUEST, NOT_FOUND, INTERNAL.
    MarketTrader:
      type: object
      description: A single trader's aggregated activity on a market.
      required:
        - address
        - exchange
        - buyVolumeUsd
        - sellVolumeUsd
        - totalVolumeUsd
        - buyCount
        - sellCount
        - totalTrades
        - realizedPnlUsd
        - unrealizedPnlUsd
        - totalPnlUsd
        - positionValueUsd
        - returnPct
      properties:
        address:
          type: string
          description: Trader wallet address.
        buyCount:
          type: integer
          format: int64
          description: Number of buy trades.
          minimum: 0
        buyVolumeUsd:
          type: number
          format: double
          description: Total volume bought (USD).
        exchange:
          $ref: '#/components/schemas/Exchange'
          description: Source exchange.
        positionValueUsd:
          type: number
          format: double
          description: Current marked value of this trader's outcome tokens for the market.
        realizedPnlUsd:
          type: number
          format: double
          description: >-
            FIFO profit/loss already locked in by sales or settlement on this
            market.
        returnPct:
          type: number
          format: double
          description: Total market P&L divided by lifetime buy cost, as a percentage.
        sellCount:
          type: integer
          format: int64
          description: Number of sell trades.
          minimum: 0
        sellVolumeUsd:
          type: number
          format: double
          description: Total volume sold (USD).
        totalPnlUsd:
          type: number
          format: double
          description: Realized plus unrealized market-specific profit/loss.
        totalTrades:
          type: integer
          format: int64
          description: Total trade count.
          minimum: 0
        totalVolumeUsd:
          type: number
          format: double
          description: Combined buy + sell volume (USD).
        unrealizedPnlUsd:
          type: number
          format: double
          description: >-
            Mark-to-market profit/loss for currently held outcome tokens on this
            market.
        username:
          type:
            - string
            - 'null'
          description: Public Polymarket @username, when the trader has one.
    Exchange:
      type: string
      enum:
        - polymarket
        - kalshi
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Solana Tracker Data API key

````