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

# PredictionTraderMarketsStatsConnection

> Response returned by `predictionTraderMarketsStats`. PredictionTraderMarketsStatsConnection type reference: every field and its type.

## GraphQL

```
type PredictionTraderMarketsStatsConnection {
  items: [PredictionTraderMarketStats!]!
  cursor: String
}

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
}

enum PredictionTraderMarketPnlStatus {
  WIN
  LOSS
  NEUTRAL
}

type PredictionTraderOutcomeStats {
  outcomeId: String!
  sharesHeld: String!
  actualSharesHeld: String!
  avgEntryPriceUsd: String!
  avgEntryPriceCT: String!
  costBasisUsd: String!
  costBasisCT: String!
  buys: Int!
  sells: Int!
  buyVolumeUsd: String!
  sellVolumeUsd: String!
  buyVolumeCT: String!
  sellVolumeCT: String!
  buyVolumeShares: String!
  sellVolumeShares: String!
  realizedPnlUsd: String!
  realizedPnlCT: String!
  pnlStatus: PredictionTraderMarketPnlStatus!
  firstTradeTimestamp: Int!
  lastTradeTimestamp: Int!
}

type PredictionTraderMarketStats {
  traderId: String!
  marketId: String!
  predictionMarket: PredictionMarket
  hasOpenPosition: Boolean!
  outcome0Stats: PredictionTraderOutcomeStats!
  outcome1Stats: PredictionTraderOutcomeStats!
  createdAt: Int!
  updatedAt: Int!
}
```

### Used By

**Returned by**

* [predictionTraderMarketsStats](https://docs.codex.io/api-reference/queries/predictiontradermarketsstats.md): Returns per-market performance stats for a specific trader.


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