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

# Underlying crypto price curve

> Per-bucket close prices of the UNDERLYING asset (e.g. BTC/USD) from the oracle's finalized one-minute candles, plus the current spot. Distinct from the market probability charts on `:symbol/ohlc` and `:symbol/price-history` — this is the price of the coin the market is written against. `range` is required and fixes the lookback, the bucket width and the cache TTL: `10m` (1-minute buckets over 10 minutes), `1h` (1 min / 1 h), `1d` (5 min / 24 h), `1w` (1 h / 7 d), `1m` (4 h / 30 d), `all` (1 d / up to 2 years). Only complete, grid-aligned buckets are returned, and `from` / `to` echo the snapped window actually queried. Public — no auth required; `Cache-Control: public, max-age=30`; 120 req/min per IP on this route on top of the shared 600 req/min markets ceiling. For a live price subscribe to the `crypto_price_tick` WebSocket channel instead of polling.



## OpenAPI

````yaml /api-reference/openapi.json get /api/markets/{symbol}/crypto-price-history
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/markets/{symbol}/crypto-price-history:
    get:
      tags:
        - Crypto
      summary: Underlying crypto price curve
      description: >-
        Per-bucket close prices of the UNDERLYING asset (e.g. BTC/USD) from the
        oracle's finalized one-minute candles, plus the current spot. Distinct
        from the market probability charts on `:symbol/ohlc` and
        `:symbol/price-history` — this is the price of the coin the market is
        written against. `range` is required and fixes the lookback, the bucket
        width and the cache TTL: `10m` (1-minute buckets over 10 minutes), `1h`
        (1 min / 1 h), `1d` (5 min / 24 h), `1w` (1 h / 7 d), `1m` (4 h / 30 d),
        `all` (1 d / up to 2 years). Only complete, grid-aligned buckets are
        returned, and `from` / `to` echo the snapped window actually queried.
        Public — no auth required; `Cache-Control: public, max-age=30`; 120
        req/min per IP on this route on top of the shared 600 req/min markets
        ceiling. For a live price subscribe to the `crypto_price_tick` WebSocket
        channel instead of polling.
      operationId: MarketsController_cryptoPriceHistory
      parameters:
        - $ref: '#/components/parameters/MarketSymbol'
        - name: range
          in: query
          required: true
          description: Time-window preset.
          schema:
            type: string
            enum:
              - 10m
              - 1h
              - 1d
              - 1w
              - 1m
              - all
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoPriceHistoryResp'
        '400':
          description: >-
            `invalid_range` — `range` missing or not one of the presets.
            `error.details.allowed` echoes the valid set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: >-
            `market_not_found` — unknown symbol, or a market that is not
            publicly visible.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: >-
            `instrument_unsupported` — the market's `instrumentId` is outside
            the price catalog; or `instrument_source_unavailable` — its price
            source is not registered yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
      security:
        - {}
components:
  parameters:
    MarketSymbol:
      name: symbol
      in: path
      required: true
      description: >-
        Market symbol, e.g. `UAE-CUP-FINAL-20260425`. Used by sub-resource
        endpoints (`/orderbook`, `/trades`, `/ohlc`, `/traders`). The root
        market-detail endpoint `/api/markets/{slug}` accepts the slug instead —
        see `MarketSlug`.
      schema:
        type: string
  schemas:
    CryptoPriceHistoryResp:
      type: object
      description: >-
        Underlying-asset price curve for a crypto market — the price of the
        COIN, distinct from the market probability charts on `/ohlc` and
        `/price-history`.
      properties:
        symbol:
          type: string
          example: BTC15M-20260729T1730
        instrumentId:
          type: string
          nullable: true
          example: BTC-USD
        asset:
          type: string
          nullable: true
          example: BTC
        quoteAsset:
          type: string
          nullable: true
          example: USD
        range:
          type: string
          enum:
            - 10m
            - 1h
            - 1d
            - 1w
            - 1m
            - all
          description: Echoes the requested preset.
        bucketSeconds:
          type: integer
          description: Resolved bucket width (60 / 300 / 3600 / 14400 / 86400).
          example: 60
        from:
          type: string
          format: date-time
          description: Inclusive lower bound, snapped to the bucket grid.
        to:
          type: string
          format: date-time
          description: Exclusive upper bound, snapped to the bucket grid.
        points:
          type: array
          items:
            $ref: '#/components/schemas/CryptoPricePoint'
          description: >-
            Per-bucket closes in ascending time order. Only complete,
            grid-aligned buckets are returned; capped at 2000 points.
        spot:
          $ref: '#/components/schemas/CryptoSpot'
        priceToBeat:
          type: string
          nullable: true
          description: >-
            Reference line, already scaled to the same units and precision as
            `points[].price`. On an Up/Down window it is the frozen open. Null
            on long-dated markets — their reference is `crypto.targetPrice` —
            and on a window until the open is pinned.
          example: '63672.45929874'
      required:
        - symbol
        - instrumentId
        - asset
        - quoteAsset
        - range
        - bucketSeconds
        - from
        - to
        - points
        - spot
        - priceToBeat
    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
    CryptoPricePoint:
      type: object
      description: One bucket close of the underlying asset price.
      properties:
        t:
          type: string
          format: date-time
          description: Bucket start (UTC), aligned to `bucketSeconds`.
        price:
          type: string
          description: Bucket close as a human decimal string.
          example: '63695.98649614'
      required:
        - t
        - price
    CryptoSpot:
      type: object
      nullable: true
      description: >-
        Latest finalized minute for the instrument. May sit PAST the response's
        `to`; null when no candles exist yet.
      properties:
        price:
          type: string
          example: '63744.09454151'
        at:
          type: string
          format: date-time
      required:
        - price
        - at

````