Options Analysis Platform Architecture v0.1
Version: 2026-10-14
Language: English
Part of the DawnLuma Options research area — see also DawnLuma — Options and the platform overview.
1. Purpose
Section titled “1. Purpose”This document describes the Options Analysis Platform within DawnLuma: an options research, analytics, and backtesting architecture.
The initial goals are to:
- ingest options market data from multiple providers and markets;
- preserve raw market data separately from calculated analytics;
- normalise provider-specific data into a common internal data model;
- calculate option analytics such as IV, Greeks, OI, volume, liquidity, skew, and term structure;
- backtest options strategies using historical market data;
- present results through APIs, charts, reports, and a future web interface;
- keep the core analysis and backtesting logic independent from a specific market-data vendor.
The first prototype is intended to use US options data because it is easier and cheaper to access for development.
The architecture should later support HKEX options data through a separate data adapter, without rewriting the analysis or backtest engines.
Within DawnLuma, the Options area remains logically separate from Stocks research (including MarketLens-style equity work).
A future Strategies layer may combine stock-side and options-side outputs. See DawnLuma Platform, Website & SEO Design, Stocks, and Strategies.
2. High-Level Design Principles
Section titled “2. High-Level Design Principles”2.1 Separation of Concerns
Section titled “2.1 Separation of Concerns”The application is divided into four main areas:
- Data Layer
- Analysis Engine
- Backtest Engine
- Output Layer
Each part should be independently testable and replaceable.
2.2 Provider Independence
Section titled “2.2 Provider Independence”The analysis and backtesting engines should not know whether data came from:
- ThetaData
- Massive
- Cboe
- HKEX
- another future provider
Provider-specific formats must be converted into a canonical internal model before reaching the analysis layer.
2.3 Market Independence
Section titled “2.3 Market Independence”US and Hong Kong markets have different:
- contract multipliers;
- trading calendars;
- fee structures;
- settlement rules;
- exercise conventions;
- market-data formats;
- liquidity characteristics.
These differences should be isolated behind market-specific components.
2.4 Preserve Raw Data
Section titled “2.4 Preserve Raw Data”Raw market data should be stored unchanged whenever licensing permits.
Derived values such as:
- implied volatility;
- Delta;
- Gamma;
- Theta;
- Vega;
- IV Rank;
- IV Percentile;
- liquidity score;
should be reproducible from the original data.
2.5 Backtesting as a Separate Engine
Section titled “2.5 Backtesting as a Separate Engine”Backtesting is not simply another analytics calculation.
The backtest engine must independently handle:
- strategy definitions;
- entry rules;
- exit rules;
- contract selection;
- fill assumptions;
- bid/ask spread;
- slippage;
- commissions and fees;
- exercise and assignment;
- position tracking;
- realised and unrealised P&L;
- performance metrics.
3. High-Level Architecture
Section titled “3. High-Level Architecture”flowchart TD A[External Data Sources<br/>ThetaData / Massive / Cboe / HKEX<br/>Underlying Prices / Rates / Dividends]
subgraph DL[1. Data Layer] B[Provider Adapters] C["Validation & Normalisation"] D[Canonical Data Model] E[(Raw Data Storage)] F[(Normalised Data Storage)] end
subgraph AE[2. Analysis Engine] G["IV & Greeks"] H["OI & Volume Analysis"] I[Liquidity Analysis] J[IV Rank / Percentile] K["Skew & Term Structure"] L[Unusual Activity / Signals] end
subgraph BE[3. Backtest Engine] M[Strategy Definition] N[Entry / Exit Rules] O[Contract Selector] P[Execution / Fill Model] Q[Fees / Slippage] R["Position & P&L Engine"] S[Performance Metrics] end
subgraph OL[4. Output Layer] T[REST API] U[Web UI] V[Charts] W[Reports / Export] end
A --> B B --> C C --> D B --> E D --> F
F --> G F --> H F --> I F --> J F --> K F --> L
F --> M G --> M H --> M I --> M J --> M K --> M L --> M
M --> N N --> O O --> P P --> Q Q --> R R --> S
G --> T H --> T I --> T J --> T K --> T L --> T S --> T
T --> U T --> V T --> W4. System Boundaries
Section titled “4. System Boundaries”4.1 Data Layer
Section titled “4.1 Data Layer”Responsible for:
- downloading or querying market data;
- reading provider-specific files or APIs;
- data validation;
- timestamp normalisation;
- symbol normalisation;
- contract mapping;
- duplicate handling;
- preserving raw data;
- producing canonical internal objects.
The Data Layer should not:
- calculate strategy profitability;
- decide which strategy is best;
- generate trading recommendations;
- contain UI logic.
4.2 Analysis Engine
Section titled “4.2 Analysis Engine”Responsible for:
- implied volatility;
- Greeks;
- IV Rank;
- IV Percentile;
- open interest analysis;
- option volume analysis;
- abnormal-volume detection;
- liquidity analysis;
- bid/ask spread analysis;
- volatility skew;
- term structure;
- option-chain analytics;
- research signals.
The Analysis Engine should consume only the canonical internal model.
It should not know whether the source was HKEX, ThetaData, Massive, Cboe, or another vendor.
4.3 Backtest Engine
Section titled “4.3 Backtest Engine”Responsible for replaying historical data under a defined strategy.
The engine should support:
- single-leg strategies;
- multi-leg strategies;
- long and short options;
- entry filters;
- exit conditions;
- DTE selection;
- Delta-based contract selection;
- strike-based contract selection;
- bid/ask-aware execution;
- realistic fill models;
- slippage;
- commissions;
- exercise;
- assignment;
- expiry;
- capital usage;
- portfolio-level performance;
- drawdown;
- expectancy;
- win/loss statistics;
- profit factor.
The engine should be strategy-agnostic.
Avoid creating a separate engine for every strategy.
Bad design:
LongCallBacktesterBullCallSpreadBacktesterBullPutSpreadBacktesterIronCondorBacktesterPreferred design:
BacktestEngine +StrategyDefinition4.4 Output Layer
Section titled “4.4 Output Layer”Responsible for:
- REST API;
- option chain presentation;
- analysis dashboard;
- backtest reports;
- charts;
- CSV / JSON exports;
- future web UI.
The Output Layer should not contain financial calculations.
5. Canonical Data Model
Section titled “5. Canonical Data Model”The canonical data model is one of the most important architectural decisions.
The same model should be usable for US and Hong Kong data.
5.1 OptionContract
Section titled “5.1 OptionContract”public record OptionContract{ public required string Market { get; init; } public required string Underlying { get; init; } public required DateOnly Expiry { get; init; } public required decimal Strike { get; init; } public required OptionRight Right { get; init; } public required int Multiplier { get; init; } public required string Currency { get; init; } public string? ExerciseStyle { get; init; } public string? SettlementType { get; init; }}5.2 OptionQuote
Section titled “5.2 OptionQuote”public record OptionQuote{ public required OptionContract Contract { get; init; } public required DateTimeOffset Timestamp { get; init; } public decimal? Bid { get; init; } public decimal? Ask { get; init; } public int? BidSize { get; init; } public int? AskSize { get; init; }}5.3 OptionTrade
Section titled “5.3 OptionTrade”public record OptionTrade{ public required OptionContract Contract { get; init; } public required DateTimeOffset Timestamp { get; init; } public required decimal Price { get; init; } public required int Size { get; init; }}5.4 UnderlyingPrice
Section titled “5.4 UnderlyingPrice”public record UnderlyingPrice{ public required string Market { get; init; } public required string Symbol { get; init; } public required DateTimeOffset Timestamp { get; init; } public required decimal Price { get; init; }}5.5 OpenInterest
Section titled “5.5 OpenInterest”public record OpenInterest{ public required OptionContract Contract { get; init; } public required DateOnly Date { get; init; } public required long Value { get; init; }}6. Provider Adapter Design
Section titled “6. Provider Adapter Design”The data provider should be abstracted behind a common interface.
public interface IOptionsDataProvider{ Task<IReadOnlyList<OptionContract>> GetContractsAsync( string underlying, DateOnly date);
Task<IReadOnlyList<OptionQuote>> GetQuotesAsync( OptionContract contract, DateTimeOffset from, DateTimeOffset to);
Task<IReadOnlyList<OptionTrade>> GetTradesAsync( OptionContract contract, DateTimeOffset from, DateTimeOffset to);}Possible implementations:
ThetaDataProviderMassiveOptionsProviderCboeOptionsProviderHKEXOptionsProvider7. Data Flow
Section titled “7. Data Flow”flowchart LR A[Vendor Data] B[Provider Adapter] C[Validation] D[Normalisation] E[Canonical Model] F[(Raw Storage)] G[(Normalised Storage)] H[Analysis Engine] I[Backtest Engine] J[API / Reports / UI]
A --> B B --> F B --> C C --> D D --> E E --> G G --> H G --> I H --> I H --> J I --> J8. US First, HKEX Later
Section titled “8. US First, HKEX Later”The first prototype can use US data.
flowchart TD A[ThetaData / Massive] B[US Adapter] C[Canonical Option Data] D[Analysis Engine] E[Backtest Engine] F[Output]
A --> B B --> C C --> D C --> E D --> E D --> F E --> FLater, Hong Kong support should be added without changing the core engines.
flowchart TD A1[US Vendor] A2[HKEX] B1[US Adapter] B2[HKEX Adapter] C[Canonical Option Data] D[Analysis Engine] E[Backtest Engine] F[Output]
A1 --> B1 A2 --> B2 B1 --> C B2 --> C C --> D C --> E D --> E D --> F E --> F9. Market-Specific Configuration
Section titled “9. Market-Specific Configuration”Market-specific behaviour should not be hard-coded into the core engine.
Examples:
TradingCalendarCommissionModelSlippageModelContractMultiplierExerciseModelSettlementModelCurrencyMarketHoursFeeModelFor example, do not write:
var contractSize = 100;Use:
var contractSize = contract.Multiplier;This is especially important because Hong Kong stock-option contract sizes vary by underlying.
10. Analysis Engine
Section titled “10. Analysis Engine”flowchart TD A[Canonical Options Data]
A --> B[Implied Volatility] A --> C[Greeks] A --> D[Open Interest] A --> E[Volume] A --> F["Bid / Ask & Liquidity"]
B --> G[IV Rank] B --> H[IV Percentile] B --> I[Volatility Skew] B --> J[Term Structure]
D --> K[OI Change] E --> L[Abnormal Volume] F --> M[Liquidity Score]
G --> N[Signals] H --> N I --> N J --> N K --> N L --> N M --> N11. Backtesting Architecture
Section titled “11. Backtesting Architecture”flowchart TD A[Historical Data] B[Analysis Signals] C[Strategy Definition]
A --> D[Contract Selector] B --> D C --> D
D --> E[Entry Rules] E --> F[Execution / Fill Model] F --> G[Open Position] G --> H[Position Monitoring] H --> I{Exit Rule Triggered?} I -- No --> H I -- Yes --> J[Exit Execution] J --> K["P&L"] K --> L[Performance Metrics]12. StrategyDefinition Concept
Section titled “12. StrategyDefinition Concept”The backtest engine should not hard-code strategy names.
Long Call
Section titled “Long Call”Strategy: Long Call
Leg 1- Action: BUY- Type: CALL- DTE: 30-45- Delta Target: 0.50Bull Call Spread
Section titled “Bull Call Spread”Strategy: Bull Call Spread
Leg 1- Action: BUY- Type: CALL- Delta Target: 0.50
Leg 2- Action: SELL- Type: CALL- Higher StrikeBull Put Spread
Section titled “Bull Put Spread”Strategy: Bull Put Spread
Leg 1- Action: SELL- Type: PUT- Delta Target: 0.25
Leg 2- Action: BUY- Type: PUT- Lower Strike13. Backtest Inputs
Section titled “13. Backtest Inputs”A backtest requires more than just an option strategy.
Entry Conditions
Section titled “Entry Conditions”Examples:
- bullish signal;
- VCP breakout;
- abnormal option volume;
- IV percentile threshold;
- DTE range;
- Delta range;
- minimum OI;
- maximum bid/ask spread;
- minimum liquidity score.
Contract Selection
Section titled “Contract Selection”Examples:
- nearest Delta to 0.50;
- 30–45 DTE;
- specific strike distance;
- ATM / ITM / OTM;
- minimum volume / OI.
Execution Assumptions
Section titled “Execution Assumptions”Examples:
- buy at ask;
- sell at bid;
- mid-price fill;
- configurable slippage;
- partial-fill assumptions.
Exit Rules
Section titled “Exit Rules”Examples:
- +50% profit;
- -30% stop loss;
- 21 DTE;
- technical signal invalidation;
- expiry;
- assignment / exercise.
14. Backtest Success Metrics
Section titled “14. Backtest Success Metrics”A strategy should not be judged only by win rate.
Important metrics include:
Number of TradesWin RateAverage WinnerAverage LoserExpectancyTotal ReturnAnnualised ReturnMaximum DrawdownProfit FactorSharpe RatioCapital UsageAverage Holding PeriodExposureBasic expectancy:
Expectancy=Win Rate × Average Win-Loss Rate × Average Loss15. Signal Backtesting vs Strategy Backtesting
Section titled “15. Signal Backtesting vs Strategy Backtesting”flowchart TD A[Options Analysis Platform]
A --> B[Signal Backtesting] A --> C[Strategy Backtesting]
B --> D[IV] B --> E[OI] B --> F[Volume] B --> G[Liquidity]
C --> H[Long Call] C --> I[Bull Call Spread] C --> J[Bull Put Spread] C --> K[Cash-Secured Put]
D --> L[Does the signal have predictive value?] E --> L F --> L G --> L
H --> M[Can the signal be traded profitably?] I --> M J --> M K --> MExample signal research:
Today's option volume > 5 × 20-day average
Then measure underlying return after:+1 day+3 days+5 days+10 daysAnother example:
IV Percentile > 90
Then measure:5-day IV change10-day IV change20-day IV changePreferred sequence:
- determine whether a signal has predictive value;
- then determine which option strategy best expresses that signal.
This helps reduce overfitting.
16. Out-of-Sample Testing
Section titled “16. Out-of-Sample Testing”Do not tune parameters using the entire historical dataset.
Example:
2020–2024Development / Parameter Research
2025–2026Out-of-Sample ValidationOnce parameters are chosen on the development period, they should remain unchanged when testing the out-of-sample period.
17. Initial Prototype Scope
Section titled “17. Initial Prototype Scope”Phase 1 — Data
Section titled “Phase 1 — Data”- Select US options data provider.
- Implement one provider adapter.
- Download historical data for a small set of highly liquid underlyings.
- Convert provider data into canonical models.
- Display parsed data in a console application.
Suggested initial underlyings:
SPYQQQAAPLMSFTNVDAPhase 2 — Basic Analytics
Section titled “Phase 2 — Basic Analytics”Implement:
- bid/ask spread;
- mid price;
- simple liquidity measures;
- IV;
- Delta;
- Gamma;
- Theta;
- Vega.
Phase 3 — Long Call Backtest
Section titled “Phase 3 — Long Call Backtest”First research question:
When a bullish signal occurs, does buying a 30–45 DTE call with approximately 0.50 Delta produce positive expectancy after realistic bid/ask spread, slippage, and fees?
The purpose of this first backtest is mainly to validate the engine.
Phase 4 — Multi-Leg Strategies
Section titled “Phase 4 — Multi-Leg Strategies”Add:
- Bull Call Spread
- Bull Put Spread
- Cash-Secured Put
Iron Condor and more complex strategies should come later.
Phase 5 — Option Signals
Section titled “Phase 5 — Option Signals”Add historical research for:
- abnormal option volume;
- OI change;
- IV Rank;
- IV Percentile;
- skew;
- liquidity.
18. Storage Architecture
Section titled “18. Storage Architecture”For large historical datasets, do not immediately load everything into PostgreSQL.
flowchart TD A[Raw Vendor Files] B[Object / File Storage] C[Parquet] D[DuckDB / Polars / Python] E[Analysis Results] F[(PostgreSQL)]
A --> B B --> C C --> D D --> E E --> FSuggested approach:
- raw vendor files remain immutable;
- transform raw files into Parquet;
- use DuckDB / Polars for large analytical queries;
- store final metadata, runs, users, strategy definitions, and results in PostgreSQL.
19. Suggested Project Structure
Section titled “19. Suggested Project Structure”dawnluma-options/│├── docs/│ ├── architecture-overview.md│ ├── data-model.md│ ├── data-providers.md│ ├── analysis-engine.md│ ├── backtest-engine.md│ ├── storage.md│ └── roadmap.md│├── src/│ ├── DawnLuma.Options.Domain/│ ├── DawnLuma.Options.Data/│ ├── DawnLuma.Options.Analytics/│ ├── DawnLuma.Options.Backtesting/│ ├── DawnLuma.Options.Api/│ └── DawnLuma.Options.Web/│├── tests/│ ├── DawnLuma.Options.Domain.Tests/│ ├── DawnLuma.Options.Data.Tests/│ ├── DawnLuma.Options.Analytics.Tests/│ └── DawnLuma.Options.Backtesting.Tests/│└── README.md20. Future Strategies Layer Integration
Section titled “20. Future Strategies Layer Integration”Within DawnLuma, Stocks and Options research should remain independent systems.
A future Strategies layer may combine their outputs.
flowchart LR A[Stocks<br/>MarketLens research] B[Strategies layer] C[Options Analysis Platform]
A -->|Stock signals| B C -->|Options analytics| B
B --> D[Combined Research] D --> E[Stock + Option + Strategy Analysis]Stocks (equity research)
Section titled “Stocks (equity research)”- trend;
- VCP;
- relative strength;
- breakout;
- volume;
- stock scoring.
Options Analysis Platform
Section titled “Options Analysis Platform”- IV;
- OI;
- option volume;
- Greeks;
- liquidity;
- skew;
- term structure;
- backtesting.
Strategies layer
Section titled “Strategies layer”- combine stock signals with option analytics;
- rank opportunities;
- compare strategy structures;
- perform cross-system research.
The Strategies layer should access data through APIs, events, or exported analytical datasets rather than directly querying private internal database schemas of the Stocks or Options systems.
21. Recommended First Development Steps
Section titled “21. Recommended First Development Steps”Step 1
Section titled “Step 1”Create this architecture document.
Step 2
Section titled “Step 2”Define canonical domain models:
OptionContractOptionQuoteOptionTradeUnderlyingPriceOpenInterestStep 3
Section titled “Step 3”Define:
IOptionsDataProviderStep 4
Section titled “Step 4”Implement one US provider adapter.
Example:
ThetaData→ ThetaDataProvider→ Canonical Models→ Console OutputDo not build the UI yet.
Step 5
Section titled “Step 5”Add raw / Parquet storage.
Step 6
Section titled “Step 6”Implement basic option analytics.
Step 7
Section titled “Step 7”Build the generic Backtest Engine.
Step 8
Section titled “Step 8”Create the first Long Call StrategyDefinition.
Step 9
Section titled “Step 9”Add Bull Call Spread and Bull Put Spread.
Step 10
Section titled “Step 10”Add HKEX support through:
HKEX Data→ HKEXOptionsProvider→ Canonical Models→ Existing Analysis Engine→ Existing Backtest EngineThe goal is that HKEX support should require a new adapter and market-specific configuration, not a rewrite of the system.
22. Architecture Summary
Section titled “22. Architecture Summary”flowchart TD A[Market Data Providers]
A --> B[Provider Adapters] B --> C[Canonical Data Model] C --> D[(Storage)]
D --> E[Analysis Engine] D --> F[Backtest Engine] E --> F
E --> G[API / UI / Reports] F --> G
H[Stocks research] -. Future Integration .-> I[Strategies layer] G -. Options Analytics .-> IThe core architectural rule is:
Data source, analytics, backtesting, and presentation must remain separate.
This separation allows the system to:
- start with US data;
- later support HKEX data;
- change data vendors;
- add new strategies;
- add new analytics;
- reuse the same backtest engine;
- exchange signals with DawnLuma Stocks research without tightly coupling the two systems.