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

# Get current market context

> Get current market-wide context for informed trading decisions.

## Response Includes

### Day Classification
- **day_type**: trending, rotational, or uncertain
- **trend_score**: -1 to 1 (negative = bearish, positive = bullish)
- **rotation_score**: 0 to 1 (likelihood of mean reversion)
- **strategy_bias**: Suggested strategy category
- **size_modifier**: Position size adjustment (0.5-2.0)
- **signals**: Active signals for the day

### VIX Regime
Per SEQUENCY_TRADING_METROLOGY.md:
- **low_complacent**: VIX <= 14, declining trend → sizing -25%
- **normal**: VIX 14-20 → baseline sizing
- **elevated**: VIX 20-30 → sizing +15%
- **fear**: VIX > 30 or spike > 20% → trading paused

### Market Conditions
Active condition flags (e.g., LOW_VIX, CONTANGO, BULLISH_BREADTH)

### Favored Strategies
Strategy types that work well in current conditions.

## Performance Target

<50ms response time (uses cache when available).

## Data Source

Reads from MarketCondition vertex with name='CURRENT_MARKET'.



## OpenAPI

````yaml /api/openapi.json get /api/graph/v1/market/context
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/market/context:
    get:
      tags:
        - Market
      summary: Get current market context
      description: |-
        Get current market-wide context for informed trading decisions.

        ## Response Includes

        ### Day Classification
        - **day_type**: trending, rotational, or uncertain
        - **trend_score**: -1 to 1 (negative = bearish, positive = bullish)
        - **rotation_score**: 0 to 1 (likelihood of mean reversion)
        - **strategy_bias**: Suggested strategy category
        - **size_modifier**: Position size adjustment (0.5-2.0)
        - **signals**: Active signals for the day

        ### VIX Regime
        Per SEQUENCY_TRADING_METROLOGY.md:
        - **low_complacent**: VIX <= 14, declining trend → sizing -25%
        - **normal**: VIX 14-20 → baseline sizing
        - **elevated**: VIX 20-30 → sizing +15%
        - **fear**: VIX > 30 or spike > 20% → trading paused

        ### Market Conditions
        Active condition flags (e.g., LOW_VIX, CONTANGO, BULLISH_BREADTH)

        ### Favored Strategies
        Strategy types that work well in current conditions.

        ## Performance Target

        <50ms response time (uses cache when available).

        ## Data Source

        Reads from MarketCondition vertex with name='CURRENT_MARKET'.
      operationId: get_market_context_api_graph_v1_market_context_get
      responses:
        '200':
          description: Market context
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketContextResponse'
        '504':
          description: Query timeout
components:
  schemas:
    MarketContextResponse:
      properties:
        trade_date:
          type: string
          title: Trade Date
          description: Trading date in YYYY-MM-DD format
        is_market_open:
          type: boolean
          title: Is Market Open
          description: >-
            Whether the US stock market is currently open (holiday and
            early-close aware)
          default: false
        day_classification:
          $ref: '#/components/schemas/DayClassification'
        vix_regime:
          $ref: '#/components/schemas/VIXContext'
        market_conditions:
          items:
            type: string
          type: array
          title: Market Conditions
          description: Active market condition flags (e.g., 'LOW_VIX', 'BULLISH_BREADTH')
        favored_strategies:
          items:
            type: string
          type: array
          title: Favored Strategies
          description: Strategy types favored in current conditions
        regime_dominant_v5:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Dominant V5
          description: V5 regime dominant state (e.g., STRONG_TREND, ROTATIONAL)
        regime_v5:
          anyOf:
            - $ref: '#/components/schemas/RegimeV5'
            - type: 'null'
          description: Full V5 regime probability vector (6-state with confidence)
        regime_direction:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Direction
          description: 'Regime direction: BULL, SIDEWAYS, or BEAR'
        regime_volatility:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Volatility
          description: 'Regime volatility: HIGH or LOW'
        regime_label:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Label
          description: Human-readable regime label (e.g., 'Steady Uptrend')
        regime_episode_day:
          anyOf:
            - type: integer
            - type: 'null'
          title: Regime Episode Day
          description: Consecutive days in current regime
        regime_shock:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Regime Shock
          description: Whether a transient shock override is active
        regime_slope_pctile:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Slope Pctile
          description: 0-100 percentile of 50d OLS slope
        regime_vol_pctile:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Vol Pctile
          description: 0-100 percentile of 20d Parkinson vol
        regime_slope_raw:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Slope Raw
          description: Annualized % OLS slope
        regime_vol_raw:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Vol Raw
          description: Annualized % Parkinson vol
        regime_spy_perf:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Spy Perf
          description: SPY return (%) since regime start
        regime_qqq_perf:
          anyOf:
            - type: number
            - type: 'null'
          title: Regime Qqq Perf
          description: QQQ return (%) since regime start
      type: object
      required:
        - trade_date
        - day_classification
        - vix_regime
      title: MarketContextResponse
      description: |-
        Market-wide context for informed trading decisions.

        Combines data from:
        - DayClassification vertex (daily market type)
        - MarketCondition vertex (VIX, breadth, term structure)
        - Alpaca trading calendar (market hours / holiday awareness)
      example:
        day_classification:
          day_type: trending
          day_type_confidence: 70
          day_type_detail: trending
          rotation_score: 25
          signals:
            - narrow_cpr
            - narrow_ib
            - gap_and_go
          size_modifier: 1
          strategy_bias: breakout_continuation
          trend_score: 72
        favored_strategies:
          - MomentumBreakout
          - TrendFollowing
          - OpeningRangeBreakout
        is_market_open: true
        market_conditions:
          - LOW_VIX
          - CONTANGO
          - BULLISH_BREADTH
        trade_date: '2025-12-20'
        vix_regime:
          can_trade: true
          level: 16.5
          percentile: 35
          regime: normal
          size_adjustment: baseline
          sma_50: 18.2
          term_structure: contango
    DayClassification:
      properties:
        day_type:
          type: string
          enum:
            - trending
            - rotational
            - uncertain
          title: Day Type
          description: 'v3 day type: trending, rotational, or uncertain'
        day_type_detail:
          type: string
          enum:
            - strong_trend
            - trending
            - mixed
            - rotational
            - strong_rotational
          title: Day Type Detail
          description: >-
            5-point classification: strong_trend, trending, mixed, rotational,
            strong_rotational
          default: mixed
        day_type_confidence:
          type: integer
          maximum: 100
          minimum: 0
          title: Day Type Confidence
          description: Classification confidence 0-100 based on score differential
          default: 0
        trend_score:
          type: number
          maximum: 100
          minimum: 0
          title: Trend Score
          description: Trend strength score 0-100 (higher = stronger trend signals)
        rotation_score:
          type: number
          maximum: 100
          minimum: 0
          title: Rotation Score
          description: Rotation score 0-100 (higher = more rotational signals)
        strategy_bias:
          type: string
          title: Strategy Bias
          description: Suggested strategy category
        size_modifier:
          type: number
          maximum: 2
          minimum: 0.5
          title: Size Modifier
          description: Position size adjustment
          default: 1
        signals:
          items:
            type: string
          type: array
          title: Signals
          description: Active signals for the day
      type: object
      required:
        - day_type
        - trend_score
        - rotation_score
        - strategy_bias
      title: DayClassification
      description: Daily market classification from DayClassification vertex.
    VIXContext:
      properties:
        level:
          type: number
          minimum: 0
          title: Level
          description: Current VIX level
        sma_50:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Sma 50
          description: 50-day SMA of VIX
        percentile:
          anyOf:
            - type: number
              maximum: 100
              minimum: 0
            - type: 'null'
          title: Percentile
          description: VIX percentile vs 52-week range
        regime:
          $ref: '#/components/schemas/VIXRegime'
          description: Current VIX regime classification
        term_structure:
          $ref: '#/components/schemas/TermStructure'
          description: VIX term structure
        can_trade:
          type: boolean
          title: Can Trade
          description: False if in FEAR regime (trading paused)
          default: true
        size_adjustment:
          type: string
          title: Size Adjustment
          description: 'Position size guidance: ''-25%'', ''baseline'', ''+15%'', or ''pause'''
      type: object
      required:
        - level
        - regime
        - term_structure
        - size_adjustment
      title: VIXContext
      description: VIX-related context from MarketCondition vertex.
    RegimeV5:
      properties:
        strong_trend:
          anyOf:
            - type: number
            - type: 'null'
          title: Strong Trend
        mild_trend:
          anyOf:
            - type: number
            - type: 'null'
          title: Mild Trend
        rotation:
          anyOf:
            - type: number
            - type: 'null'
          title: Rotation
        vol_expand:
          anyOf:
            - type: number
            - type: 'null'
          title: Vol Expand
        compressed:
          anyOf:
            - type: number
            - type: 'null'
          title: Compressed
        transitional:
          anyOf:
            - type: number
            - type: 'null'
          title: Transitional
        dominant:
          anyOf:
            - type: string
            - type: 'null'
          title: Dominant
        confidence:
          anyOf:
            - type: number
            - type: 'null'
          title: Confidence
        computed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Computed At
      type: object
      title: RegimeV5
      description: V5 regime state vector (shadow mode).
    VIXRegime:
      type: string
      enum:
        - low_complacent
        - normal
        - elevated
        - fear
      title: VIXRegime
      description: VIX regime classification per metrology.
    TermStructure:
      type: string
      enum:
        - contango
        - backwardation
      title: TermStructure
      description: VIX term structure.

````