> ## 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 First Passage Time analysis

> Get First Passage Time (FPT) probabilistic timing analysis for a stock.

## What is FPT?

FPT provides probabilistic estimates for how long it will take price to reach
target levels, accounting for:
- Current volatility (Garman-Klass estimator with RVOL adjustment)
- Two-barrier race (target vs stop loss)
- Standard institutional levels (IB extensions, pivots, VWAP bands)

## Pre-computed Scenarios

All FPT data is pre-computed by the Go pattern-detector and stored in the graph.
Standard scenarios include:

- **IB 1.5x Extensions**: Initial Balance extensions (intraday targets)
- **Pivot Levels**: R1/S1 pivot targets
- **VWAP Bands**: VWAP +/- 1 standard deviation

## Response Fields

- **volatility**: Garman-Klass historical volatility context
- **standard_scenarios**: Pre-computed FPT for institutional levels
- **timeframe_fit**: Classification (EXCELLENT/GOOD/MODERATE/EXTENDED/LONG)
- **event_risk**: Earnings within FPT horizon warning

## Timeframe Fit Classification

- **EXCELLENT**: Median < 2 days (day trade / swing entry)
- **GOOD**: Median 2-5 days (swing trade)
- **MODERATE**: Median 5-10 days (swing / position)
- **EXTENDED**: Median 10-20 days (position trade)
- **LONG**: Median > 20 days (investment horizon)

## Performance Target

<100ms response time (reads pre-computed data from graph).



## OpenAPI

````yaml /api/openapi.json get /api/graph/v1/stocks/{symbol}/fpt
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/stocks/{symbol}/fpt:
    get:
      tags:
        - Stocks
      summary: Get First Passage Time analysis
      description: >-
        Get First Passage Time (FPT) probabilistic timing analysis for a stock.


        ## What is FPT?


        FPT provides probabilistic estimates for how long it will take price to
        reach

        target levels, accounting for:

        - Current volatility (Garman-Klass estimator with RVOL adjustment)

        - Two-barrier race (target vs stop loss)

        - Standard institutional levels (IB extensions, pivots, VWAP bands)


        ## Pre-computed Scenarios


        All FPT data is pre-computed by the Go pattern-detector and stored in
        the graph.

        Standard scenarios include:


        - **IB 1.5x Extensions**: Initial Balance extensions (intraday targets)

        - **Pivot Levels**: R1/S1 pivot targets

        - **VWAP Bands**: VWAP +/- 1 standard deviation


        ## Response Fields


        - **volatility**: Garman-Klass historical volatility context

        - **standard_scenarios**: Pre-computed FPT for institutional levels

        - **timeframe_fit**: Classification
        (EXCELLENT/GOOD/MODERATE/EXTENDED/LONG)

        - **event_risk**: Earnings within FPT horizon warning


        ## Timeframe Fit Classification


        - **EXCELLENT**: Median < 2 days (day trade / swing entry)

        - **GOOD**: Median 2-5 days (swing trade)

        - **MODERATE**: Median 5-10 days (swing / position)

        - **EXTENDED**: Median 10-20 days (position trade)

        - **LONG**: Median > 20 days (investment horizon)


        ## Performance Target


        <100ms response time (reads pre-computed data from graph).
      operationId: get_fpt_api_graph_v1_stocks__symbol__fpt_get
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
            title: Symbol
      responses:
        '200':
          description: FPT analysis
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FPTAnalysis'
        '404':
          description: Stock not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '504':
          description: Query timeout
components:
  schemas:
    FPTAnalysis:
      properties:
        symbol:
          type: string
          title: Symbol
          description: Stock ticker symbol
        current_price:
          type: number
          minimum: 0
          title: Current Price
          description: Current stock price
        volatility:
          $ref: '#/components/schemas/VolatilityMetrics'
          description: Volatility context used for calculations
        standard_scenarios:
          $ref: '#/components/schemas/FPTStandardScenarios'
          description: Pre-computed FPT for standard institutional levels
        timeframe_fit:
          $ref: '#/components/schemas/TimeframeFit'
          description: Best timeframe classification based on FPT estimates
        event_risk:
          $ref: '#/components/schemas/EventRiskContext'
          description: Event risk assessment within FPT horizon
        data_quality:
          type: string
          title: Data Quality
          description: 'Data quality indicator: complete, partial, stale, unavailable'
          default: complete
      type: object
      required:
        - symbol
        - current_price
        - volatility
        - standard_scenarios
        - timeframe_fit
        - event_risk
      title: FPTAnalysis
      description: |-
        Complete FPT analysis for a symbol.

        Provides probabilistic timing estimates for reaching standard
        institutional levels based on current volatility and price position.
      example:
        current_price: 180.5
        data_quality: complete
        event_risk:
          days_to_earnings: 18
          earnings_within_horizon: false
        standard_scenarios:
          ib_15x_down:
            direction: down
            level: 176
            level_type: ib_extension
            median_days: 2.1
            p75_days: 3.8
            p90_days: 6.5
            probability: 0.58
          ib_15x_up:
            direction: up
            level: 185
            level_type: ib_extension
            median_days: 2.3
            p75_days: 4.1
            p90_days: 7.2
            probability: 0.65
          pivot_r1:
            direction: up
            level: 188
            level_type: pivot
            median_days: 3.1
            p75_days: 5.5
            p90_days: 9.2
            probability: 0.48
        symbol: NVDA
        timeframe_fit: GOOD
        volatility:
          rvol_adjustment: 1.15
          source: Garman-Klass HV
          value: 0.42
          window_days: 20
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VolatilityMetrics:
      properties:
        value:
          type: number
          minimum: 0
          title: Value
          description: Effective volatility (annualized) used for FPT calculation
        source:
          type: string
          title: Source
          description: Volatility estimation method
          default: Garman-Klass HV
        rvol_adjustment:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Rvol Adjustment
          description: RVOL multiplier applied (1.0 = no adjustment)
        window_days:
          type: integer
          maximum: 60
          minimum: 5
          title: Window Days
          description: Lookback window for volatility estimation
          default: 20
      type: object
      required:
        - value
      title: VolatilityMetrics
      description: |-
        Volatility context for FPT calculations.

        Uses Garman-Klass estimator (more efficient than close-to-close)
        with optional RVOL adjustment for current market conditions.
    FPTStandardScenarios:
      properties:
        ib_15x_up:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'IB 1.5x upward extension (target: IB 1.5x high, stop: IB low)'
        ib_15x_down:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'IB 1.5x downward extension (target: IB 1.5x low, stop: IB high)'
        pivot_r1:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'Pivot R1 (target: R1, stop: S1)'
        pivot_s1:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'Pivot S1 (target: S1, stop: R1)'
        vwap_1sd_up:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'VWAP +1SD (target: VWAP +1SD, stop: VWAP -1SD)'
        vwap_1sd_down:
          anyOf:
            - $ref: '#/components/schemas/FPTScenario'
            - type: 'null'
          description: 'VWAP -1SD (target: VWAP -1SD, stop: VWAP +1SD)'
      type: object
      title: FPTStandardScenarios
      description: |-
        Pre-computed FPT scenarios for standard institutional levels.

        Includes IB 1.5x extensions, pivot levels, and VWAP bands.
        All calculated with two-barrier race methodology.
    TimeframeFit:
      type: string
      enum:
        - EXCELLENT
        - GOOD
        - MODERATE
        - EXTENDED
        - LONG
      title: TimeframeFit
      description: |-
        Timeframe fit classification based on FPT median days.

        Indicates how well the expected time-to-target aligns with
        different trading timeframes.
    EventRiskContext:
      properties:
        earnings_within_horizon:
          type: boolean
          title: Earnings Within Horizon
          description: True if earnings occur within FPT P90 horizon
          default: false
        days_to_earnings:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days To Earnings
          description: Days until next earnings announcement
        event_warning:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Warning
          description: Warning message if significant event within horizon
      type: object
      title: EventRiskContext
      description: |-
        Event risk assessment for FPT horizon.

        Earnings and other catalysts can invalidate FPT assumptions
        due to gap risk.
    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
    FPTScenario:
      properties:
        level:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Level
          description: Target price level
        level_type:
          type: string
          title: Level Type
          description: 'Level classification: ib_extension, pivot, vwap_band'
        direction:
          type: string
          enum:
            - up
            - down
          title: Direction
          description: 'Direction to target: up (bullish) or down (bearish)'
        median_days:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Median Days
          description: Median (P50) days to reach level
        p75_days:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: P75 Days
          description: 75th percentile days to reach level
        p90_days:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: P90 Days
          description: 90th percentile days to reach level (tail scenario)
        probability:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Probability
          description: Probability of hitting this level before opposing barrier (0-1)
      type: object
      required:
        - level_type
        - direction
      title: FPTScenario
      description: |-
        Single FPT scenario result for a target level.

        Contains timing percentiles and probability of hitting target
        before the opposing barrier (stop loss for targets, target for stops).

````