MarS  by microsoft

Financial market simulation engine powered by a generative foundation model

Created 10 months ago
1,473 stars

Top 27.9% on SourcePulse

GitHubView on GitHub
Project Summary

MarS is a financial market simulation engine designed for realistic, interactive, and controllable order generation, powered by a generative foundation model. It targets researchers and practitioners in quantitative finance, offering a platform to build and test trading strategies, analyze market impact, and validate simulation realism against stylized facts.

How It Works

MarS simulates financial markets at the order level, modeling individual order events (price, volume, direction) rather than directly predicting prices. This approach allows emergent market behavior and exploration of multiple future scenarios. The core engine, mlib, handles orderbook updates and state management, providing a gym-like interface (Env) for agent interactions. States are automatically updated with trade information, allowing custom state definitions.

Quick Start & Requirements

  • Installation: Recommended via VS Code Dev Containers or Docker. Direct installation is not supported.
  • Prerequisites: Docker, VS Code (for Dev Containers), sufficient disk space for model download, and potentially 128 GPUs for full-scale experiments. CUDA is implied for GPU usage.
  • Setup: Clone the repository, configure data paths in .devcontainer.json or docker run command, build the container, and install dependencies (pip install -e .[dev]). Download necessary components with python download.py.
  • Resources: The project mentions utilizing 128 GPUs for experiments, indicating significant computational requirements for advanced simulations.
  • Links: 📄 Paper, 🏠️ Project Website, 💬 WeChat Group, 👾 Discord.

Highlighted Details

  • Evaluates 11 key market "stylized facts," successfully reproducing 9 out of 11 in simulations.
  • Demonstrates market impact analysis using a TWAP agent and forecast capabilities via order-level trajectory generation.
  • Leverages a Large Market Model (LMM), a generative foundation model, for order generation.
  • Uses Ray Serve for model deployment, with suggestions for optimization using systems like vLLM.

Maintenance & Community

The project is from Microsoft and has recently released its first version. It encourages community engagement via WeChat and Discord. The associated model is awaiting final review before public release.

Licensing & Compatibility

The repository is licensed under the MIT License. This license is permissive and generally compatible with commercial use and closed-source linking.

Limitations & Caveats

The core generative foundation model is not yet publicly released, limiting full functionality of demos and examples. Production deployment requires significant optimization and real-world order-level data. The project's experimental setup involves substantial GPU resources (128 GPUs mentioned).

Health Check
Last Commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
17 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Didier Lopes Didier Lopes(Founder of OpenBB), and
5 more.

qlib by microsoft

1.4%
31k
AI platform for quantitative investment research and production
Created 5 years ago
Updated 3 days ago
Feedback? Help us improve.