Build 13-F Hedge Fund Inflow Analyzer

Resolved 💬 2 comments Opened Dec 24, 2025 by tictcotq Closed Dec 24, 2025

Goal

Build an application to analyze SEC 13-F filings from hedge funds to identify stocks with higher-than-average inflows in a given quarter.

Research Summary

Data Source

Storage Estimates

| Period | Compressed | Uncompressed |
|--------|------------|--------------|
| 1 quarter | ~80 MB | ~400 MB |
| 8 quarters | ~640 MB | ~3 GB |
| Full history (2013+) | ~4 GB | ~20 GB |

Data Format (inside ZIP)

  • SUBMISSION.tsv - filing metadata
  • INFOTABLE.tsv - holdings data
  • COVERPAGE.tsv - manager info

Proposed Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   1. DOWNLOADER │ --> │   2. LOADER     │ --> │   3. ANALYZER   │
│  (fetch ZIPs)   │     │ (TSV → SQLite)  │     │  (run queries)  │
└─────────────────┘     └─────────────────┘     └─────────────────┘
        │                       │
        v                       v
   data/zips/              SQLite DB

Stage 1: Downloader

  • Fetch quarterly ZIP files from SEC
  • Store in data/zips/
  • Track download state in manifest

Stage 2: Loader

  • Extract TSV files from ZIPs
  • Load into SQLite database
  • Compute quarter-over-quarter changes

Stage 3: Analyzer

  • Query DB for aggregated inflows per stock
  • Compute historical averages and z-scores
  • Output ranked list of anomalous inflows

Analysis Logic

"Higher-than-average inflows" defined as:

  1. Per stock per quarter: Sum all position increases across tracked funds
  2. Historical baseline: Same stock's average quarterly inflow over past 8 quarters
  3. Anomaly detection: Flag stocks where currentInflow > mean + 1.5 * stddev

Tech Stack

  • TypeScript (fits existing monorepo)
  • SQLite (local analysis, no server needed)
  • Commander.js (CLI)

Open Questions

  • [ ] Integrate into investing-toolkit monorepo or standalone?
  • [ ] Which funds to track? (Top N by AUM, all filers, custom list?)
  • [ ] Output format preferences (CSV, JSON, web UI?)

Tasks

  • [ ] Set up project structure
  • [ ] Implement downloader (Stage 1)
  • [ ] Implement loader (Stage 2)
  • [ ] Implement analyzer (Stage 3)
  • [ ] Add CLI commands
  • [ ] Add tests

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗