> ## 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. predictionTraderHoldings query reference: arguments and response fields.

> [!NOTE]
>
> 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).

> [!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.

## 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
}
```

### Example

[Test this query in the Explorer →](https://docs.codex.io/explore.md)

```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](https://docs.codex.io/api-reference/queries/predictionmarketprice.md) 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](https://docs.codex.io/api-reference/queries/predictiontradermarketsstats.md) (data available from \~Feb 2026, when Codex began indexing).

### Troubleshooting Tips

> [accordion] 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] Does this include closed positions or trade history?
>
> No. This endpoint returns current holdings only. For historical trade activity, use the [predictionTraderMarketsStats](https://docs.codex.io/api-reference/queries/predictiontradermarketsstats.md) endpoint.

> [accordion] 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] Can I compute live unrealized PnL from this response?
>
> Yes. Combine holdings quantities with the latest [predictionMarketPrice](https://docs.codex.io/api-reference/queries/predictionmarketprice.md) result for each market.

### Related Recipes

* [Prediction Traders](https://docs.codex.io/recipes/predictions/traders.md): Learn how to build trader leaderboards, profiles, and portfolio analytics for prediction market traders


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.