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

# Compute and ingest Reg SHO SSR restrictions from price

> Run `ssr_ingest.compute_ssr` over the requested (or self-healed
default) date window and insert restricted `(symbol, date)` rows into
`reg_sho_ssr_list`.

Runs synchronously (unlike most `/api/internal/` collectors, which
return 202 and background the work): the daily-timer call is a single
trailing week (or less, once the watermark is current), full-universe
aggregate, which completes well within normal HTTP timeouts. A
multi-year backfill call (explicit `start_date`/`end_date`) is expected
to be run manually/out-of-band and may take longer; there is no separate
status-poll seam for THIS endpoint -- use `GET /status` to confirm the
result afterward.

Self-heal (Fix E): when the caller supplies NEITHER `start_date` nor
`end_date` (the daily-timer call), `start` is derived from
`reg_sho_ssr_ingest_watermark` instead of a fixed trailing week -- the
day after the last completed run's `processed_through`, or the usual
`_DEFAULT_TRAILING_DAYS` fallback if no watermark exists yet. This is
capped at `_MAX_SELF_HEAL_SPAN_DAYS`: a gap wider than that is clamped
(with a warning logged) rather than silently backfilling months of
history inline -- a longer gap needs an explicit, operator-triggered
backfill call instead. If the watermark is already current (`start >
end`), this is a no-op -- `compute_ssr` is not called and
`rows_inserted=0` is returned.



## OpenAPI

````yaml /api/openapi.json post /api/internal/ssr/compute
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/internal/ssr/compute:
    post:
      tags:
        - ssr
      summary: Compute and ingest Reg SHO SSR restrictions from price
      description: |-
        Run `ssr_ingest.compute_ssr` over the requested (or self-healed
        default) date window and insert restricted `(symbol, date)` rows into
        `reg_sho_ssr_list`.

        Runs synchronously (unlike most `/api/internal/` collectors, which
        return 202 and background the work): the daily-timer call is a single
        trailing week (or less, once the watermark is current), full-universe
        aggregate, which completes well within normal HTTP timeouts. A
        multi-year backfill call (explicit `start_date`/`end_date`) is expected
        to be run manually/out-of-band and may take longer; there is no separate
        status-poll seam for THIS endpoint -- use `GET /status` to confirm the
        result afterward.

        Self-heal (Fix E): when the caller supplies NEITHER `start_date` nor
        `end_date` (the daily-timer call), `start` is derived from
        `reg_sho_ssr_ingest_watermark` instead of a fixed trailing week -- the
        day after the last completed run's `processed_through`, or the usual
        `_DEFAULT_TRAILING_DAYS` fallback if no watermark exists yet. This is
        capped at `_MAX_SELF_HEAL_SPAN_DAYS`: a gap wider than that is clamped
        (with a warning logged) rather than silently backfilling months of
        history inline -- a longer gap needs an explicit, operator-triggered
        backfill call instead. If the watermark is already current (`start >
        end`), this is a no-op -- `compute_ssr` is not called and
        `rows_inserted=0` is returned.
      operationId: trigger_ssr_compute_api_internal_ssr_compute_post
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/SsrComputeRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SsrComputeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SsrComputeRequest:
      properties:
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
          description: Inclusive start date.
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
          description: Inclusive end date.
      type: object
      title: SsrComputeRequest
      description: |-
        Request body for `POST /api/internal/ssr/compute`.

        If the caller supplies at least one of `start_date`/`end_date`, the
        other field left `None` defaults independently to
        `most_recent_trading_day - 7d` / `most_recent_trading_day` respectively.

        When BOTH are `None` (the daily-timer call, and the common case) the
        endpoint instead self-heals from `reg_sho_ssr_ingest_watermark`: it
        resumes the day after the last successfully completed `compute_ssr`
        run's `processed_through` watermark, falling back to the same 7-day
        trailing window only if no watermark exists yet. This means a skipped
        run (deploy window, outage) gets picked back up automatically on the
        next daily call instead of silently leaving a hole beyond 7 days -- see
        `trigger_ssr_compute`.
    SsrComputeResponse:
      properties:
        rows_inserted:
          type: integer
          title: Rows Inserted
        start:
          type: string
          format: date
          title: Start
        end:
          type: string
          format: date
          title: End
      type: object
      required:
        - rows_inserted
        - start
        - end
      title: SsrComputeResponse
      description: Response from `POST /api/internal/ssr/compute`.
    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

````