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

# predictionTraderHoldings

> Returns all prediction token holdings for a specific trader.

export const walletAddress_0 = undefined

export const protocol_0 = undefined

<Info>
  **Prediction Market data is currently in beta**. It is actively being worked on and improved, but may be unreliable. Polymarket and Kalshi data are live.

  At least for the time being, this endpoint requires a Growth or Enterprise plan. [Learn more](https://dashboard.codex.io/dashboard/billing?utm_source=codex\&utm_medium=docs\&utm_campaign=billing).
</Info>

<Note>
  Open trader positions are fully accurate and updated as trades settle on-chain (Polymarket) or via the Kalshi websocket. Both sources are backfilled on reconnect.
</Note>

<div data-generated>
  ## GraphQL

  ```
  type Query {
    # Requires a Growth or Enterprise plan.
    predictionTraderHoldings(
      input: PredictionTraderHoldingsInput!
    ): PredictionTraderHoldingsConnection
  }

  enum PredictionProtocol {
    POLYMARKET
    KALSHI
  }

  type PredictionResolution {
    result: String
    source: String
  }

  type PredictionSubSubcategory {
    name: String!
    slug: String!
  }

  type PredictionSubcategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubSubcategory!]
  }

  type PredictionCategory {
    name: String!
    slug: String!
    subcategories: [PredictionSubcategory!]
  }

  enum PredictionMetadataType {
    SPORTS
  }

  type SportsTeam {
    abbreviation: String!
    altAbbreviations: [String!]
    name: String
    league: String
    logo: String
    alias: String
    color: String
    providerId: Int
    isHome: Boolean
  }

  enum SportsTimezone {
    UTC
  }

  type SportsMarketEnrichedMetadata {
    sportsMarketType: String
    league: String
    teams: [SportsTeam!]
    gameStartDate: String
    gameStartTime: String
    gameStartTimeSeconds: Int
    gameStartTimezone: SportsTimezone
  }

  type PredictionMarketEnrichedMetadata {
    metadataType: PredictionMetadataType!
    sports: SportsMarketEnrichedMetadata
  }

  type PredictionMarket {
    id: String!
    protocol: PredictionProtocol!
    venueMarketId: String!
    venueMarketSlug: String
    eventId: String
    venueEventId: String
    question: String
    label: String
    suggestedLabel: String
    eventLabel: String
    rules: String
    rules2: String
    venueOutcomeIds: [String!]!
    outcomeIds: [String!]!
    outcomeLabels: [String!]
    resolution: PredictionResolution
    imageLargeUrl: String
    imageThumbUrl: String
    imageSmallUrl: String
    createdAt: Int
    updatedAt: Int
    opensAt: Int
    closesAt: Int
    resolvesAt: Int
    resolvedAt: Int
    observedAt: Int!
    networkId: Int
    exchangeAddress: String
    categories: [PredictionCategory!]
    winningOutcomeId: String
    enrichedMetadata: PredictionMarketEnrichedMetadata
  }

  type PredictionTraderHolding {
    tokenId: String!
    traderId: String!
    venueTraderId: String!
    amount: String!
    market: PredictionMarket
    outcomeIndex: Int
  }

  type PredictionTraderHoldingsConnection {
    items: [PredictionTraderHolding!]!
    cursor: String
  }

  input PredictionTraderHoldingsInput {
    traderId: String!
    limit: Int
    cursor: String
  }
  ```
</div>

### Example

<a href="/explore" target="_blank" rel="noopener noreferrer">Test this query in the Explorer →</a>

```graphql theme={null}
{
  predictionTraderHoldings(
    input: {traderId: "0x492442eab586f242b53bda933fd5de859c8a3782:Polymarket", limit: 10}
  ) {
    items {
      amount
      market {
        label
        createdAt
        closesAt
        categories {
          name
        }
        protocol
        question
        eventId
      }
      tokenId
    }
  }
}
```

### Usage Guidelines

* Use this endpoint to display a trader's open positions and market details.
* Pair with [predictionMarketPrice](/api-reference/queries/predictionmarketprice) to compute live unrealized PnL on open positions.
* Works across both Polymarket and Kalshi markets supported by Codex.
* For historical performance beyond open positions, combine with [predictionTraderMarketsStats](/api-reference/queries/predictiontradermarketsstats) (data available from \~Feb 2026, when Codex began indexing).

### Troubleshooting Tips

<AccordionGroup>
  <Accordion title="How accurate is this data?">
    Open trader positions are expected to be fully accurate. Polymarket data is derived from Polygon transaction processing. Kalshi data is sourced via Kalshi's websocket.
  </Accordion>

  <Accordion title="Does this include closed positions or trade history?">
    No. This endpoint returns current holdings only. For historical trade activity, use the [predictionTraderMarketsStats](/api-reference/queries/predictiontradermarketsstats) endpoint.
  </Accordion>

  <Accordion title="Why is a trader's holdings list empty?">
    Either the trader has no open positions, or the trader address is from a market we don't index. Confirm the address is active on a supported venue (Polymarket or Kalshi).
  </Accordion>

  <Accordion title="Can I compute live unrealized PnL from this response?">
    Yes. Combine holdings quantities with the latest [predictionMarketPrice](/api-reference/queries/predictionmarketprice) result for each market.
  </Accordion>
</AccordionGroup>

### Related Recipes

* [Prediction Traders](/recipes/prediction-traders): Learn how to build trader leaderboards, profiles, and portfolio analytics for prediction market traders
