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

# Market Calibration

> Calibration analysis across resolved markets.

Returns a histogram-style breakdown: each bucket reports how many
markets were trading in that implied-probability range at
`minutes_before` before resolution, and what fraction of those
markets actually resolved Up.



## OpenAPI

````yaml get /v1/stats/calibration
openapi: 3.1.0
info:
  title: PolyQuantLab API
  version: 0.1.0
  description: >-
    Sub-second Polymarket orderbook data, walk-the-book backtests, paper
    trading, and the live arb audit. Same endpoints the PolyQuantLab dashboard
    uses internally — Bearer-token auth, JSON-over-HTTPS, predictable
    pagination.
  contact:
    email: contact@polyquantlab.com
    url: https://polyquantlab.com/contact
  license:
    name: Proprietary
servers:
  - url: https://api.polyquantlab.com
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /v1/stats/calibration:
    get:
      tags:
        - stats
      summary: Market Calibration
      description: |-
        Calibration analysis across resolved markets.

        Returns a histogram-style breakdown: each bucket reports how many
        markets were trading in that implied-probability range at
        `minutes_before` before resolution, and what fraction of those
        markets actually resolved Up.
      operationId: market_calibration_v1_stats_calibration_get
      parameters:
        - name: ticker
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Ticker
            examples:
              - BTC
              - ETH
              - SOL
        - name: event_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            examples:
              - 5m
              - 15m
              - 1h
              - 4h
              - 24h
            title: Event Type
        - name: minutes_before
          in: query
          required: false
          schema:
            type: number
            maximum: 1440
            minimum: 0
            description: How far before resolution to sample the implied probability.
            default: 1
            title: Minutes Before
          description: How far before resolution to sample the implied probability.
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Since
        - name: until
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Until
        - name: buckets
          in: query
          required: false
          schema:
            type: integer
            maximum: 50
            minimum: 2
            default: 10
            title: Buckets
        - name: max_markets
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 10
            default: 2000
            title: Max Markets
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/MarketCalibrationVStatsCalibrationGetResponse
              example:
                ticker: BTC
                event_type: 5m
                minutes_before: 1
                buckets:
                  - prob_lo: 0
                    prob_hi: 0.1
                    n_markets: 1240
                    frac_resolved_up: 0.04
                  - prob_lo: 0.1
                    prob_hi: 0.2
                    n_markets: 612
                    frac_resolved_up: 0.13
                  - prob_lo: 0.2
                    prob_hi: 0.3
                    n_markets: 421
                    frac_resolved_up: 0.24
                  - prob_lo: 0.45
                    prob_hi: 0.55
                    n_markets: 802
                    frac_resolved_up: 0.49
                  - prob_lo: 0.8
                    prob_hi: 0.9
                    n_markets: 580
                    frac_resolved_up: 0.86
                  - prob_lo: 0.9
                    prob_hi: 1
                    n_markets: 1184
                    frac_resolved_up: 0.95
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    MarketCalibrationVStatsCalibrationGetResponse:
      type: object
      properties:
        ticker:
          type: string
          enum:
            - BTC
            - ETH
            - SOL
        event_type:
          type: string
          enum:
            - 5m
            - 15m
            - 1h
            - 4h
            - daily_up_down
        minutes_before:
          type: number
          format: double
        buckets:
          type: array
          items:
            type: object
            properties:
              prob_lo:
                type: number
                format: double
              prob_hi:
                type: number
                format: double
              n_markets:
                type: integer
                format: int64
              frac_resolved_up:
                type: number
                format: double
            required:
              - prob_lo
              - prob_hi
              - n_markets
              - frac_resolved_up
      required:
        - ticker
        - event_type
        - minutes_before
        - buckets
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````