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

# fetch_market_lineage

> Fetch one market plus its parent event and series in a single round-trip.

Fetch one market plus its parent event and series in a single round-trip.


## OpenAPI

````yaml openpx.openapi.yaml GET /v1/markets/fetch_market_lineage
openapi: 3.1.0
info:
  title: OpenPX Unified API
  description: >-
    Unified API surface across prediction-market exchanges. One `Exchange`
    trait, one set of models, one shape — implemented in Rust with
    auto-generated Python and TypeScript SDKs.


    This OpenAPI spec is **auto-generated** from
    `engine/core/src/exchange/traits.rs` and `schema/openpx.schema.json`. Edit
    the trait or the schema, then regenerate via `just openapi`. The spec models
    trait methods as REST operations for documentation rendering only — OpenPX
    is an in-process Rust library, not a REST service.
  version: 0.3.1
  license:
    name: MIT
servers:
  - url: https://github.com/openpx-trade/openpx
    description: >-
      Documentation surface only. OpenPX is an in-process Rust library; there is
      no hosted REST endpoint.
security: []
tags:
  - name: Markets
  - name: Orders
  - name: Positions
  - name: Balance
  - name: Orderbook
  - name: Trades
  - name: Fills
  - name: Server
paths:
  /v1/markets/fetch_market_lineage:
    get:
      tags:
        - Markets
      summary: Fetch market lineage
      description: >-
        Fetch one market plus its parent event and series in a single
        round-trip.
      operationId: fetch_market_lineage
      parameters:
        - name: market_ticker
          in: query
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketLineage'
        default:
          description: Unified error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenPxError'
components:
  schemas:
    MarketLineage:
      description: A market plus its parent event and series.
      properties:
        event:
          anyOf:
            - $ref: '#/components/schemas/Event'
            - type: 'null'
          description: >-
            Parent event; `null` if the market is standalone or the parent is
            missing upstream.
        market:
          allOf:
            - $ref: '#/components/schemas/Market'
          description: The market itself.
        series:
          anyOf:
            - $ref: '#/components/schemas/Series'
            - type: 'null'
          description: >-
            Parent series; `null` if the event is standalone or the parent is
            missing upstream.
      required:
        - market
      title: MarketLineage
      type: object
    OpenPxError:
      type: object
      description: >-
        Unified error type returned when an exchange call fails. The `kind`
        field is the canonical category; `message` carries the upstream
        explanation. Per-exchange variants are mapped into this shape before
        they cross the trait boundary.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - Authentication
            - InsufficientFunds
            - MarketNotFound
            - OrderNotFound
            - RateLimited
            - NetworkError
            - Api
            - Config
            - NotSupported
        message:
          type: string
    Event:
      description: >-
        A grouping of related markets — one Kalshi event_ticker or one
        Polymarket event slug.
      properties:
        category:
          description: Topical category (e.g. `"Politics"`); `null` when upstream omits it.
          type:
            - string
            - 'null'
        description:
          description: Long-form event description; `null` when upstream omits it.
          type:
            - string
            - 'null'
        end_ts:
          description: Event end time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        last_updated_ts:
          description: Last upstream update time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        market_tickers:
          default: []
          description: Tickers of markets under this event (e.g. `["KXBTCD-25APR1517"]`).
          items:
            type: string
          type: array
        mutually_exclusive:
          description: '`true` if exactly one child market resolves YES.'
          type:
            - boolean
            - 'null'
        numeric_id:
          description: Polymarket numeric event id (e.g. `"12585"`); `null` on Kalshi.
          type:
            - string
            - 'null'
        open_interest:
          description: Open interest in USD (e.g. `5000.0`).
          format: double
          type:
            - number
            - 'null'
        series_ticker:
          description: >-
            Parent series ticker (e.g. `"KXPRES"`); `null` when the event has no
            parent series.
          type:
            - string
            - 'null'
        start_ts:
          description: Event start time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        status:
          description: >-
            Upstream lifecycle string (e.g. `"open"`); `null` when upstream
            omits it.
          type:
            - string
            - 'null'
        ticker:
          description: >-
            Native event identifier — Kalshi event ticker or Polymarket event
            slug (e.g. `"KXPRES-2028"`).
          type: string
        title:
          description: Human-readable event title (e.g. `"2028 US Presidential Election"`).
          type: string
        volume:
          description: Lifetime trading volume in USD (e.g. `12345.67`).
          format: double
          type:
            - number
            - 'null'
      required:
        - ticker
        - title
      type: object
    Market:
      description: >-
        A prediction market on the unified surface. Prices are YES probabilities
        in `[0, 1]`.
      properties:
        best_ask:
          description: Best ask as YES probability in `[0, 1]` (e.g. `0.63`).
          format: double
          type:
            - number
            - 'null'
        best_bid:
          description: Best bid as YES probability in `[0, 1]` (e.g. `0.61`).
          format: double
          type:
            - number
            - 'null'
        close_time:
          description: Market close time in UTC (e.g. `"2026-04-25T20:00:00Z"`).
          format: date-time
          type:
            - string
            - 'null'
        condition_id:
          description: Polymarket CTF condition id (e.g. `"0xabc..."`); `null` on Kalshi.
          type:
            - string
            - 'null'
        created_at:
          description: Market creation time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        event_ticker:
          description: >-
            Parent event ticker — Kalshi event_ticker or Polymarket event slug
            (e.g. `"KXBTC-25MAR14"`).
          type:
            - string
            - 'null'
        exchange:
          description: 'Source exchange. Options: `kalshi`, `polymarket`.'
          type: string
        last_trade_price:
          description: Last trade price as YES probability in `[0, 1]` (e.g. `0.62`).
          format: double
          type:
            - number
            - 'null'
        market_type:
          allOf:
            - $ref: '#/components/schemas/MarketType'
          description: 'Outcome shape. Options: `binary`, `categorical`, `scalar`.'
        min_order_size:
          description: Minimum order size in contracts (e.g. `1.0`).
          format: double
          type:
            - number
            - 'null'
        neg_risk:
          description: Polymarket neg-risk flag; `null` on Kalshi.
          type:
            - boolean
            - 'null'
        neg_risk_market_id:
          description: Polymarket neg-risk market id; `null` on Kalshi.
          type:
            - string
            - 'null'
        numeric_id:
          description: >-
            Polymarket numeric DB id used for REST deep-links (e.g.
            `"1031769"`); `null` on Kalshi.
          type:
            - string
            - 'null'
        open_time:
          description: Market open time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        openpx_id:
          description: >-
            OpenPX primary key in `<exchange>:<ticker>` form (e.g.
            `"kalshi:KXBTCD-25APR1517"`).
          type: string
        outcomes:
          default: []
          description: >-
            Ordered outcomes; binary markets have two (`"Yes"`, `"No"`),
            categorical have N.
          items:
            $ref: '#/components/schemas/Outcome'
          type: array
        result:
          description: >-
            Winning outcome label after settlement (e.g. `"Yes"`); `null` until
            resolved.
          type:
            - string
            - 'null'
        rules:
          description: Resolution rules in plain text; `null` when upstream omits them.
          type:
            - string
            - 'null'
        settlement_time:
          description: Settlement time in UTC; `null` until the market resolves on-chain.
          format: date-time
          type:
            - string
            - 'null'
        status:
          allOf:
            - $ref: '#/components/schemas/MarketStatus'
          description: 'Lifecycle state. Options: `active`, `closed`, `resolved`.'
        tick_size:
          description: Minimum price increment in dollars (e.g. `0.01`).
          format: double
          type:
            - number
            - 'null'
        ticker:
          description: >-
            Native ticker — Kalshi market ticker or Polymarket slug (e.g.
            `"KXBTCD-25APR1517"`).
          type: string
        title:
          description: >-
            Human-readable market title (e.g. `"Will BTC close above $100k on
            Apr 15?"`).
          type: string
        volume:
          description: Lifetime trading volume in USD (e.g. `12345.67`).
          format: double
          type: number
        volume_24h:
          description: 24-hour trading volume in USD; `null` when upstream omits it.
          format: double
          type:
            - number
            - 'null'
      required:
        - exchange
        - market_type
        - openpx_id
        - status
        - ticker
        - title
        - volume
      type: object
    Series:
      description: >-
        A recurring family of events (e.g. a weekly inflation reading or sports
        season).
      properties:
        category:
          description: Topical category (e.g. `"Politics"`); `null` when upstream omits it.
          type:
            - string
            - 'null'
        fee_type:
          description: Fee schedule label (e.g. `"flat"`); `null` when upstream omits it.
          type:
            - string
            - 'null'
        frequency:
          description: Cadence string (e.g. `"weekly"`); `null` when upstream omits it.
          type:
            - string
            - 'null'
        last_updated_ts:
          description: Last upstream update time in UTC.
          format: date-time
          type:
            - string
            - 'null'
        numeric_id:
          description: Polymarket numeric series id (e.g. `"10345"`); `null` on Kalshi.
          type:
            - string
            - 'null'
        settlement_sources:
          default: []
          description: >-
            Resolution sources used by the exchange (e.g. `[{"name": "BLS",
            "url": "..."}]`).
          items:
            $ref: '#/components/schemas/SettlementSource'
          type: array
        tags:
          default: []
          description: Free-form tags (e.g. `["macro", "fed"]`).
          items:
            type: string
          type: array
        ticker:
          description: >-
            Native series identifier — Kalshi series ticker or Polymarket series
            ticker/slug (e.g. `"KXPRES"`).
          type: string
        title:
          description: Human-readable series title (e.g. `"US Presidential Election"`).
          type: string
        volume:
          description: Lifetime trading volume in USD across the series (e.g. `123456.78`).
          format: double
          type:
            - number
            - 'null'
      required:
        - ticker
        - title
      type: object
    MarketType:
      description: >-
        Shape of a market's outcomes. Options: `binary`, `categorical`,
        `scalar`.
      enum:
        - binary
        - categorical
        - scalar
      type: string
    Outcome:
      description: One outcome of a prediction market.
      properties:
        label:
          description: Outcome label (e.g. `"Yes"`, `"No"`, or a categorical option name).
          type: string
        price:
          description: >-
            Current price as YES probability in `[0, 1]` (e.g. `0.62`); `null`
            when not yet quoted.
          format: double
          type:
            - number
            - 'null'
        token_id:
          description: >-
            Polymarket CTF token id used for per-outcome orderbook
            subscriptions; `null` on Kalshi.
          type:
            - string
            - 'null'
      required:
        - label
      type: object
    MarketStatus:
      description: 'Market lifecycle state. Options: `active`, `closed`, `resolved`.'
      enum:
        - active
        - closed
        - resolved
      type: string
    SettlementSource:
      description: Reference used by the exchange to settle a series.
      properties:
        name:
          description: Display name of the source (e.g. `"Bureau of Labor Statistics"`).
          type:
            - string
            - 'null'
        url:
          description: Source URL (e.g. `"https://www.bls.gov/cpi/"`).
          type:
            - string
            - 'null'
      type: object

````