microsoft/MarS
MarS: a Financial Market Simulation Engine Powered by Generative Foundation Model
What it solves
MarS is a financial market simulation engine that generates realistic, interactive, and controllable order-level data. It replaces traditional price-prediction models or theoretical formulas with a generative foundation model (Large Market Model) to simulate how individual orders (price, volume, direction) interact to create emergent market behavior.
How it works
MarS uses a Large Market Model (LMM) to generate individual order events. Instead of predicting a final price, it simulates the fundamental units of market activity. The engine consists of three core components:
- OrderModel: Generates the specific properties of orders.
- OrderState: Represents and updates the current state of the market.
- BackgroundAgent: Manages the order generation process.
To analyze markets, the system runs multiple trajectories (simulations) from a starting state to explore a distribution of possible outcomes. It is deployed using Ray Serve for scalable inference.
Who it’s for
- Quantitative Researchers: To test trading strategies and analyze market impact without real-world financial risk.
- Financial Analysts: To forecast market trends by simulating order-level trajectories.
- Market Designers: To evaluate how different market characteristics (stylized facts) are reproduced in simulated environments.
Highlights
- Order-Level Simulation: Shifts the paradigm from direct price prediction to simulating individual order events.
- Stylized Fact Validation: Successfully reproduces 9 out of 11 empirical market patterns (stylized facts) observed in real historical data.
- Market Impact Analysis: Allows for counterfactual analysis by comparing market behavior with and without specific trading strategies (e.g., TWAP agents).
- Scalable Architecture: Supports various model sizes (2M to 10M released) and utilizes Ray Serve for production-ready deployment.
Related
- Project
- Project
- Project
- Project