What is MarS
MARS (Market Simulation) is a financial market simulation and prediction engine launched by Microsoft Research Asia, based on the generative foundation model LMM (Large Market Model) to simulate order flow and market dynamics in financial markets. MARS can create realistic, interactive, and controllable market environments for financial applications such as training trading strategies, risk management, market impact analysis, and prediction, without bearing actual financial risk. Based on simulation, MARS supports users in testing and optimizing financial strategies in a risk-free environment, while providing a powerful tool for financial research and education.
Main features of MARS
- Prediction tool: Generates subsequent orders based on recent orders and the limit order book (LOB), simulates future market trajectories, and enables precise market trend prediction.
- Detection system: Simulates multiple future market trajectories, identifies potential risks that cannot currently be observed, such as a sudden decrease in trajectory variance that may indicate the occurrence of a major event, providing early warning and enhanced risk management.
- Analysis platform: MARS can answer various "what if" questions, provide a realistic simulation environment, evaluate the market impact of large orders, identify potential improvement points based on comparing existing market impact formulas with simulation results, and deeply understand market dynamics.
- Agent training environment: MARS's realism and responsiveness make it an ideal environment for training reinforcement learning agents, demonstrating MARS's potential in developing and refining trading strategies without actual financial risk.
Technical principles of MARS
- Order sequence modeling: Uses a causal transformer to encode order sequences, where each order together with its preceding LOB information is encoded as a single token, reflecting the sequential nature of market orders and ensuring that each order's context within broader market activity is preserved.
- Order batch sequence modeling: Applies an auto-regressive transformer to model order batch sequences, capturing structured patterns of the market within aggregated time intervals (such as minutes or hours).
- Integrated model: Combines order sequence modeling and order batch sequence modeling, balancing the fine-grained control of the order model and the broader market dynamics captured by the order batch model, achieving improved market modeling and generation.
- Fine-grained signal generation interface: Introduces a fine-grained signal generation interface that maps vague descriptions in natural language or general configurations to fine-grained control signal sequences. The signals guide the integrated model, ensuring that the simulation follows realistic market patterns and conforms to user-defined scenarios.
- Simulated clearing house: After pre-training the LMM, generates realistic order flow for market simulation. The simulated clearing house matches generated and interactive orders, providing the information needed for subsequent order generation (such as the LOB).
- Balancing market impact and control signals: During the order batch generation process, follows two guiding principles to ensure realistic simulation and realize MARS's three characteristics: shaping the future based on realized reality and selecting the best match from every possible future.
MARS project address
- Project website:mars-lmm
- GitHub repository:https://github.com/microsoft/MarS/
- arXiv technical paper:https://arxiv.org/pdf/2409.07486
MARS application scenarios
- Trading strategy testing and optimization: Using MARS to simulate different market conditions, traders can test and optimize trading strategies in a risk-free environment.
- Risk Management: Simulating market trajectories helps identify potential market risks and enhances risk management capabilities.
- Market Impact Analysis: Simulating the impact of large orders on the market helps analysts and traders understand market dynamics and price movements.
- Predicting Market Trends: Predicting future market movements based on historical data and current market conditions.
- Regulatory Compliance: Regulatory agencies detect illegal trading activities such as market manipulation, using simulated market behavior to identify anomalous patterns.