This is a vibe coding exercise β a challenge to build a complete, statistically rigorous mean-reversion analysis platform using only the detailed documentation provided. No hand-holding, no starter code. Just specs, architecture docs, and your engineering skills.
Build RevertIQ: an API-first platform that analyzes historical market data to identify statistically significant mean-reversion trading windows. Think "Stripe for quant analytics" β clean APIs, reproducible results, and production-ready infrastructure.
All specs are in /docs
:
- 01-product-requirements.md β Mathematical foundation, metrics, and statistical tests
- 02-api-specification.md β Complete REST API contract with request/response schemas
- 03-system-architecture.md β System design, data flow, deployment blueprint
- 04-ux-design.md β User experience philosophy and persona journeys
- 05-wireframe-flows.md β UI/CLI interaction flows and wireframes
Your implementation is successful when:
- POST /v1/analyze accepts ticker + parameters, returns ranked mean-reversion windows
- Walk-forward validation prevents overfitting (train/test splits)
- Statistical rigor: FDR correction, bootstrap CIs, stationarity tests
- Cost modeling: realistic transaction costs integrated into returns
- Async support: handle long-running jobs with status polling
- Integrates with Polygon.io (or similar) for market data
- Computes z-scores with configurable detrending (EMA/SMA/VWAP)
- Implements Ornstein-Uhlenbeck half-life estimation
- Runs ADF, KPSS, Hurst tests for mean-reversion validation
- Applies Benjamini-Hochberg FDR correction for multiple testing
- Deterministic: same inputs β identical outputs (data hashing + versioning)
- Provenance: every response includes data_hash, version, timestamps
- Caching: intelligent result caching with TTL
- Rate limiting: per-tenant quotas
- Error handling: structured error responses with field-level validation
- CLI tool with pretty table output
- Web dashboard with heatmap visualization
- Webhook support for async notifications
- Docker/K8s deployment configs
- Comprehensive test suite (unit + integration)
- Read all docs thoroughly
- Set up project structure (language of your choice)
- Implement data ingestion from Polygon API
- Build z-score calculation engine
- Implement walk-forward optimization
- Add statistical tests (ADF, KPSS, Hurst)
- Build FDR correction logic
- Create cost modeling layer
- Implement REST endpoints per spec
- Add authentication & rate limiting
- Build job queue for async processing
- Implement result caching
- Add provenance & versioning
- Build CLI tool
- Create deployment configs
- Write tests & documentation
Backend: Python (pandas, numpy, statsmodels) or Rust (polars, ndarray)
API: FastAPI, Flask, or Axum
Queue: Redis, RabbitMQ, or SQS
Storage: PostgreSQL + S3/MinIO (Parquet files)
Cache: Redis/KeyDB
Data: Polygon.io API (free tier available)
- Statistical rigor: Not just backtesting β proper hypothesis testing and multiple-testing correction
- Reproducibility: Deterministic outputs with full provenance tracking
- Performance: Efficient vectorized operations on large time series
- API design: Clean, well-documented REST API with proper error handling
- Production-ready: Caching, rate limiting, async jobs, observability
By completing this exercise, you'll gain deep experience in:
- Quantitative finance fundamentals (mean reversion, z-scores, OU processes)
- Statistical hypothesis testing and multiple-testing corrections
- Time-series analysis and stationarity tests
- API design and async job processing
- Data engineering (Parquet, caching, provenance)
- Production system architecture
When you're done:
- Demo video: Show POST /analyze β results with heatmap
- Code walkthrough: Explain key architectural decisions
- Test results: Show statistical validation on real data
- Deployment: Bonus points for live API endpoint
Share your progress, ask questions, and help others:
- Tag your repos with
#revertiq-vibe-coding
- Share interesting findings (e.g., "AAPL really does revert on Tuesday mornings!")
- Compare implementations across different tech stacks
This exercise and documentation are provided as-is for educational purposes.
Ready to vibe code? Start with docs/01-product-requirements.md
and build something amazing. π