Overview

What does it do?

The bot runs option strategies on NIFTY/NSE derivatives. Currently active in dry-run mode: AI Market, Double Calendar Straddle, Stretched Double Calendar, Skew-Aware DCS, Directional Diagonal Calendar, and Iron Condor fallback. Box and Calendar strategies are disabled pending strategy rethinks.

AI Market daily analysis At 09:05 IST on NSE trading days, AutonomousMarketAnalyst asks OpenAI for a structured NIFTY verdict. NO_TRADE is stored as analysis only; BULLISH or BEARISH can create one dry-run AI_MARKET option trade and also provide a same-day weak trend hint to DDC.
Operator surface Live monitoring now includes /safety, which shows total live P&L, kill switch state, balance state, and drift/stale alerts alongside /status and /positions. Go-live controls are explicit Telegram commands: /golive_status, /confidence_report <strategy>, /shadow <strategy>, /promote <strategy>, and /revert <strategy>. The React dashboard also shows a Go-Live Readiness panel fed by /api/go-live/status.
Performance Dashboard — Market Indices A "Market Indices" tile grid (LTP + day change% + 5-min sparkline) is pushed over /ws/live on a decoupled timer via MarketIndexService (arb_bot/market/indices.py). It batches one ticker_data call per refresh, paces uncached intraday requests, and caches intraday candles server-side to respect DhanHQ rate limits. Sparkline hover shows the formatted candle value. The enabled-index list is persisted as JSON in bot_settings by IndexConfigStore and edited via GET/PUT /api/market/indices/config.
Paper-to-live state DC, DCS, DCS_SKEW, DDC, IC, and MDC now use SQLite records as the runtime source of truth. Config dry-run flags seed the first file only. A strategy moves DRY_RUN → SHADOW → LIVE; shadow mode places real orders and records a parallel SHADOW_DR_* metrics snapshot for comparison.

📦 Box Spread DISABLED

Buys 4 option legs whose combined payoff at expiry is always exactly K2 − K1 regardless of market movement.

Instruments4 options (NIFTY or BANKNIFTY)
RiskNear-zero
Status0% fill rate — 19 live attempts Apr 16-20

📅 Calendar Spread DISABLED

Buys one NIFTY futures expiry and sells another. Bets that the near/far spread will revert to its historical mean.

Instruments2 NIFTY futures (near + far month)
RiskMean-reversion
StatusExecution suppressed — Budget 2026 STT hike

📅 Double Calendar DRY-RUN

Sells near-expiry ATM straddle, buys far-expiry ATM straddle. Profits from faster theta decay on the near leg and IV expansion on the far leg. 4 options, delta-neutral at entry.

Instruments4 NIFTY options (ATM, weekly + monthly)
RiskTheta + Vega
EntryDTE 3–7, IV 15–25% (elevated-vol regime only)
Exit32% debit profit, 3-trigger stop, or near-expiry day at/after 15:00 IST

📐 Stretched DC DRY-RUN

DC + OTM calendar wings at ±(52% of 1SD). Widens profit tent from ~±200 pts to ~±700-900 pts. 8 options, same IV regime as DC.

Instruments8 NIFTY options (ATM + OTM wings, weekly + monthly)
RiskTheta + Vega (wide tent)
EntryDTE 7–10, IV 15–25%, wing = 52% of 1SD
Exit42% debit profit, 3-trigger stop, or near-expiry day at/after 15:00 IST

🤖 AI Market DRY-RUN

Once-daily OpenAI market assessment for NIFTY. Stores the full response, cost, parsed verdict, and any simulated single-leg option trade for dashboard review.

Instruments1 NIFTY weekly option when verdict is BULLISH/BEARISH
RiskAI-assisted dry-run
Entry09:05 IST, trading days only, one analysis per date
ExitTarget, stop, or EOD close; mirror row in ai_market_trades

📐 Directional Diagonal DRY-RUN

Buys far-month ATM CE/PE and sells near-week OTM CE/PE after a strong intraday trend from day open. Direction decides CE vs PE.

Instruments2 NIFTY options (near + far expiries)
RiskDirectional debit spread
EntryTrend ≥ 0.5%, DTE 5-9, IV 20-25%
Exit30% debit profit, 20% stop, strike breach, or near-expiry day at/after 15:00 IST

🦅 Iron Condor DRY-RUN

Fallback short-vol range strategy. Sells OTM CE/PE at ATM±300 and buys hedges at ATM±500. Runs only when DC, DCS, DCS_SKEW, and DDC are not open.

Instruments4 NIFTY weekly options
RiskDefined risk credit spread
EntryDTE 3-7, ATM IV 18-26%, range ≤ 60% of straddle
Exit50% credit capture, 1.5x credit stop, or near-expiry day at/after 15:00 IST

🧭 Master DC META

Regime wrapper that evaluates the same scan inputs as the DC family, then routes the cycle to DDC, DCS_SKEW, DCS, DC, or IC. The resulting trade keeps its own MDC_* identity.

InstrumentsStrategy router for DC-family setups
RiskMeta-strategy
EntryTrend, skew, realized range, IV fallback
ToolsExample routes, animated flow, calculator