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.
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.
/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.
/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.
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.
| Instruments | 4 options (NIFTY or BANKNIFTY) |
| Risk | Near-zero |
| Status | 0% 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.
| Instruments | 2 NIFTY futures (near + far month) |
| Risk | Mean-reversion |
| Status | Execution 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.
| Instruments | 4 NIFTY options (ATM, weekly + monthly) |
| Risk | Theta + Vega |
| Entry | DTE 3–7, IV 15–25% (elevated-vol regime only) |
| Exit | 32% 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.
| Instruments | 8 NIFTY options (ATM + OTM wings, weekly + monthly) |
| Risk | Theta + Vega (wide tent) |
| Entry | DTE 7–10, IV 15–25%, wing = 52% of 1SD |
| Exit | 42% 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.
| Instruments | 1 NIFTY weekly option when verdict is BULLISH/BEARISH |
| Risk | AI-assisted dry-run |
| Entry | 09:05 IST, trading days only, one analysis per date |
| Exit | Target, 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.
| Instruments | 2 NIFTY options (near + far expiries) |
| Risk | Directional debit spread |
| Entry | Trend ≥ 0.5%, DTE 5-9, IV 20-25% |
| Exit | 30% 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.
| Instruments | 4 NIFTY weekly options |
| Risk | Defined risk credit spread |
| Entry | DTE 3-7, ATM IV 18-26%, range ≤ 60% of straddle |
| Exit | 50% 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.
| Instruments | Strategy router for DC-family setups |
| Risk | Meta-strategy |
| Entry | Trend, skew, realized range, IV fallback |
| Tools | Example routes, animated flow, calculator |