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

# Scenario Stats Endpoint

> §10 statistics for one template, partitioned by playbook_version.

THIS ENDPOINT IS THE ONLY PLACE AN EXPECTANCY OR HIT RATE MAY COME FROM (§6.2).
Narration cites it or says nothing — the falsified-textbook-alpha rule.

Below the display floor the ``stats`` block is ``null`` and ``stats_unavailable``
carries a structural reason plus the counts, so a caller renders "not enough data
yet (4 of 30)" instead of a point estimate. There is no code path that returns a
zero or a default in place of a statistic.



## OpenAPI

````yaml /api/openapi.json get /api/graph/v1/pattern-events/scenarios/stats
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/pattern-events/scenarios/stats:
    get:
      tags:
        - pattern-events
      summary: Scenario Stats Endpoint
      description: >-
        §10 statistics for one template, partitioned by playbook_version.


        THIS ENDPOINT IS THE ONLY PLACE AN EXPECTANCY OR HIT RATE MAY COME FROM
        (§6.2).

        Narration cites it or says nothing — the falsified-textbook-alpha rule.


        Below the display floor the ``stats`` block is ``null`` and
        ``stats_unavailable``

        carries a structural reason plus the counts, so a caller renders "not
        enough data

        yet (4 of 30)" instead of a point estimate. There is no code path that
        returns a

        zero or a default in place of a statistic.
      operationId: scenario_stats_endpoint_api_graph_v1_pattern_events_scenarios_stats_get
      parameters:
        - name: template_id
          in: query
          required: true
          schema:
            type: string
            title: Template Id
        - name: symbol
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Symbol
        - name: grain
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Grain
        - name: terrain_rung
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Terrain Rung
        - name: window_days
          in: query
          required: false
          schema:
            type: integer
            maximum: 1825
            minimum: 1
            default: 120
            title: Window Days
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Scenario Stats Endpoint Api Graph V1 Pattern Events
                  Scenarios Stats Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    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

````