> ## 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 multi-scale diffusion over the cached topology

> Compute peer-relative divergence scores for the supplied return vector.

This endpoint is synchronous (runs in FastAPI's thread pool) because the
Chebyshev diffusion is CPU-bound and must not block the async event loop.

Returns 503 if the feature is disabled or the topology is not yet loaded.
Returns 400 if the request schema_version is unsupported.



## OpenAPI

````yaml /api/openapi.json post /api/internal/graph-diffusion/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/graph-diffusion/compute:
    post:
      tags:
        - Internal
      summary: Run multi-scale diffusion over the cached topology
      description: >-
        Compute peer-relative divergence scores for the supplied return vector.


        This endpoint is synchronous (runs in FastAPI's thread pool) because the

        Chebyshev diffusion is CPU-bound and must not block the async event
        loop.


        Returns 503 if the feature is disabled or the topology is not yet
        loaded.

        Returns 400 if the request schema_version is unsupported.
      operationId: compute_diffusion_api_internal_graph_diffusion_compute_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/app__services__graph_diffusion__models__ComputeRequest
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    app__services__graph_diffusion__models__ComputeRequest:
      properties:
        returns:
          additionalProperties:
            type: number
          type: object
          maxProperties: 25000
          title: Returns
          description: >-
            Map of symbol → return value (e.g. 1-day return) used as the input
            signal.
        schema_version:
          type: integer
          minimum: 1
          title: Schema Version
          description: Schema version for forward compatibility.
          default: 1
      type: object
      required:
        - returns
      title: ComputeRequest
      description: Request body for POST /diffusion/compute.
    ComputeResponse:
      properties:
        schema_version:
          type: integer
          minimum: 1
          title: Schema Version
          description: Schema version of this response.
        computed_at:
          type: string
          title: Computed At
          description: ISO-8601 UTC timestamp when computation completed.
        topology_built_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Topology Built At
          description: ISO-8601 UTC timestamp when the current topology was last built.
        symbols_computed:
          type: integer
          minimum: 0
          title: Symbols Computed
          description: Number of symbols with a computed score.
        symbols_skipped:
          type: integer
          minimum: 0
          title: Symbols Skipped
          description: Number of symbols skipped (e.g. missing returns).
        scores:
          items:
            $ref: '#/components/schemas/DiffusionScore'
          type: array
          title: Scores
          description: Diffusion scores for all computed symbols.
      type: object
      required:
        - schema_version
        - computed_at
        - symbols_computed
        - symbols_skipped
        - scores
      title: ComputeResponse
      description: Response body for POST /diffusion/compute.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DiffusionScore:
      properties:
        symbol:
          type: string
          title: Symbol
          description: Ticker symbol.
        local:
          anyOf:
            - type: number
              maximum: 100
              minimum: -100
            - type: 'null'
          title: Local
          description: Diffusion score from the local (sector) tier.
        medium:
          anyOf:
            - type: number
              maximum: 100
              minimum: -100
            - type: 'null'
          title: Medium
          description: Diffusion score from the medium (cross-sector) tier.
        broad:
          anyOf:
            - type: number
              maximum: 100
              minimum: -100
            - type: 'null'
          title: Broad
          description: Diffusion score from the broad (market-wide) tier.
        composite:
          anyOf:
            - type: number
              maximum: 100
              minimum: -100
            - type: 'null'
          title: Composite
          description: Weighted composite of local/medium/broad scores.
        signal:
          type: string
          title: Signal
          description: Signal classification string (see SignalClassification enum).
        peers_local:
          type: integer
          minimum: 0
          title: Peers Local
          description: Number of peers contributing to the local score.
        peers_medium:
          type: integer
          minimum: 0
          title: Peers Medium
          description: Number of peers contributing to the medium score.
        peers_broad:
          type: integer
          minimum: 0
          title: Peers Broad
          description: Number of peers contributing to the broad score.
        weight_config:
          type: string
          title: Weight Config
          description: Active weight configuration (see WeightConfig enum).
        contaminated:
          type: boolean
          title: Contaminated
          description: >-
            True if the symbol's own return influenced peer averages
            (self-contamination).
          default: false
      type: object
      required:
        - symbol
        - signal
        - peers_local
        - peers_medium
        - peers_broad
        - weight_config
      title: DiffusionScore
      description: Peer-diffused score for a single symbol.
    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

````