This project is a professional-grade ETF Risk Monitoring system built to continuously monitor a portfolio of ETFs for:
- Price deviations from NAV
- 30-day NAV decay
- Trading volume collapses
- AUM (Assets Under Management) decline
If a risk threshold is breached, email and SMS alerts are automatically sent โ including recommended actions for portfolio protection.
โ
Fully Dockerized
โ
Automatic daily AUM checks
โ
Hourly price/volume/NAV checks
โ
Log rotation
โ
Designed for 24/7 unattended operation
- High-yield ETFs (e.g., YieldMax series) are newer and carry closure/liquidity risks.
- AUM or trading volume declines are early warning signs of trouble.
- Manually monitoring dozens of ETFs is inefficient and unreliable.
- Professional monitoring services like Bloomberg Terminal cost $24,000+/year.
This system replicates professional-grade monitoring for almost zero cost.
| File | Purpose |
|---|---|
app.py |
Core monitor: checks price, volume, NAV, and AUM. Runs hourly. |
alert_emailer.py |
Sends email and SMS alerts via Gmail SMTP |
build.sh |
Builds and restarts Docker container cleanly |
fire_monitor_once.py |
Runs a one-time forced monitoring cycle manually for testing |
test_monitor.py |
Fires a manual test email/SMS to verify alert system |
config.yaml |
Defines tickers, thresholds, email settings, and API keys |
aum_tracker.json |
Stores previous AUM values for comparison |
last_aum_check.txt |
Stores timestamp of last AUM check to avoid overchecking |
Dockerfile |
Defines lightweight Python environment for Docker build |
requirements.txt |
Python dependencies |
Every hour:
- Pull latest prices/volumes from Polygon.io (15-min delayed Starter plan)
- Pull latest NAVs from Yahoo Finance
- Detect:
- Price/NAV deviation >2%
- NAV decay >5% over 30 days
- Volume drop >30% below average
Every 24 hours:
- Pull AUM values from Yahoo
- Detect:
- AUM below $50M
- AUM drop >20% compared to last check
โ If any issues are detected, an instant alert is emailed and SMS'ed to you.
โ Alerts include "Recommended Actions" depending on the issue type.
Edit config.yaml:
tickers:
- MRNY
- TSLY
- YETH
- QQQY
- FIAT
- YMAG
- YMAX
- LFGY
- GPTY
- WDTE
- JEPI
- JEPQ
polygon_api_key: "your_polygon_api_key_here"
email_settings:
smtp_server: "smtp.gmail.com"
smtp_port: 587
sender_email: "yourgmail@gmail.com"
sender_password: "your_gmail_app_password" # (From Google App Passwords, NOT your main password)
receivers:
- "youremail@example.com"
- "yournumber@txt.att.net" # SMS Gateway email address
๐ Checking MRNY...
๐ต Polygon Aggregates Response (MRNY): 200 {'results': [...]}
๐ฒ Final Price: 2.52, ๐ Volume: 1,650,400, ๐งฎ NAV: 2.55, ๐ก Data Source: Polygon (Delayed Aggregate)
๐ Premium/Discount: 1.27%
๐ 30d NAV drop: 3.99%
๐ Volume drop vs 30d avg: -24.11%
โ
MRNY passed all checks.
๐ FIAT AUM: 48,900,000
๐จ FIAT: AUM below $50M!
โ
Alert email sent: โ ๏ธ ETF AUM Risk Alert
โ ๏ธ ETF Risk Alert for FIAT
FIAT: NAV has dropped 12.31% over 30 days.
๐ Recommendation:
Review fund health. Significant NAV decline could signal asset weakness.
Consider reducing exposure if trend persists.