AWS Builder Center
Weekend Productivity Challenge: S&P 500 Market Radar Agent

Weekend Productivity Challenge: S&P 500 Market Radar Agent

An autonomous market intelligence agent that automatically analyzes the S&P 500 using the most recently completed U.S. trading session, detects key market signals, and delivers a Daily Market Intelligence Report via Amazon EventBridge, AWS Lambda, and Amazon SES-eliminating the need for manual daily market monitoring.

Weekend Agent Challenge: S&P 500

Market Radar Agent

The S&P 500 Market Radar Agent is an autonomous market intelligence system designed to continuously monitor and analyze the U.S. equity market without requiring a human to manually initiate the analysis. Unlike a traditional automated reporting pipeline, the agent applies predefined market intelligence and risk-screening rules to evaluate market activity, identify significant anomalies, and autonomously prioritize events that warrant further human review. Focusing on the companies within the S&P 500, the agent transforms raw market data into structured, decision-ready market intelligence reports.
The original version of the system was initiated manually through local Python runtimes, Jupyter notebooks, or Google Colab environments. A human would manually trigger the script, collect market metrics, and output a local visualization. While this approach demonstrated core analytical capabilities, it did not satisfy the paradigm of an always-on autonomous agent. The key evolution of this project is migrating from a human-started script to a fully AWS-orchestrated, event-driven autonomous intelligence layer.

Vision & What the Agent Does

The system relies on an infrastructure anchored by Amazon EventBridge Scheduler. Instead of waiting for a user to open an IDE or click run, EventBridge automatically awakens the system on a cron schedule based on standard market closure tracking. This serves as the structural transition from an interactive program to an autonomous, hands-off system.
Once awakened, the scheduler hands off execution to an AWS Lambda core. The function establishes connections to open web resources to pull real-time data dynamically:
  1. Index Universe Extraction: It parses the live Wikipedia directory of S&P 500 listings using low-overhead regular expression streams to pull down precise tickers and corresponding asset descriptions without external heavy scrapers.
  1. Quantitative Data Sourcing: It streams historical pricing matrices directly via the Yahoo Finance charting endpoints using standard native request-response protocols.
The analytical engine maps historical market capitalizations, closing thresholds, and rolling daily percentages to isolate specific market clusters. It extracts the top 10 daily gainers and top 10 daily decliners across all 500 constituent companies.
The core intelligence layer focuses on the Value Review Radar. Rather than simply listing every negative equity movement, it isolates sharp, anomalous technical drawdowns where a single-day sell-off exceeds 5%. This filter serves as an automated risk-review mechanism, highlighting specific market anomalies that require deeper quantitative or fundamental examination without requiring manual portfolio screening.



AWS Services Used & Architecture Overview

To achieve extreme execution speed, zero cold-start bottlenecks, and stay 100% within the AWS Free Tier, the architecture uses a single-node serverless orchestration pattern built with zero external third-party package dependencies.

  • Amazon EventBridge Scheduler: Acts as the persistent system clock, issuing automated invocations to guarantee execution happens without active user presence.
  • AWS Lambda Core: Built entirely on native Python packages ( urllib.request ,  re ,  html ,  json ), this compute engine parses all 503 tickers, processes historical pricing vectors, and maps risk-review parameters in a single stateless execution loop.
  • Amazon SES (Simple Email Service): Translates calculated analytical frames into a beautifully formatted, inline-styled responsive HTML executive dashboard delivered straight to the end-user's inbox.

Infrastructure Verification & Proof-of-Configuration

To verify the production-ready infrastructure of the automated delivery mechanism, the communication endpoint is fully verified within Amazon Simple Email Service (SES):




How It Was Built & What Was Learned

Building an agent with a constraint of zero external package installations ( pandas ,  requests , or  beautifulsoup4 ) required a deep focus on native Python efficiency.
# Low-overhead HTML parsing using native regular expressions
tables = re.findall(r"<table[^>]*>.*?</table>", page, re.S | re.I)
for table in tables:
if "Symbol" not in table or "Security" not in table:
continue
rows = re.findall(r"<tr[^>]*>(.*?)</tr>", table, re.S | re.I)

The data processing logic was structured to handle network timeouts and variable API payload shapes gracefully. If a single asset endpoint throws an anomaly or data is missing, the agent catches the exception inline, logs the failure to Amazon CloudWatch, and continues evaluating the remaining index components to ensure complete report delivery.

Operational Proof: Always-On Automation

The defining metric of an autonomous agent is its ability to operate independently of human interactions. Below is the operational execution snapshot of the active Amazon EventBridge Scheduler workflow tracking future daily automated trigger dates:

When the schedule fires, the final user experience completely bypasses terminal outputs, sending a structured narrative summary directly to the end-user's mailbox without a single button click:


The full video demonstration of the Email Output has also been added to the GitHub repository for reference.
Note: The report is generated automatically at 7:00 AM (via Amazon EventBridge) before the U.S. stock market opens. Therefore, it analyzes data from the most recently completed U.S. trading session, rather than intraday market activity.
The attached screenshot contains a Daily Market Intelligence Report generated automatically on July 17, 2026, at 7:00 AM, using market data from the July 16, 2026 U.S. trading session.During the analysis window, 24 companies triggered the risk threshold criteria, and the report highlights the top 10 highest-priority signals for focused review.
Key Takeaways:
  • Stateless Component Design: Writing clean, native, decoupled parsing pipelines removes the operational overhead of managing heavy deployment packages or containerized environments.
  • Autonomous UX: Designing for an autonomous agent changes the engineering mindset. The value isn't just in the mathematical filters, but in designing the end-state experience ensuring a polished, structured HTML report is waiting in the user's inbox exactly when they need it, completely unprompted.


Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article