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

# Why each matcher pair is or is not an approved link

> A diagnostic report over every recent cross-venue pair the market matcher asserts (tiers `exact`, `semantic` and `structural`, neither market expired, seen within 6 h of the matcher's newest pass). Edges are folded to unique unordered market pairs, and each pair is in exactly one bucket, so bucket counts sum to `totals.pairs`:

- `linked_both` — both markets are legs of the same approved global link; `linked_other` — both are linked, in different links (a conflict); `linked_one` — one side is linked.
- `structural:<code>` — the market-match linker's own verdict for the pair, from a dry run of its decision path (for example `orientation_unproven`, `start_mismatch`, `close_mismatch`, `schedule_unproven`, `venue_duplicate_lost`, `venue_duplicate_no_book`, `already_claimed`, `venue_already_seated`, `single_venue`, `kalshi_only`, `kalshi_*`, `unknown_provider`, `outside_linker_window`; `pending_mint` means the linker would link it on its next tick; `unmapped` is a linker verdict this report has no code for yet, its wording in `detail`).
- `exact:<diagnostic>` / `semantic:<diagnostic>` — a metadata heuristic for what separates the two markets: `date_mismatch`, `numeric_line_mismatch`, `negation_mismatch`, `outcome_label_mismatch`, `same_fixture_candidate` (the venues' sports metadata names one game: likely promotable), or `other`.
- `malformed` — an edge with an empty market id or pairing a market with itself.

Each bucket carries counts by venue pair, by league/category and by reason, plus up to 40 sample pairs, highest matcher score first. Computed by a cron job every 10 minutes and served from Redis; 503 until the first cycle after a deploy.

Cached with `Cache-Control: public, max-age=60, s-maxage=120`.




## OpenAPI

````yaml /openapi/data-api.yaml get /market-links/coverage
openapi: 3.1.0
info:
  title: Kairos Data API
  version: 1.0.0
  summary: >-
    The full Kairos data plane — markets, candles, trades, search, discover,
    sports, trader analytics, and PnL.
  description: |
    The Kairos Data API at `data.kairos.trade` is the platform's primary data
    plane: market metadata and prices, OHLCV candles, live venue trade proxies,
    normalized trade history, full-text search, discovery feeds, the sports
    catalog, public trader analytics, and account PnL.

    ## Authentication

    Most read endpoints are `public`: you can call them with no credentials,
    on a smaller anonymous rate tier keyed by your IP. Send a Kairos **API
    key** (`X-Client-Id` + `X-Api-Key` + `X-Api-Secret`, all three) to get
    your own budget. If you send API-key headers, they must be complete and
    valid, or the request fails with `401`. An API key must also carry any
    **scope** an operation lists (`trade:read`, `position:read`). Endpoints
    marked `api-key` or `session` require credentials.

    For high-volume market-data consumption (candles/trades/metadata at
    scale), prefer the dedicated **Market Data API** at `md.kairos.trade` —
    it has higher budgets, ETag caching, and a binary candle format.

    ## Rate limits

    Rate limits use a sliding window keyed on the session user, the API key,
    or, for anonymous callers, the client IP. Anonymous callers get a smaller
    budget than the documented one: half of it by default, or a fixed
    anonymous budget where an operation states one. Routes belong to
    a named **bucket** (`x-kairos-bucket`) whose per-minute budget is shared
    by every route in it; routes with no bucket run under the service default
    of 100/minute. `x-kairos-rate-limit` states the bucket's compile-time
    default — operators can raise or lower a bucket at runtime, so treat the
    documented number as the baseline, not a contract. 429 responses carry
    `Retry-After` and `X-RateLimit-*`.

    ## Conventions

    - Prices are on the **0–100 cents scale** unless a field says otherwise
      (trader-analytics position/trade prices use the 0–1 scale; each field's
      description states its scale).
    - Errors: `{"detail": "<message>"}` for handler errors; FastAPI's
      standard validation envelope for 422s. Errors surfaced from a venue
      adapter instead use `{"error", "provider", "operation", "message"}` —
      see `DataProviderError`. Unhandled failures always return the generic
      500 body; internal details are logged, never returned.
    - Every request body is capped at 8 MiB service-wide (413).
  contact:
    name: Kairos
    url: https://docs.kairos.trade/api-reference
  termsOfService: https://kairos.trade/terms
servers:
  - url: https://data.kairos.trade
    description: Production
  - url: https://staging-data.kairos.trade
    description: Staging
security:
  - apiKeyClientId: []
    apiKeyKey: []
    apiKeySecret: []
paths:
  /market-links/coverage:
    get:
      tags:
        - Markets
      summary: Why each matcher pair is or is not an approved link
      description: >
        A diagnostic report over every recent cross-venue pair the market
        matcher asserts (tiers `exact`, `semantic` and `structural`, neither
        market expired, seen within 6 h of the matcher's newest pass). Edges are
        folded to unique unordered market pairs, and each pair is in exactly one
        bucket, so bucket counts sum to `totals.pairs`:


        - `linked_both` — both markets are legs of the same approved global
        link; `linked_other` — both are linked, in different links (a conflict);
        `linked_one` — one side is linked.

        - `structural:<code>` — the market-match linker's own verdict for the
        pair, from a dry run of its decision path (for example
        `orientation_unproven`, `start_mismatch`, `close_mismatch`,
        `schedule_unproven`, `venue_duplicate_lost`, `venue_duplicate_no_book`,
        `already_claimed`, `venue_already_seated`, `single_venue`,
        `kalshi_only`, `kalshi_*`, `unknown_provider`, `outside_linker_window`;
        `pending_mint` means the linker would link it on its next tick;
        `unmapped` is a linker verdict this report has no code for yet, its
        wording in `detail`).

        - `exact:<diagnostic>` / `semantic:<diagnostic>` — a metadata heuristic
        for what separates the two markets: `date_mismatch`,
        `numeric_line_mismatch`, `negation_mismatch`, `outcome_label_mismatch`,
        `same_fixture_candidate` (the venues' sports metadata names one game:
        likely promotable), or `other`.

        - `malformed` — an edge with an empty market id or pairing a market with
        itself.


        Each bucket carries counts by venue pair, by league/category and by
        reason, plus up to 40 sample pairs, highest matcher score first.
        Computed by a cron job every 10 minutes and served from Redis; 503 until
        the first cycle after a deploy.


        Cached with `Cache-Control: public, max-age=60, s-maxage=120`.
      operationId: getMarketLinkCoverage
      parameters:
        - name: bucket
          in: query
          description: Return only this bucket.
          schema:
            type: string
            maxLength: 96
          example: structural:orientation_unproven
        - name: samples
          in: query
          description: Include each bucket's sample pairs.
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: The current coverage report.
          headers:
            Cache-Control:
              schema:
                type: string
                example: public, max-age=60, s-maxage=120
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketLinkCoverageResponse'
        '404':
          description: The requested bucket is not in the current report.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataError'
        '422':
          $ref: '#/components/responses/DataValidationError'
        '429':
          $ref: '#/components/responses/DataRateLimited'
        '503':
          description: >-
            The report has not been computed yet, or the store could not be
            read.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataError'
      security: []
components:
  schemas:
    MarketLinkCoverageResponse:
      type: object
      required:
        - generatedAt
        - totals
        - buckets
      properties:
        version:
          type: integer
        generatedAt:
          type: string
          format: date-time
        window:
          type: object
          additionalProperties: true
        totals:
          type: object
          properties:
            edgesScanned:
              type: integer
            duplicatesFolded:
              type: integer
            pairs:
              type: integer
              description: Unique unordered market pairs; the bucket counts sum to this.
            markets:
              type: integer
            byTier:
              type: object
              additionalProperties:
                type: integer
            approvedLinks:
              type: integer
            linkerEdges:
              type: integer
            linkerGroups:
              type: integer
        buckets:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/MarketLinkCoverageBucket'
    DataError:
      type: object
      description: Handler error envelope (FastAPI HTTPException).
      required:
        - detail
      properties:
        detail:
          type: string
          description: Human-readable error message.
          example: Invalid provider
    MarketLinkCoverageBucket:
      type: object
      required:
        - count
      properties:
        count:
          type: integer
        byVenuePair:
          type: object
          additionalProperties:
            type: integer
          example:
            kalshi-polymarket: 120
        byCategory:
          type: object
          additionalProperties:
            type: integer
        byReason:
          type: object
          additionalProperties:
            type: integer
          description: Counts by `<tier>:<reason code>`.
        samples:
          type: array
          maxItems: 40
          items:
            $ref: '#/components/schemas/MarketLinkCoverageSample'
    MarketLinkCoverageSample:
      type: object
      properties:
        tier:
          type: string
          enum:
            - exact
            - semantic
            - structural
        method:
          type: string
        score:
          type: number
        reason:
          type: string
          description: >-
            The reason code; for a linked bucket, why the pair would not link on
            its own.
        detail:
          type: string
          description: The linker's own wording for a structural pair.
        linkIds:
          type: array
          items:
            type: string
        lastSeenAt:
          type: string
        a:
          $ref: '#/components/schemas/MarketLinkCoverageSide'
        b:
          $ref: '#/components/schemas/MarketLinkCoverageSide'
    MarketLinkCoverageSide:
      type: object
      properties:
        provider:
          type: string
          example: polymarket
        marketId:
          type: string
          description: The id the matcher pairs (the numeric Gamma id for Polymarket).
        title:
          type: string
        label:
          type: string
          description: The matcher's per-leg outcome label, when it has one.
        outcomeLabels:
          type: array
          items:
            type: string
          description: >-
            The venue's yes/no labels; empty when the market is not open or not
            binary.
        startTime:
          type: string
          format: date-time
          nullable: true
        startDate:
          type: string
          format: date
          nullable: true
        closeTime:
          type: string
          nullable: true
        eventId:
          type: string
        indexed:
          type: boolean
          description: Whether the market has an indexed row.
        open:
          type: boolean
          description: Whether the venue lists it as an open binary market.
  responses:
    DataValidationError:
      description: Request failed FastAPI parameter validation.
      content:
        application/json:
          schema:
            type: object
            required:
              - detail
            properties:
              detail:
                type: array
                description: >-
                  One entry per failed field, with location, message, and error
                  type.
                items:
                  type: object
                  additionalProperties: true
    DataRateLimited:
      description: >
        Rate limit exceeded for this route's sliding window, keyed on the
        session `sub` when

        authenticated and on the trusted client IP otherwise. Honor
        `Retry-After`. A per-API-key

        data ceiling (set per credential) rejects with `{"detail": "API key data
        rate limit

        exceeded"}` instead of the `error` envelope below.
      headers:
        Retry-After:
          schema:
            type: integer
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: 'Rate limit exceeded: 100 per 1 minute'
  securitySchemes:
    apiKeyClientId:
      type: apiKey
      in: header
      name: X-Client-Id
      description: >-
        Credential client id (`kairos_ck_...`). Must be sent together with
        X-Api-Key and X-Api-Secret.
    apiKeyKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: 64-char hex API key.
    apiKeySecret:
      type: apiKey
      in: header
      name: X-Api-Secret
      description: 64-char hex API secret.

````

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