An Experimental AI Options Trading Pipeline powered by Groq (Llama 3.3 70B) & Alpaca Paper Trading API.
Built as a Proof-of-Concept for the Alpaca AI Trading Agents Hackathon (28 Aug – 4 Sept 2026).
Retail traders and algorithmic developers face significant challenges when trying to digest real-time financial news streams:
- Information Overload: Hundreds of market headlines break every hour, making manual sentiment evaluation impractical.
- Emotional & Unsystematic Execution: Traders frequently over-leverage without disciplined risk boundaries.
- Complex Infrastructure: Building automated pipelines bridging unstructured news, LLM reasoning, capital risk gates, and broker API execution is traditionally complex.
The Sentinel AI Trader is an experimental full-stack application designed to explore the news-to-execution lifecycle using LLMs:
- News Retrieval: Continuously ingests fresh market headlines and catalysts.
- Groq AI Analysis: Uses Llama 3.3 70B via Groq to extract structured JSON (Options
CALL/PUTsignals, Confidence, and Strike Price). - Capital Risk Gate: Enforces basic portfolio capital constraints and quantity limits before a trade is approved.
- Alpaca Options Paper Execution: Generates precise OCC Option Symbols and routes market orders exclusively to the Alpaca Paper Sandbox environment.
- Interactive Dashboard & CLI: Displays metrics in real-time and includes an embedded Interactive CLI Terminal that fulfills the mandatory CLI/MCP hackathon requirement.
- Autonomous 5-Stage Pipeline: Visual tracking through
NEWS➔GROQ AI➔OPTIONS SIGNAL➔RISK CHECK➔ALPACA PAPER ORDER. - Strict Structured JSON Options Signals: The Groq agent outputs standardized schemas with ticker, action, option type (CALL/PUT), strike price, and confidence (0.0–1.0).
- Configurable Risk Management:
- Minimum AI Confidence threshold filter.
- Maximum Portfolio Concentration limit.
- Maximum Option Contracts limit (hardcapped at 5).
- Premium vs Cash verification limits.
- Strict Paper Trading Guarantee: Hardcoded to paper API endpoints. Live trading is structurally prevented.
- Embedded Alpaca CLI: Interact directly with your paper account using CLI commands (e.g.,
account get,positions list) translated into real-time API requests directly inside the web UI.
┌─────────────────────────┐
│ Financial News Feed │ (RSS, yfinance, Curated Catalysts)
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Groq (Llama 3.3) │ (Extracts Symbol, Call/Put, Strike, Confidence)
└────────────┬────────────┘
│ Strict JSON Signal
▼
┌─────────────────────────┐
│ Risk Management Layer │ (Confidence Threshold, Cash Check, Max Premium)
└────────────┬────────────┘
│
Approved? ─── NO ───► [LOG & REJECT / HOLD]
│
YES
▼
┌─────────────────────────┐
│ Alpaca Options API │ (Builds OCC Symbol, Submits Paper Order)
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ React/Vite Web UI │ (Real-Time Blotter, CLI Terminal, Audit Logs)
└─────────────────────────┘
- Frontend: React 19, Vite, Tailwind CSS, Framer Motion
- Backend: Node.js/Express (Typescript) & Python (Streamlit Parity Backend)
- AI: Groq API (Llama 3.3 70B Versatile)
- Broker: Alpaca Trading API
git clone https://github.com/NallaSumang/sentinel-ai-trader.git
cd sentinel-ai-tradernpm installpython -m venv venv
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
pip install -r requirements.txtCopy .env.example to .env:
cp .env.example .envFill in your keys:
# Groq API Key
GROQ_API_KEY=your_groq_api_key
# Alpaca Paper Keys
ALPACA_API_KEY=your_alpaca_key
ALPACA_SECRET_KEY=your_alpaca_secretRun the React + Node.js Dashboard:
cd frontend
npm run devAccess at http://localhost:3000
Run the Python Streamlit Backend:
cd backend
streamlit run app.pyAccess at http://localhost:8501
This project addresses the core themes of the Alpaca AI Trading Agents Hackathon (28 Aug–4 Sept 2026):
- Autonomous Agents: Uses blazing fast Groq models to autonomously execute Options strategies based on live news.
- CLI/MCP Support: Implements an embedded Alpaca CLI inside the dashboard for direct interactions.
- Safety First: Implements rigorous pre-trade Options risk management gates to protect capital.
- Seamless Alpaca Integration: Utilizes the Alpaca API strictly within the paper environment.
Let's be real—this codebase serves as a fast-paced Hackathon prototype. If you fork this for personal, real-money trading projects, the following limitations and flaws must be addressed:
- LLM Hallucinations: Language models trade on "textual sentiment" and cannot calculate Black-Scholes pricing or real-time Implied Volatility (IV).
- Slippage & Liquidity: The pipeline submits Market/Limit orders without querying real-time Order Book depth, exposing trades to severe bid-ask slippage.
- Execution Latency: System latency makes it significantly slower than HFT algorithms which price news into premiums in milliseconds.
- Rudimentary Risk Management: The current risk gate lacks Portfolio Delta, Beta-Weighting, and Value at Risk (VaR) calculations.
- No Exit Strategy: The agent can enter positions but lacks automated Stop-Loss or Trailing-Stop mechanisms to exit them profitably.
Educational & Paper Trading Research Only:
This software is designed solely for research, educational, and hackathon demonstration purposes. It uses Alpaca Paper Trading only. It does NOT execute real monetary trades and does NOT constitute financial, investment, or legal advice. No automated system can guarantee profits.