OPTIONS MASTERY
Back to all insights
Product Updates

Scaling AI Options Recommendations: How We Engineered a 24-Strategy Real-Time Engine

How we refactored our Recommended Opportunities Engine to support 24 distinct options setups and integrated real-time snapshot pricing across the core options asset universe.

Sumeet Rana
5 min read

Scaling AI Options Recommendations: How We Engineered a 24-Strategy Real-Time Engine

In options trading, static insights are obsolete insights. When building OptionsMastery.ai, our goal was to deliver institutional-grade, real-time options strategy recommendations directly inside the retail portfolio interface.

Recently, we rolled out a major architecture update to our Recommended Opportunities Engine to scale our output and guarantee real-time data integrity. Here is a walkthrough of what we did, the engineering hurdles we solved, and how it translates to your portfolio.


The Goal: 20+ Active Recommendations

Our users wanted a comprehensive market scan across three strategic profiles:

  1. Income Plays on Assets You Own (Covered Calls, Cash-Secured Puts, and Income Spreads).
  2. Market Opportunities (New setups on high-quality indices and mega-caps).
  3. High-Conviction Asymmetric Bets (LEAPs, debit spreads, and structural leverage).

Previously, our LLM analysis system was capped, resulting in a maximum of ~5 total strategies across the entire portfolio. We re-engineered the prompt instructions and the application fallback architecture to scale this to at least 20 strategies (7–8 per category).

Identified Holdings & Strategies


Key Challenges & Solutions

1. Guaranteeing Real-Time Strike Accuracy

The Issue: The AI engine was previously evaluating historical close prices rather than real-time data. This resulted in recommended options strikes (e.g. suggesting an AAPL $165 strike when the underlying stock had moved to $310) that were wildly out of sync with actual market conditions.

The Fix: We refactored our backend analysis pipeline in backend/app/api/portfolio.py. We completely removed the daily historical close downloads and replaced them with parallel real-time snapshot queries using Yahoo Finance’s /v7/finance/quote API endpoint. We now feed Gemini the exact real-time prices for all 14 core underlying assets, guaranteeing strike relevance.

2. Prompt Quantity Rigidity

The Issue: Gemini model completions could occasionally skew or shorten arrays, ignoring the requested coverage depth.

The Fix: We implemented strict JSON schema parameters and quantity constraints (CRITICAL QUANTITY REQUIREMENT) within the LLM instructions. The model is now instructed to output exactly 7 to 8 items in each section of the JSON payload.

3. Upgrading Frontend Fallbacks

If the live scanner or LLM encounters temporary rate limit thresholds, the system falls back to a high-quality client-side strategy matrix. We expanded these fallback structures to host 24 pre-calculated, future-dated options strategies computed relative to live-market pricing.


Exploring the New Strategic Tiers

💸 Income Plays (Assets You Own)

Optimized for premium collection and yield harvest on core holdings. It analyzes your inventory (e.g., AAPL, NVDA, MSFT) and calculates the optimal 30-45 DTE covered call strikes to maximize premium decay while keeping call-away risk low.

Income Plays

📈 Market Opportunities (New Positions)

Identifies cash-secured puts or credit spreads on high-quality index assets (SPY, QQQ) and mega-caps (GOOGL, META, AMD) for positions you do not currently hold, allowing discounted entry.

Market Opportunities

🔮 High-Conviction Asymmetric Bets

Designed for high payoff multipliers with defined downside risk, targeting volatility expansion on tickers like COIN, AMD, TSLA, and PLTR.

Asymmetric Bets


Result

A robust, highly responsive options recommendation pipeline that compiles in milliseconds, passes all test suites, and updates dynamically.

To check out the new recommendation layout and upload your portfolio, visit OptionsMastery.ai.

Ready to put this into practice?

Join OptionsMastery.ai today and let Athena instantly find the optimal strategies for your portfolio.

Start Free Trial
Connecting...
API: https://optionsmastery-production.up.railway.app