Building GreekLab: A Regime-Aware Options Research Platform for Indian Markets

Most options research starts with a strategy and works backward to justify it. GreekLab starts with the market regime and works forward to the strategy that fits it.

That distinction drives the entire architecture. Before any trade decision is made, the system classifies the current market state — ranging, trending up, trending down, or volatility shock — and routes to the strategy families that have positive expected value in that regime. No regime classification, no trade.

This is a case study on building that research platform for Indian index options: Nifty, Sensex, and BankNifty.

Why Indian Options Are Worth a Dedicated Platform

Indian index options have characteristics that make generic options frameworks a poor fit.

Nifty options expire every Thursday. The weekly cycle means there are always multiple active expiries in play — current week, next week, monthly, quarterly — and the choice of expiry is a research decision, not just a preference. Implied volatility behaves differently near expiry, and the premium decay profile changes meaningfully in the final trading day.

The India VIX is a useful but imperfect signal. Its relationship to Nifty realized volatility shifts across market regimes. A system that treats VIX as a single threshold for volatility-selling decisions will be correct on average and wrong at the moments that matter.

Finally, data quality is a genuine problem. Live broker feeds drop candles. Historical expired options data is fragmented across providers. A platform that does not invest in data validation and gap repair will produce backtests that look better than production results.

GreekLab is built around those three constraints.

Data Layer: Four Brokers, One Pipeline

The data layer ingests from four sources, each covering a different slice of the market data problem:

  • Zerodha Kite: Live 1-minute candle streaming for index and options via KiteTicker, plus reference data for all active instruments. The primary live feed.
  • Dhan: Historical expired options data from 2021 forward. Expired options are not available through most providers after expiry; Dhan's API fills that gap for backtesting.
  • Upstox: Alternative source for expired options and index data, used as validation and for any gaps in Dhan coverage.
  • Breeze: Spot and index historical data as a secondary validation source.

All four feeds write into PostgreSQL for the control plane (positions, decisions, regime state) and optionally into ClickHouse for the high-volume market data tables (option 1-minute bars, greek surface snapshots). A reconciliation service runs daily to detect candle gaps and repair them from Kite historical data.

The goal is a clean, gap-free options dataset from 2021 to present for Nifty, with VIX aligned to each bar. Without that foundation, every backtest result carries a data-quality caveat that is impossible to quantify.

Regime Detection

The regime engine runs continuously during market hours and classifies each 1-minute bar into one of five states:

  • RANGE: Price contained within the opening range, VIX moderate, no strong directional momentum. The environment for volatility-selling strategies.
  • TREND_UP / TREND_DOWN: Price breaking out of the opening range with directional confirmation. The environment for momentum and debit spread strategies.
  • VOL_SHOCK: Realized volatility spike, VIX elevated sharply, IV-RV spread compressed or inverted. The environment for reduced exposure and defined-risk structures only.
  • NO_TRADE: Outside market hours, data quality below threshold, or no regime with sufficient confidence. No strategies admitted.

Each classification combines the opening range position, VWAP relationship, ATR percentage, realized volatility, implied volatility, and the IV-RV spread. The regime is stored with the input signals and the classification reason so every decision can be traced back to the market state that produced it.

In June 2026, the NIFTY regime distribution across 1-minute bars was predominantly NO_TRADE — the system classifies most intraday time as outside its confidence threshold. RANGE represented the largest active-trading regime, with TREND_UP and TREND_DOWN combining for a small fraction of bars. This selectivity is intentional. The goal is not to be in the market constantly. It is to be in the market when the regime favors the strategy.

Strategy Families

GreekLab currently papers eleven strategy families. Each is admitted only in its target regime.

Volatility selling (RANGE regime):

  • Iron Condor: Short strangle with defined-risk wings. The primary volatility-selling vehicle — short premium collected on both sides with max loss capped by the wing width.
  • Iron Fly: ATM short straddle with wings. Higher premium than a condor, but a narrower profit zone.
  • Protected Strangle: Short strangle with tail-risk hedges. Lower premium than an iron condor, but reduced exposure to gap events.

Directional (TREND regime):

  • Bull Debit Spread / Bear Debit Spread: Defined-risk debit structures for directional momentum. Long the near-the-money option, short the further strike to reduce cost.
  • ATR Momentum Buy: Directional option buy sized by ATR-derived breakout confirmation. Short hold target, fast exit rules.
  • Trend Option Buy: Straight directional option buy with technical entry confirmation and a time-based exit if the move does not follow through.

Term structure:

  • Calendar Spread: Long a farther expiry, short the nearer expiry at the same strike. Benefits from the near-expiry leg decaying faster than the far-expiry leg.
  • Double Calendar: Calendar spreads on both sides of the current price. Lower directional risk than a single calendar, more complex to manage.
  • Directional Diagonal: Combined directional and term-structure play. Long a farther expiry at a directional strike, short the current-week expiry at a closer strike.

Scalping (RANGE regime, intraday):

  • Greek Scalp: Short-duration momentum trade using real-time greeks as entry signals. Tight stop-loss and fast exit target. High trade frequency, short average hold.

Expiry-day:

  • DTE-0 Butterfly: Same-day expiry butterfly for premium decay in a range. High-conviction range-day only.

ML-ranked cross-strategy:

  • Tick-data ranker: An ML model trained on five years of per-tick options data — real bid/ask spreads, OI velocity, and buy/sell flow imbalance — that selects the best strategy structure and strike configuration at each entry time from across the vol-selling menu. The ranker is regime-conditioned and uses microstructure signals as entry features rather than price-only indicators.

Paper Trading Results

GreekLab has been running in paper-trading mode since May 13, 2026. Across 114 closed positions, the platform has generated a net P&L of approximately ₹47,200 on paper capital, with an overall win rate of 56.1%.

The results break down meaningfully by strategy family:

Strategy familyPositionsWin rateTotal net P&LAvg hold
Iron condor4175.6%₹40,18466 hrs
Tick-data ranker1080.0%₹5,13374 hrs
ATR momentum buy1275.0%₹5,0480.5 hrs
Trend option buy757.1%₹5,2160.8 hrs
Calendar30.0%-₹7001.8 hrs
Greek scalp2642.3%-₹2,5300.2 hrs
Greek debit spread147.1%-₹4,7833.2 hrs

Several things are visible in the data.

Iron condors are carrying the positive P&L. The 75.6% win rate over a 66-hour average hold is consistent with a range-regime volatility-selling strategy that collects premium slowly and closes early when the position reaches target. The result is not surprising — the RANGE regime is the most common active-trading classification, and iron condors are the primary vehicle for it.

The tick-data ranker is the second-strongest result: 80% win rate across 10 positions with a 74-hour average hold. This is an ML ranker trained on five years of per-tick options data — real bid/ask spreads, OI delta, and buy/sell flow — that selects the best strategy type and strike configuration at each entry time from a menu of vol-selling structures (straddles, strangles, iron condors, iron flies, and credit spreads). Small sample, but the per-trade economics are consistent with the iron condor results.

The short-duration directional strategies (ATR momentum, trend option buy) are profitable with high win rates and sub-one-hour average holds. These are admitted infrequently and sized conservatively, so the absolute P&L is smaller, but the per-trade economics look sound.

Greek scalp and greek debit spread are underperforming. The scalp strategy has a 42.3% win rate with an average hold of 0.2 hours — it is trading frequently, but more losing trades than winning ones. The debit spread has a 7.1% win rate across 14 positions, which is the most informative failure in the data. The debit spread entry rules are being triggered in conditions where directional momentum does not follow through. That is a signal to tighten the entry regime filter, not a signal that debit spreads cannot work.

Calendar spreads have lost on all three positions. This is a small sample, but the structure requires specific term-structure conditions to profit. The current entry logic is likely admitting calendars in conditions where the near-far volatility spread does not favor the trade.

These are exactly the kinds of findings a paper-trading pipeline is designed to produce before real capital is committed.

The Operations Dashboard

GreekLab runs a FastAPI backend and a React dashboard at indianops.vibeship.ai. The dashboard is read-only — it surfaces, does not control.

The live view shows the current spot price and day change, the active regime for each underlying, open positions with entry price and current mark-to-market, recent decisions with the regime state and reason at the time of each decision, and data quality indicators (candle coverage, quote freshness, ingestion health).

The regime indicator is the most-watched element. If the system is in NO_TRADE when the market looks active, the quality check tab will show why — stale quotes, a candle gap, or a regime confidence threshold not met. That transparency is what makes the system trustworthy enough to iterate on.

What the Research Is Teaching

A few things are already clear from the paper-trading period.

Regime selectivity is correct but may be too conservative. The high NO_TRADE fraction means the system passes on many potential setups. Whether those passed setups would have been profitable is worth examining through backtesting, not just observation.

Multi-leg strategies with defined risk outperform pure scalping in this period. The iron condor and tick-data ranker results versus the scalp and debit spread results point toward structures where the profit/loss profile is bounded and the hold period is long enough for premium decay to work.

Entry regime filters matter more than exit rules. The debit spread and calendar results suggest the entries are wrong more often than the exits. That is a common finding in options research and the right place to invest in tighter conditions.

Paper trading reveals operational failures that backtesting cannot. Two positions were voided due to data issues. Several positions were admitted and closed within minutes because live quote quality degraded. A backtest using clean historical data would not have shown those failure modes.

The platform is research infrastructure, not a trading product. The value is in building a rigorous, reproducible process for evaluating whether a strategy has edge before any real capital is involved.