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

# Run Discovery Batch

> Expand → prereg (full set, BEFORE screen) → screen → (optionally) dispatch.

Returns the batch identity + counts + the {content_hash: run_id} map of dispatched
research backtests. The candidate set is preregistered atomically before the screen
(anti-p-hacking, §6.7); dispatch only enqueues — poll GET /batch/{id} for progress.



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/discovery/batch
openapi: 3.1.0
info:
  title: Sequency Graph API
  description: >

    # Sequency Graph-Native Trading API


    Graph-native API for trading intelligence, built on FalkorDB.


    ## Features


    - **Screener**: Filter stocks using graph-native queries with relationship
    expansion

    - **Stock Detail**: Complete stock context with all relationships

    - **Confluence Scoring**: Setup quality assessment with weighted components

    - **Strategy Matching**: Find matching options strategies via graph
    traversal

    - **Market Context**: Current market-wide context for trading decisions


    ## Data Sources


    All data is sourced from the FalkorDB knowledge graph, populated by:

    - Pattern detector (Go) - Technical indicators, patterns

    - Graph sync service - Levels, volume profiles, news, day classification
  version: 1.0.0
servers: []
security: []
paths:
  /api/graph/v1/discovery/batch:
    post:
      tags:
        - discovery
      summary: Run Discovery Batch
      description: >-
        Expand → prereg (full set, BEFORE screen) → screen → (optionally)
        dispatch.


        Returns the batch identity + counts + the {content_hash: run_id} map of
        dispatched

        research backtests. The candidate set is preregistered atomically before
        the screen

        (anti-p-hacking, §6.7); dispatch only enqueues — poll GET /batch/{id}
        for progress.
      operationId: run_discovery_batch_api_graph_v1_discovery_batch_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunBatchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RunBatchRequest:
      properties:
        form:
          $ref: '#/components/schemas/HypothesisForm'
        date_from:
          type: string
          format: date
          title: Date From
        date_to:
          type: string
          format: date
          title: Date To
        initial_capital:
          type: number
          exclusiveMinimum: 0
          title: Initial Capital
          default: 100000
        timeframe:
          type: string
          enum:
            - daily
            - intraday
          title: Timeframe
          default: daily
        dispatch:
          type: boolean
          title: Dispatch
          default: true
        candidate_budget:
          anyOf:
            - type: integer
              maximum: 2048
              minimum: 1
            - type: 'null'
          title: Candidate Budget
        survivor_budget:
          anyOf:
            - type: integer
              maximum: 256
              minimum: 1
            - type: 'null'
          title: Survivor Budget
        thresholds:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Thresholds
        deployment_aum:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: 'null'
          title: Deployment Aum
        score_set_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Score Set Id
        label_definition:
          anyOf:
            - $ref: '#/components/schemas/LabelDefinitionV1'
            - type: 'null'
        universe_definition:
          anyOf:
            - $ref: '#/components/schemas/UniverseDefinitionV1'
            - type: 'null'
        prior_trial_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Prior Trial Id
      type: object
      required:
        - form
        - date_from
        - date_to
      title: RunBatchRequest
      description: >-
        Run a discovery batch from a HypothesisForm over an explicit backtest
        window.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HypothesisForm:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        selection_kind:
          type: string
          enum:
            - single_name
            - single_instrument
            - cross_sectional_basket
          title: Selection Kind
        instrument:
          type: string
          enum:
            - equity
            - single_leg_option
          title: Instrument
          default: equity
        template:
          additionalProperties: true
          type: object
          title: Template
        search_space:
          additionalProperties: true
          type: object
          title: Search Space
        provenance:
          type: string
          enum:
            - template
            - operator
            - llm
          title: Provenance
          default: operator
        prior_trials_count:
          type: integer
          minimum: 0
          title: Prior Trials Count
          default: 0
      type: object
      required:
        - name
        - selection_kind
      title: HypothesisForm
      description: >-
        A structured discovery spec: template + search space + provenance
        (§5.1).
    LabelDefinitionV1:
      properties:
        schema_version:
          type: string
          const: label-definition-v1
          title: Schema Version
          default: label-definition-v1
        observation:
          type: string
          const: exact_prior_exchange_session
          title: Observation
          default: exact_prior_exchange_session
        availability:
          type: string
          const: next_exchange_session_open
          title: Availability
          default: next_exchange_session_open
        execution_price:
          type: string
          const: daily_open
          title: Execution Price
          default: daily_open
        exit_price:
          type: string
          const: daily_close
          title: Exit Price
          default: daily_close
        horizon:
          type: string
          const: next_open_to_close
          title: Horizon
          default: next_open_to_close
        exchange_calendar:
          type: string
          const: credibility_calendar_v1
          title: Exchange Calendar
          default: credibility_calendar_v1
        benchmark_symbol:
          type: string
          maxLength: 16
          minLength: 1
          title: Benchmark Symbol
          default: SPY
        costs_at:
          type: string
          const: rebalance_before_session_return
          title: Costs At
          default: rebalance_before_session_return
      additionalProperties: false
      type: object
      title: LabelDefinitionV1
      description: The selected D+1 label and exchange-calendar convention.
    UniverseDefinitionV1:
      properties:
        schema_version:
          type: string
          const: universe-v1
          title: Schema Version
          default: universe-v1
        membership_mode:
          type: string
          enum:
            - point_in_time
            - current_static
          title: Membership Mode
        source:
          type: string
          maxLength: 128
          minLength: 1
          title: Source
        version:
          type: string
          maxLength: 128
          minLength: 1
          title: Version
        observation_cutoff:
          type: string
          maxLength: 128
          minLength: 1
          title: Observation Cutoff
        liquidity_metric:
          type: string
          maxLength: 128
          minLength: 1
          title: Liquidity Metric
        liquidity_window_sessions:
          type: integer
          maximum: 504
          minimum: 1
          title: Liquidity Window Sessions
        rebalance_cadence:
          type: string
          enum:
            - daily
            - weekly
            - monthly
          title: Rebalance Cadence
        'n':
          type: integer
          maximum: 10000
          minimum: 1
          title: 'N'
        symbol_normalization_version:
          type: string
          const: uppercase-ascii-v1
          title: Symbol Normalization Version
          default: uppercase-ascii-v1
        current_universe_biased:
          type: boolean
          title: Current Universe Biased
      additionalProperties: false
      type: object
      required:
        - membership_mode
        - source
        - version
        - observation_cutoff
        - liquidity_metric
        - liquidity_window_sessions
        - rebalance_cadence
        - 'n'
        - current_universe_biased
      title: UniverseDefinitionV1
      description: >-
        Frozen membership policy, separate from its materialized membership
        rows.
    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

````