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

# DetailedPredictionMarketStats

> Response returned by `detailedPredictionMarketStats`. DetailedPredictionMarketStats type reference: every field and its type.

## GraphQL

```
type DetailedPredictionMarketStats {
  marketId: String!
  predictionMarket: PredictionMarket!
  predictionEvent: PredictionEvent!
  lastTransactionAt: Int!
  lifecycle: PredictionLifecycleStats!
  statsMin5: EnhancedWindowedPredictionMarketStats
  statsHour1: EnhancedWindowedPredictionMarketStats
  statsHour4: EnhancedWindowedPredictionMarketStats
  statsHour12: EnhancedWindowedPredictionMarketStats
  statsDay1: EnhancedWindowedPredictionMarketStats
  statsWeek1: EnhancedWindowedPredictionMarketStats
  trendingScores: DetailedPredictionStatsScores!
  relevanceScores: DetailedPredictionStatsScores!
  competitiveScores: DetailedPredictionStatsScores!
  allTimeStats: PredictionMarketAllTimeStats!
}

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 PredictionEventStatus {
  OPEN
  SUSPENDED
  RESOLVED
  CANCELLED
  PENDING
}

type KalshiSportsTickerComponents {
  rawTicker: String!
  seriesPrefix: String!
  seriesSport: String
  teamTailRaw: String
  homeAbbreviation: String
  awayAbbreviation: String
}

type DecomposedVenueTicker {
  kalshiSports: KalshiSportsTickerComponents
}

type SportsEventEnrichedMetadata {
  league: String
  teams: [SportsTeam!]
  gameStartDate: String
  gameStartTime: String
  gameStartTimeSeconds: Int
  gameStartTimezone: SportsTimezone
  decomposedVenueTicker: DecomposedVenueTicker
}

type PredictionEventEnrichedMetadata {
  metadataType: PredictionMetadataType!
  sports: SportsEventEnrichedMetadata
}

type PredictionEvent {
  id: String!
  protocol: PredictionProtocol!
  venueEventId: String!
  venueSeriesId: String
  status: PredictionEventStatus!
  question: String!
  url: String!
  rulesPrimary: String!
  rulesSecondary: String
  tags: [String!]!
  opensAt: Int!
  closesAt: Int
  resolvesAt: Int
  resolvedAt: Int
  resolution: PredictionResolution
  imageLargeUrl: String
  imageThumbUrl: String
  imageSmallUrl: String
  createdAt: Int!
  updatedAt: Int!
  networkId: Int
  marketIds: [String!]
  categories: [PredictionCategory!]
  enrichedMetadata: PredictionEventEnrichedMetadata
}

type PredictionLifecycleStats {
  ageSeconds: Int!
  expectedLifespanSeconds: Int
  timeToResolutionSeconds: Int
  isResolved: Boolean!
  winningOutcomeId: String
}

type CurrencyValuePair {
  usd: String!
  ct: String!
}

type WindowedPredictionMarketCoreStats {
  volume: CurrencyValuePair!
  trades: Int!
}

type WindowedPredictionMarketUniqueTraderStats {
  uniqueTraders: Int!
}

type CurrencyOHLC {
  open: CurrencyValuePair!
  close: CurrencyValuePair!
  low: CurrencyValuePair!
  high: CurrencyValuePair!
}

type WindowedPredictionMarketLiquidityStats {
  liquidity: CurrencyOHLC!
}

type WindowedPredictionMarketOpenInterestStats {
  openInterest: CurrencyOHLC!
}

type WindowedPredictionMarketChangeStats {
  volumeChange: Float!
  tradesChange: Float!
  uniqueTradersChange: Float
  liquidityChange: Float
  openInterestChange: Float
}

type PredictionMarketWindowScores {
  trending: Float!
  relevance: Float!
  competitive: Float!
}

type OutcomeVolumeStats {
  usd: String!
  ct: String!
  shares: String!
}

type PriceValuePair {
  usd: String!
  ct: String!
}

type PriceOHLC {
  open: PriceValuePair!
  close: PriceValuePair!
  low: PriceValuePair!
  high: PriceValuePair!
}

type WindowedPredictionOutcomeCoreStats {
  venueOutcomeId: String!
  trades: Int!
  volume: OutcomeVolumeStats!
  price: PriceOHLC!
}

type OutcomeBuySellVolumeStats {
  usd: String!
  ct: String!
  shares: String!
}

type WindowedPredictionOutcomeBuySellStats {
  buys: Int!
  sells: Int!
  buyVolume: OutcomeBuySellVolumeStats!
  sellVolume: OutcomeBuySellVolumeStats!
}

type WindowedPredictionOutcomeLiquidityStats {
  liquidity: CurrencyOHLC!
}

type WindowedPredictionOutcomeOrderbookStats {
  bid: PriceOHLC!
  ask: PriceOHLC!
}

type WindowedPredictionOutcomeDepthStats {
  bidDepth: CurrencyOHLC!
  askDepth: CurrencyOHLC!
}

type WindowedPredictionOutcomeChangeStats {
  volumeChange: Float!
  volumeSharesChange: Float!
  priceChange: Float!
  tradesChange: Float!
  priceRange: Float!
  buysChange: Float
  sellsChange: Float
  liquidityChange: Float
}

type EnhancedWindowedPredictionOutcomeStats {
  core: WindowedPredictionOutcomeCoreStats!
  buySell: WindowedPredictionOutcomeBuySellStats
  liquidity: WindowedPredictionOutcomeLiquidityStats
  orderbook: WindowedPredictionOutcomeOrderbookStats
  depth: WindowedPredictionOutcomeDepthStats
  statsChange: WindowedPredictionOutcomeChangeStats!
}

type WindowedPredictionAllTimeStats {
  volume: CurrencyValuePair!
  venueVolume: CurrencyValuePair
}

type EnhancedWindowedPredictionMarketStats {
  start: Int!
  end: Int!
  lastTransactionAt: Int!
  core: WindowedPredictionMarketCoreStats!
  uniqueTraders: WindowedPredictionMarketUniqueTraderStats
  liquidity: WindowedPredictionMarketLiquidityStats
  openInterest: WindowedPredictionMarketOpenInterestStats
  statsChange: WindowedPredictionMarketChangeStats!
  scores: PredictionMarketWindowScores!
  outcome0Stats: EnhancedWindowedPredictionOutcomeStats!
  outcome1Stats: EnhancedWindowedPredictionOutcomeStats!
  allTimeStats: WindowedPredictionAllTimeStats!
}

type DetailedPredictionStatsScores {
  score5m: Float
  score1: Float
  score4: Float
  score12: Float
  score24: Float
  score1w: Float
}

type PredictionMarketAllTimeStats {
  volume: CurrencyValuePair!
  venueVolume: CurrencyValuePair
}
```

### Used By

**Returned by**

* [detailedPredictionMarketStats](https://docs.codex.io/api-reference/queries/detailedpredictionmarketstats.md): Returns windowed and all-time stats for a prediction market.


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