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

# List a crypto series' window markets, bucketed by state

> Navigation for a short-crypto Up/Down series: window symbols churn every cadence, so clients walk the series by state rather than by symbol. Each entry is the same `MarketSummary` shape `/api/markets` returns, `cryptoWindow` included. Buckets are computed from the WINDOW BOUNDS against the current time, NOT from lifecycle status — a window can be CLOSED while its period is still `current` (settlement lag), and `current` is normally a single window but is not guaranteed to be, so treat it as a list. `next` is the lookahead (soonest first), `past` is most-recent first by window end, `all` is every bounded window in chronological order for the window-picker strip (a calendar day straddles past/current/next at once, so no now-relative bucket can express it). Narrow any bucket with `from` / `to`. Public — no auth required; `Cache-Control: public, max-age=5`; 600 req/min per IP.



## OpenAPI

````yaml /api-reference/openapi.json get /api/crypto-series/{id}/windows
openapi: 3.1.0
info:
  title: PredictStreet core-api
  description: >-
    Client-facing HTTP gateway for the PredictStreet prediction-market platform.
    This spec is hand-written against the NestJS controllers and DTOs in
    core-api/src/modules/. For the source-of-truth live spec, run
    `./scripts/pull-openapi.sh` against a running core-api (NestJS exposes it at
    /api/docs-json). **Partner kinds.** Every authenticated endpoint resolves a
    request's *effective wallet* from the partner row. `single_wallet` partners
    bind to one `associatedWallet` set at creation. `multi_wallet` partners
    declare the actor on every request via an `X-User-Wallet: 0x<40-hex>`
    header. See the [Partner kinds](/auth/api-keys#partner-kinds) doc for the
    full contract.
  version: '2026-06-16'
  contact:
    name: PredictStreet partners
    email: partners@predictstreet.com
servers:
  - url: https://core.api.dev.predictstreet.sde.adifoundation.ai
    description: Testnet (partner integrator API — final domain TBD)
security: []
tags:
  - name: Deposits
    description: >-
      Gasless USDC deposit relay - submit a signed EIP-2612 permit and the
      platform broadcasts the on-chain deposit for you (no gas).
  - name: Events
    description: >-
      Polymarket-style event grouping with football metadata (group, stage,
      teams, tags).
  - name: Tags
    description: Curated tag taxonomy used to filter events.
  - name: Markets
    description: 'Public market data: list, detail, orderbook, trades, OHLC.'
  - name: Crypto
    description: >-
      Crypto price markets: the underlying-asset price curve and Up/Down series
      navigation. The markets themselves are ordinary binary markets — list them
      through /api/markets and /api/events.
  - name: Orders
    description: >-
      Signed-order place / cancel / read. Requires `X-Api-Key` with
      `orders:read` / `orders:write` scope; every write additionally requires an
      EIP-712 signature over the order.
  - name: Portfolio
    description: >-
      Balances, positions, trades, fees, vault info for the key's
      `associatedWallet`. Requires `X-Api-Key` with `portfolio:read` scope.
  - name: Matches
    description: >-
      admin.matches aggregate — groups several events into one fixture/card (1X2
      + first-scorer + over-under under one matchup).
  - name: Vault
    description: >-
      Backend co-signatures for ERC-1155 split / merge, and recovery for
      off-chain locks when the corresponding chain tx never confirmed. Requires
      `X-Api-Key` with `vault:write` scope plus an EIP-712 signature over the
      operation.
  - name: Leaderboard
    description: Public ranked leaderboard across PnL / volume buckets.
  - name: Search
    description: Global search across users, events, and matches.
  - name: Withdrawal Security
    description: >-
      Self-service withdrawal 2FA (TOTP) and withdrawal-address whitelist. Same
      endpoints serve the frontend (Privy JWT) and API-key integrators.
      Mutations need `vault:write`, reads `portfolio:read`. Both are opt-in per
      wallet and only gate withdrawals once the platform enables
      withdrawal-security enforcement.
paths:
  /api/crypto-series/{id}/windows:
    get:
      tags:
        - Crypto
      summary: List a crypto series' window markets, bucketed by state
      description: >-
        Navigation for a short-crypto Up/Down series: window symbols churn every
        cadence, so clients walk the series by state rather than by symbol. Each
        entry is the same `MarketSummary` shape `/api/markets` returns,
        `cryptoWindow` included. Buckets are computed from the WINDOW BOUNDS
        against the current time, NOT from lifecycle status — a window can be
        CLOSED while its period is still `current` (settlement lag), and
        `current` is normally a single window but is not guaranteed to be, so
        treat it as a list. `next` is the lookahead (soonest first), `past` is
        most-recent first by window end, `all` is every bounded window in
        chronological order for the window-picker strip (a calendar day
        straddles past/current/next at once, so no now-relative bucket can
        express it). Narrow any bucket with `from` / `to`. Public — no auth
        required; `Cache-Control: public, max-age=5`; 600 req/min per IP.
      operationId: CryptoSeriesController_windows
      parameters:
        - name: id
          in: path
          required: true
          description: Crypto series id — `event.cryptoSeries.id`.
          schema:
            type: string
            format: uuid
        - name: state
          in: query
          required: true
          description: >-
            Bucket to return. No default — an unrecognised value returns 400
            `invalid_state` rather than a plausible-looking wrong bucket.
          schema:
            type: string
            enum:
              - current
              - next
              - past
              - all
        - name: limit
          in: query
          description: >-
            Page size. Default 50, or 500 for `state=all` (a 15-minute day is 96
            windows, so the generic default would cut the strip at noon).
          schema:
            type: integer
            minimum: 1
            maximum: 500
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: from
          in: query
          description: >-
            Inclusive lower bound on the window START. ISO-8601 with an explicit
            offset (`2026-07-29T00:00:00Z`) or a bare date (`2026-07-29`); a
            naive date-time is rejected. Composes with `state`.
          schema:
            type: string
        - name: to
          in: query
          description: >-
            EXCLUSIVE upper bound on the window START, so `from` / `to` day
            boundaries never double-count the window that straddles midnight. At
            most 31 days wide.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoSeriesWindowsResp'
        '400':
          description: >-
            `invalid_series_id` (not a uuid), `invalid_state`, `invalid_limit`,
            `invalid_offset`, `invalid_from`, `invalid_to`, or `range_too_wide`
            (`from`..`to` spans more than 31 days).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - {}
components:
  schemas:
    CryptoSeriesWindowsResp:
      type: object
      properties:
        markets:
          type: array
          items:
            $ref: '#/components/schemas/MarketSummary'
          description: >-
            Window markets in the requested bucket — the same MarketSummary
            shape `/api/markets` returns, `cryptoWindow` included.
        hasMore:
          type: boolean
          description: >-
            True when more rows exist past this page — distinguishes a truncated
            strip from end-of-data.
      required:
        - markets
        - hasMore
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        status:
          type: integer
          example: 400
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: bad_request
            message:
              type: string
            details:
              type: object
              additionalProperties: true
            trace_id:
              type: string
    MarketSummary:
      type: object
      description: >-
        Public shape of a market. Returned by /api/markets, /api/markets/{slug},
        and as the markets[] array on Event / Match responses.
      properties:
        id:
          type: string
          format: uuid
        eventId:
          type: string
          format: uuid
          description: Parent admin.events row.
        symbol:
          type: string
          description: >-
            Operator-facing identifier (e.g. `M1V1-RMA-MCI-959311`). Used by
            sub-resource endpoints (`/orderbook`, `/trades`, `/ohlc`,
            `/traders`).
        slug:
          type: string
          description: >-
            Canonical URL-safe slug, lowercased kebab-case derived from
            `event.slug` + `groupItemTitle` + `title`. Required for the root
            market-detail endpoint `GET /api/markets/{slug}` (2026-05-16
            breaking change; sub-resources still use `symbol`). Unique across
            `admin.markets`.
        title:
          type: string
          description: >-
            Human-readable market title (matches the parent event title for
            single-market events).
        groupItemTitle:
          type: string
          nullable: true
          description: >-
            Per-market label inside a multi-market event accordion
            (Polymarket-style). Null when the market is its own event.
        conditionId:
          type: string
          nullable: true
          description: >-
            On-chain ConditionalTokens condition id (bytes32 hex). Null until
            the deployment is confirmed.
        questionId:
          type: string
          nullable: true
          description: On-chain question id (bytes32 hex).
        yesTokenId:
          type: string
          nullable: true
          description: >-
            ERC-1155 position id of the YES outcome (uint256, decimal string).
            Use for EIP-712 order signing on binary markets.
        noTokenId:
          type: string
          nullable: true
          description: ERC-1155 position id of the NO outcome. Null for non-binary markets.
        status:
          type: string
          enum:
            - DRAFT
            - PROPOSED
            - PRE_MARKET
            - OPEN
            - PAUSED
            - SUSPENDED
            - CLOSED
            - PENDING_RESOLUTION
            - DELAYED
            - DISPUTED
            - RESOLVED
            - VOIDED
            - CANCELLED
        currentReviewRound:
          type: integer
        outcomeCount:
          type: integer
        outcomeLabels:
          type: array
          items:
            type: string
          description: >-
            Outcome labels in fixed order (e.g. ["YES","NO"] or ["Real
            Madrid","Draw","Barcelona"]).
        initialFairValue:
          $ref: '#/components/schemas/DecimalString'
          description: >-
            Single-number seed for binary AMMs. Use initialOutcomePrices for
            multi-outcome.
        initialOutcomePrices:
          type: array
          items:
            $ref: '#/components/schemas/DecimalString'
          description: >-
            Per-outcome initial price, parallel to outcomeLabels. Sums to ~1.0.
            Polymarket-equivalent of outcomePrices.
        feeTakerBps:
          type: integer
          nullable: true
          description: >-
            Per-fill taker fee (k × BPS_DIVISOR; peak fee at P=0.5 = feeTakerBps
            / 4 / 10_000). Null inherits from PlatformFeeConfig.
        opensAt:
          type: string
          format: date-time
          nullable: true
        closesAt:
          type: string
          format: date-time
          nullable: true
        kickoff:
          type: string
          format: date-time
          nullable: true
          description: Real-world fixture kickoff time (mirrors event.eventStartTime).
        resolutionWindowHours:
          type: integer
          nullable: true
        pausedAt:
          type: string
          format: date-time
          nullable: true
        resolvedAt:
          type: string
          format: date-time
          nullable: true
        payoutNumerators:
          nullable: true
          description: >-
            Per-outcome payout vector (set on resolve). Null for unresolved
            markets.
        officialDataSource:
          type: string
          nullable: true
        sourceMatchId:
          type: string
          nullable: true
          description: >-
            External fixture identifier (StatsPerform / API-Football / etc.)
            used by the oracle.
        resolutionCriteria:
          type: string
          nullable: true
          description: >-
            Plain-text criteria for settlement. Use resolutionCriteriaUrl on
            Event for the full complete write-up if needed.
        negRiskEligible:
          type: boolean
          description: True if this market is part of a negRisk multi-outcome group.
        isNewMarketType:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        outcomePrices:
          type: array
          items:
            $ref: '#/components/schemas/DecimalString'
          description: >-
            Last-trade price per outcome (parallel to `outcomes`). Decimal
            string in USDC.
        vertical:
          type: string
          nullable: true
          description: >-
            This market's vertical — the category axis verbatim (`football`,
            `tennis`, `crypto`, `politics`, …). Filter the catalog with
            `/api/events?vertical=`.
          example: crypto
        marketType:
          type: string
          nullable: true
          description: >-
            Canonical market type (`MATCH_WINNER_AET`, `CRYPTO_PRICE_EVENT`, …).
            Null for manual/legacy markets AND for machine-minted Up/Down
            windows — to detect a crypto market branch on `crypto` /
            `cryptoWindow` instead.
        crypto:
          $ref: '#/components/schemas/MarketCryptoRule'
        cryptoWindow:
          $ref: '#/components/schemas/MarketCryptoWindow'
    DecimalString:
      type: string
      description: >-
        Decimal number encoded as a string to preserve precision (e.g.
        `'100.5'`).
    MarketCryptoRule:
      type: object
      nullable: true
      description: >-
        Machine-readable price rule of a crypto market — the structured
        counterpart of the human `resolutionCriteria` text. Null on every
        non-crypto market. Present on BOTH long-dated crypto markets and Up/Down
        windows, so `crypto !== null` is the reliable "is this a crypto market"
        test.
      properties:
        productType:
          type: string
          description: >-
            Product vocabulary, passed through verbatim from the listing side —
            treat it as an open string so a newly enabled product needs no
            client change. In use today: `THRESHOLD_BY_DEADLINE`,
            `THRESHOLD_DURING_MONTH`, `NEW_ALL_TIME_HIGH`,
            `MONTH_OVER_MONTH_CLOSE`, `MONTHLY_CLOSE_ABOVE_STRIKE`,
            `UP_DOWN_WINDOW`.
          example: THRESHOLD_BY_DEADLINE
        direction:
          type: string
          enum:
            - ABOVE
            - BELOW
          nullable: true
          description: >-
            Barrier direction. Null on direction-less products (month-over-month
            close, Up/Down windows). Only `ABOVE` is listable in the current
            release.
        targetPrice:
          type: string
          nullable: true
          description: >-
            Strike as a canonical decimal string (never a float — a threshold
            must round-trip exactly). Null on strike-less products. On a market
            that has one, the market `title` is the same digits.
          example: '64400'
        instrumentId:
          type: string
          nullable: true
          description: >-
            Price-catalog instrument. The key for `GET
            /api/markets/{symbol}/crypto-price-history` and for the
            `crypto_price_tick` WebSocket channel. Catalog: `BTC-USD`, `ETH-USD`
            (live), `BTC-DOM`, `TOTAL-MCAP` (modelled, no feed yet).
          example: BTC-USD
        deadlineAt:
          type: string
          format: date-time
          nullable: true
          description: '`THRESHOLD_BY_DEADLINE` only — observation cutoff (UTC).'
        month:
          type: string
          nullable: true
          description: Monthly products only — UTC calendar month, `YYYY-MM`.
          example: 2026-07
      required:
        - productType
        - direction
        - targetPrice
        - instrumentId
        - deadlineAt
        - month
    MarketCryptoWindow:
      type: object
      nullable: true
      description: >-
        Short-crypto Up/Down window facts. Populated only on markets
        materialised from a crypto series window (which also carry `crypto` with
        `productType: UP_DOWN_WINDOW`); null on every other market, long-dated
        crypto markets included.
      properties:
        seriesId:
          type: string
          format: uuid
          description: Parent series — same id as `event.cryptoSeries.id`.
        windowStartAt:
          type: string
          format: date-time
          nullable: true
          description: Start of the economic window (UTC).
        windowEndAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            End of the economic window (UTC). Equals the market's
            `tradingWindow.closesAt`.
        openPrice:
          type: string
          nullable: true
          description: >-
            The frozen open — the price the window's close is measured against.
            UNSCALED integer as a decimal string: render as `openPrice / 10 **
            streamDecimals` with a bigint/decimal helper, never `Number()` (18
            decimals exceeds `Number.MAX_SAFE_INTEGER`). Null until the oracle
            pins it (~45 s after `windowStartAt`) and on windows that have not
            started. Write-once — this is the value settlement binds.
          example: '63672459298735910000000'
        streamDecimals:
          type: integer
          nullable: true
          description: Exponent for `openPrice`.
          example: 18
        openPriceIsFinal:
          type: boolean
          description: >-
            True once the pin exists. The pin is immutable, so an open that
            exists is already final.
        outcome:
          type: string
          enum:
            - UP
            - DOWN
          nullable: true
          description: >-
            Settled direction, once the market is RESOLVED. Null while a
            proposal is still challengeable — a proposed direction is not a
            settled one. `UP` is outcome index 0 (payouts `[1,0]`), `DOWN` index
            1 (`[0,1]`).
      required:
        - seriesId
        - windowStartAt
        - windowEndAt
        - openPrice
        - streamDecimals
        - openPriceIsFinal
        - outcome

````