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

# Preview contract selection

> Preview what a contract selection config would select for a given symbol. Used by the Settings tab to show traders what their config selects.



## OpenAPI

````yaml /api/openapi.json post /api/options/v1/contracts/preview
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/options/v1/contracts/preview:
    post:
      tags:
        - Options
      summary: Preview contract selection
      description: >-
        Preview what a contract selection config would select for a given
        symbol. Used by the Settings tab to show traders what their config
        selects.
      operationId: preview_contract_selection_api_options_v1_contracts_preview_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractPreviewRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/app__services__contract_recommender__ContractRecommendationResponse
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ContractPreviewRequest:
      properties:
        symbol:
          type: string
          maxLength: 10
          minLength: 1
          pattern: ^[A-Za-z0-9.]+$
          title: Symbol
        config:
          $ref: '#/components/schemas/RuleBasedContractConfig'
      type: object
      required:
        - symbol
      title: ContractPreviewRequest
      description: Preview what a contract selection config would select for a symbol.
    app__services__contract_recommender__ContractRecommendationResponse:
      properties:
        symbol:
          type: string
          title: Symbol
        direction:
          type: string
          title: Direction
        criteria:
          additionalProperties: true
          type: object
          title: Criteria
        primary_recommendation:
          anyOf:
            - $ref: '#/components/schemas/ContractRecommendation'
            - type: 'null'
        alternatives:
          items:
            $ref: '#/components/schemas/ContractRecommendation'
          type: array
          title: Alternatives
        no_suitable_contracts_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: No Suitable Contracts Reason
      type: object
      required:
        - symbol
        - direction
        - criteria
        - primary_recommendation
      title: ContractRecommendationResponse
      description: Response containing contract recommendations.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RuleBasedContractConfig:
      properties:
        mode:
          type: string
          const: rule_based
          title: Mode
          default: rule_based
        direction:
          type: string
          enum:
            - bullish
            - bearish
            - auto
          title: Direction
          description: Trade direction. 'auto' infers from entry signal action.
          default: auto
        target_delta:
          type: number
          maximum: 0.95
          minimum: 0.05
          title: Target Delta
          default: 0.3
        delta_tolerance:
          type: number
          maximum: 0.3
          minimum: 0.01
          title: Delta Tolerance
          default: 0.1
        dte_min:
          type: integer
          maximum: 730
          minimum: 0
          title: Dte Min
          default: 7
        dte_max:
          type: integer
          maximum: 730
          minimum: 1
          title: Dte Max
          default: 45
        option_type:
          type: string
          enum:
            - call
            - put
            - auto
          title: Option Type
          description: Contract type. 'auto' derives from resolved direction.
          default: auto
        min_open_interest:
          type: integer
          minimum: 0
          title: Min Open Interest
          default: 10
        max_spread_pct:
          type: number
          maximum: 0.5
          minimum: 0.01
          title: Max Spread Pct
          default: 0.1
        prefer_weekly:
          type: boolean
          title: Prefer Weekly
          default: false
      type: object
      title: RuleBasedContractConfig
      description: |-
        Rule-based options contract selection.

        Maps directly to ContractCriteria in contract_recommender.py
        via contract_selection_bridge.config_to_criteria().
    ContractRecommendation:
      properties:
        symbol:
          type: string
          title: Symbol
        contract_symbol:
          type: string
          title: Contract Symbol
        option_type:
          type: string
          title: Option Type
          description: '''call'' or ''put'''
        strike:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Strike
        expiration:
          type: string
          format: date
          title: Expiration
        dte:
          type: integer
          title: Dte
        delta:
          type: number
          title: Delta
        gamma:
          type: number
          title: Gamma
        theta:
          type: number
          title: Theta
        vega:
          type: number
          title: Vega
        rho:
          anyOf:
            - type: number
            - type: 'null'
          title: Rho
        iv:
          type: number
          title: Iv
        bid:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Bid
        ask:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Ask
        mid:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Mid
        spread_pct:
          type: number
          title: Spread Pct
        open_interest:
          anyOf:
            - type: integer
            - type: 'null'
          title: Open Interest
        volume:
          type: integer
          title: Volume
        liquidity_score:
          $ref: '#/components/schemas/LiquidityScore'
        score:
          type: number
          maximum: 100
          minimum: 0
          title: Score
          description: Overall recommendation score 0-100
        selection_rationale:
          type: string
          title: Selection Rationale
        warnings:
          items:
            type: string
          type: array
          title: Warnings
      type: object
      required:
        - symbol
        - contract_symbol
        - option_type
        - strike
        - expiration
        - dte
        - delta
        - gamma
        - theta
        - vega
        - iv
        - bid
        - ask
        - mid
        - spread_pct
        - volume
        - liquidity_score
        - score
        - selection_rationale
      title: ContractRecommendation
      description: Recommended options contract with full details.
    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
    LiquidityScore:
      type: string
      enum:
        - excellent
        - good
        - acceptable
        - poor
      title: LiquidityScore
      description: >-
        Liquidity quality classification (currently spread + volume based).


        Note: OI is now available from MSE's Trading API collector but the soft
        scoring

        in `_calculate_liquidity_score` has not yet been upgraded to use it. The
        SQL hard

        gates DO use OI (see #339).

````