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

# Crypto up/down page bundle

> For Polymarket Chainlink up/down events (e.g. btc-updown-5m-*), returns Price to Beat, final/live price, underlying chart history, phase, and sibling series windows for the interval strip.



## OpenAPI

````yaml /prediction-markets/openapi.json get /v1/events/{event_id}/crypto
openapi: 3.1.0
info:
  title: Prediction Market API (Beta)
  description: >-
    Unified **beta** prediction market API for Kalshi and Polymarket — markets,
    events, full historical trades and candlesticks, orderbooks, crypto up/down
    windows, and Polymarket wallet analytics. Read/market-data only.


    **Auth:** pass your Data API key in the `x-api-key` header.


    **Conventions:** response bodies use camelCase. Query params are snake_case
    (camelCase aliases accepted where noted).


    **Caching:** SWR endpoints may set `X-Cache` (`HIT` | `HIT-STALE` | `MISS`).
    Busy backends may return `503` with `SERVICE_BUSY`.


    **Realtime:** join `pm:*` rooms on
    `wss://datastream.solanatracker.io/{apiKey}` (same Datastream hub as other
    products — see Datastream → Prediction Markets).
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://prediction-market-api.solanatracker.io
    description: Public beta
security:
  - apiKey: []
tags:
  - name: Exchange
    description: Exchange status
  - name: Events
    description: >-
      Cross-exchange event groupings (Kalshi event_ticker, Polymarket Gamma
      grouped/negRisk events). Includes metadata: image, icon, description,
      tags, and nested markets with groupItemTitle.
  - name: Crypto
    description: >-
      Polymarket crypto up/down (Chainlink) Price to Beat, final price, chart
      history, and series windows.
  - name: Meta
    description: Categories, series, sports, live data
  - name: Markets
    description: Market data, orderbooks, candles
  - name: Trades
    description: Trade feeds
  - name: Accounts
    description: Polymarket wallet analytics (FIFO PnL)
  - name: Leaderboard
    description: Top wallet PnL rankings (Polymarket; Kalshi has no public wallets)
  - name: Stats
    description: Platform statistics
paths:
  /v1/events/{event_id}/crypto:
    get:
      tags:
        - Crypto
      summary: Crypto up/down page bundle
      description: >-
        For Polymarket Chainlink up/down events (e.g. btc-updown-5m-*), returns
        Price to Beat, final/live price, underlying chart history, phase, and
        sibling series windows for the interval strip.
      operationId: get_event_crypto_path
      parameters:
        - name: event_id
          in: path
          description: Polymarket id, POLY-id, or slug
          required: true
          schema:
            type: string
        - name: exchange
          in: query
          description: Force exchange; default auto
          required: false
          schema:
            type: string
        - name: windows_limit
          in: query
          description: Max sibling windows (default 24, max 48)
          required: false
          schema:
            type: integer
            format: int64
            minimum: 0
        - name: include_history
          in: query
          description: Include chart points (default true)
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Crypto event bundle
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoEventResponse'
        '404':
          description: Not a crypto up/down event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
components:
  schemas:
    CryptoEventResponse:
      type: object
      description: Bundled crypto page payload for one event.
      required:
        - eventId
        - crypto
      properties:
        crypto:
          $ref: '#/components/schemas/CryptoUpDown'
        eventId:
          type: string
        history:
          type: array
          items:
            $ref: '#/components/schemas/CryptoPricePoint'
        price:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/CryptoPriceSnapshot'
        slug:
          type:
            - string
            - 'null'
        windows:
          type: array
          items:
            $ref: '#/components/schemas/CryptoSeriesWindow'
    ApiErrorBody:
      type: object
      description: Standard API error response envelope.
      required:
        - error
        - code
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code (duplicated for convenience).
          minimum: 0
        error:
          type: string
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code: RATE_LIMITED, SERVICE_BUSY,
            BAD_REQUEST, NOT_FOUND, INTERNAL.
    CryptoUpDown:
      type: object
      description: Typed crypto up/down metadata attached to matching Polymarket events.
      required:
        - asset
        - symbol
        - interval
        - variant
        - phase
      properties:
        asset:
          type: string
          description: Asset key (btc, eth, …).
        finalPrice:
          type:
            - number
            - 'null'
          format: double
          description: Closing / final oracle price when known.
        interval:
          type: string
          description: Human interval (`5m`, `15m`, `1h`, `4h`, `1d`).
        phase:
          $ref: '#/components/schemas/CryptoUpDownPhase'
          description: Derived UI phase.
        priceToBeat:
          type:
            - number
            - 'null'
          format: double
          description: Opening reference price ("Price to Beat").
        resolutionSource:
          type:
            - string
            - 'null'
          description: Resolution source URL (typically Chainlink).
        result:
          type:
            - string
            - 'null'
          description: Resolved direction when known (`up` / `down`).
        seriesSlug:
          type:
            - string
            - 'null'
          description: Gamma series slug (`btc-up-or-down-5m`).
        seriesTitle:
          type:
            - string
            - 'null'
          description: Series display title (`BTC Up or Down 5m`).
        symbol:
          type: string
          description: Chainlink / Polymarket symbol (BTC, ETH, …).
        variant:
          type: string
          description: Polymarket crypto API variant (`fiveminute`, `hourly`, …).
        windowEnd:
          type:
            - string
            - 'null'
          description: Window close (ISO-8601).
        windowStart:
          type:
            - string
            - 'null'
          description: >-
            Window open (ISO-8601). Price to Beat is the oracle price at this
            instant.
    CryptoPricePoint:
      type: object
      description: One underlying-price point for the window chart.
      required:
        - timestamp
        - value
      properties:
        timestamp:
          type: integer
          format: int64
          description: Unix epoch milliseconds.
        value:
          type: number
          format: double
    CryptoPriceSnapshot:
      type: object
      description: Open/close oracle snapshot from Polymarket `/api/crypto/crypto-price`.
      required:
        - completed
        - incomplete
      properties:
        cached:
          type: boolean
        closePrice:
          type:
            - number
            - 'null'
          format: double
        completed:
          type: boolean
        incomplete:
          type: boolean
        openPrice:
          type:
            - number
            - 'null'
          format: double
        timestamp:
          type:
            - integer
            - 'null'
          format: int64
    CryptoSeriesWindow:
      type: object
      description: Sibling window in the same crypto series (for the interval strip).
      required:
        - eventId
        - slug
        - title
        - closed
      properties:
        closed:
          type: boolean
        eventId:
          type: string
        finalPrice:
          type:
            - number
            - 'null'
          format: double
        percentChange:
          type:
            - number
            - 'null'
          format: double
        priceToBeat:
          type:
            - number
            - 'null'
          format: double
        result:
          type:
            - string
            - 'null'
          description: '`up` / `down` when resolved.'
        slug:
          type: string
        title:
          type: string
        url:
          type:
            - string
            - 'null'
        windowEnd:
          type:
            - string
            - 'null'
        windowStart:
          type:
            - string
            - 'null'
    CryptoUpDownPhase:
      type: string
      description: Lifecycle phase for a crypto up/down window.
      enum:
        - upcoming
        - live
        - determining
        - resolved
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Solana Tracker Data API key

````