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

# Resolve Trade Context



## OpenAPI

````yaml /api/openapi.json get /api/graph/v1/trade-contexts/{context_id}
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/trade-contexts/{context_id}:
    get:
      tags:
        - Trade Context
      summary: Resolve Trade Context
      operationId: resolve_trade_context_api_graph_v1_trade_contexts__context_id__get
      parameters:
        - name: context_id
          in: path
          required: true
          schema:
            type: string
            title: Context Id
        - name: contract_version
          in: query
          required: false
          schema:
            type: string
            default: '1'
            title: Contract Version
        - name: context_revision
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            title: Context Revision
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeContextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TradeContextResponse:
      properties:
        contract_version:
          type: string
          const: trade-context-v1
          title: Contract Version
        context_id:
          type: string
          title: Context Id
        revision:
          type: integer
          minimum: 1
          title: Revision
        execution_effect:
          type: string
          const: none
          title: Execution Effect
        event_ref:
          $ref: '#/components/schemas/EventRef'
        setup:
          $ref: '#/components/schemas/TradeContextSetup'
        lens_ref:
          anyOf:
            - $ref: '#/components/schemas/ExactRef'
            - type: 'null'
        chart:
          $ref: '#/components/schemas/TradeContextChart'
        captured_at:
          type: string
          format: date-time
          title: Captured At
        provenance:
          $ref: '#/components/schemas/TradeContextProvenance'
        content_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Content Hash
        revision_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Revision Hash
        previous_hash:
          anyOf:
            - type: string
              pattern: ^[0-9a-f]{64}$
            - type: 'null'
          title: Previous Hash
        replayed:
          type: boolean
          title: Replayed
      additionalProperties: false
      type: object
      required:
        - contract_version
        - context_id
        - revision
        - execution_effect
        - event_ref
        - setup
        - chart
        - captured_at
        - provenance
        - content_hash
        - revision_hash
        - replayed
      title: TradeContextResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EventRef:
      properties:
        id:
          type: string
          pattern: ^[0-9a-f]{16}$
          title: Id
        revision:
          type: integer
          minimum: 1
          title: Revision
      additionalProperties: false
      type: object
      required:
        - id
        - revision
      title: EventRef
    TradeContextSetup:
      properties:
        pattern_id:
          type: string
          title: Pattern Id
        pattern_version:
          type: integer
          minimum: 1
          title: Pattern Version
        family:
          type: string
          title: Family
        direction:
          type: integer
          title: Direction
        grain:
          type: string
          title: Grain
      additionalProperties: false
      type: object
      required:
        - pattern_id
        - pattern_version
        - family
        - direction
        - grain
      title: TradeContextSetup
    ExactRef:
      properties:
        id:
          type: string
          maxLength: 200
          minLength: 1
          title: Id
        revision:
          type: integer
          minimum: 1
          title: Revision
      additionalProperties: false
      type: object
      required:
        - id
        - revision
      title: ExactRef
    TradeContextChart:
      properties:
        session_ref:
          $ref: '#/components/schemas/ChartSessionRef'
        symbol:
          type: string
          title: Symbol
        interval:
          type: string
          enum:
            - 1m
            - 2m
            - 5m
            - 15m
            - 1h
            - 1d
          title: Interval
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        visible_range:
          $ref: '#/components/schemas/app__routes__trade_contexts__TimeRange'
        selected_range:
          anyOf:
            - $ref: '#/components/schemas/app__routes__trade_contexts__TimeRange'
            - type: 'null'
        chart_type:
          type: string
          enum:
            - area
            - candle
            - candles
            - line
            - footprint
            - heikinashi
          title: Chart Type
        focused_event_ref:
          $ref: '#/components/schemas/EventRef'
      additionalProperties: false
      type: object
      required:
        - session_ref
        - symbol
        - interval
        - visible_range
        - chart_type
        - focused_event_ref
      title: TradeContextChart
    TradeContextProvenance:
      properties:
        event_registry:
          additionalProperties: true
          type: object
          title: Event Registry
        event_producer_time:
          type: string
          format: date-time
          title: Event Producer Time
        lifecycle_id:
          type: string
          title: Lifecycle Id
        source_contract:
          type: string
          const: event-linked-decision-lens-v1
          title: Source Contract
      additionalProperties: false
      type: object
      required:
        - event_registry
        - event_producer_time
        - lifecycle_id
        - source_contract
      title: TradeContextProvenance
    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
    ChartSessionRef:
      properties:
        id:
          type: string
          maxLength: 200
          minLength: 1
          title: Id
        revision:
          type: integer
          minimum: 1
          title: Revision
        revision_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          title: Revision Hash
      additionalProperties: false
      type: object
      required:
        - id
        - revision
        - revision_hash
      title: ChartSessionRef
    app__routes__trade_contexts__TimeRange:
      properties:
        from_time:
          type: integer
          minimum: 1
          title: From Time
        to_time:
          type: integer
          minimum: 1
          title: To Time
      additionalProperties: false
      type: object
      required:
        - from_time
        - to_time
      title: TimeRange

````