AB
AiBoss
project

MarS - Microsoft Research Asia's open-source financial market simulation and prediction engine

MARS (Market Simulation) is a financial market simulation and prediction engine developed by Microsoft Research Asia. It simulates order flows and market dynamics in financial markets based on a generative base model, the LMM (Large Market Model).

What is MarS?

MARS (Market Simulation) is a financial market simulation and prediction engine developed by Microsoft Research Asia. Based on a generative base model (LMM), it simulates order flows and market dynamics in financial markets. MARS creates realistic, interactive, and controllable market environments for training trading strategies, risk management, market impact analysis, and forecasting, without incurring actual financial risk. Through simulation, MARS allows users to test and optimize financial strategies in a risk-free environment, while also providing a powerful tool for financial research and education.

Main functions of MARS

  • Prediction toolsIt generates subsequent orders based on recent orders and limit order books (LOBs), simulates future market trajectories, and achieves accurate market trend prediction.
  • Detection systemSimulate various future market trajectories to identify potential risks that are not currently observable. For example, a sudden decrease in trajectory variance may indicate the occurrence of a major event, providing early warning and enhancing risk management.
  • Analysis PlatformMARS can answer various "what if" questions, provide a realistic simulation environment, assess the market impact of large orders, identify potential areas for improvement by comparing existing market impact formulas and simulation results, and gain a deeper understanding of market dynamics.
  • Agent training environmentThe realism and responsiveness of MARS make it an ideal environment for training reinforcement learning agents, demonstrating its potential in developing and refining trading strategies with no real financial risk.

MARS Technical Principles

  • Order sequence modelingThe order sequence is encoded using a causal transformer, where each order, along with its preceding LOB information, is encoded as a single token, reflecting the sequential nature of market orders and ensuring that the context of each order in the broader market activity is preserved.
  • Order batch sequence modelingThe auto-regressive transformer is used to model the order batch sequence to capture the structured patterns of the market within aggregation time intervals (such as minutes or hours).
  • ensemble modelThis approach combines order sequence modeling and order batch sequence modeling to balance the fine-grained control of the order model with the broader market dynamics captured by the order batch model, thereby achieving improved market modeling and generation.
  • Fine-grained signal generation interfaceA fine-grained signal generation interface is introduced to map fuzzy descriptions in natural language or general configurations to fine-grained control signal sequences. These signals guide the integrated model, ensuring that the simulation follows real-world market patterns and conforms to user-defined scenarios.
  • Simulated ClearinghouseAfter pre-training the LMM, a realistic order flow is generated for market simulation. The simulated clearinghouse matches generated and interacting orders, providing the information (e.g., LOB) needed for subsequent order generation.
  • The balance between market influence and control signalsDuring the order batch generation process, two guiding principles are followed to ensure that the three characteristics of MARS are realistically simulated and realized: shaping the future based on realized reality and selecting the best match from every possible future.

MARS project address

Application scenarios of MARS

  • Trading strategy testing and optimizationBy using MARS to simulate different market conditions, traders can test and optimize their trading strategies in a risk-free environment.
  • Risk ManagementSimulating market trajectories helps identify potential market risks and enhances risk management capabilities.
  • Market Impact AnalysisSimulate the impact of large orders on the market to help analysts and traders understand market dynamics and price movements.
  • Predicting market trendsPredicting future market trends based on historical data and current market conditions.
  • Regulatory complianceRegulatory agencies detect illegal trading activities such as market manipulation by using simulated market behavior to identify abnormal patterns.