MarketSim: Simulating Stock Markets with Large-Scale Generative Agents
Abstract
Stock markets are one of the most complex systems in the modern world, where prices emerge from billions of decentralized interactions among heterogeneous participants in an ever-evolving information landscape. While high-fidelity simulation is important for understanding market dynamics, existing approaches face a persistent trade-off between structural and behavioral fidelity. To this end, we propose MarketSim, a large-scale stock market simulation framework with generative agents. MarketSim introduces a hierarchical multi-agent architecture that decouples strategic reasoning from high-frequency execution, enabling LLM agents to operate in a nanosecond-resolution, NASDAQ-like continuous double auction market. Building on this, we simulate over 15,000 heterogeneous market participants whose interactions shape and are shaped by an evolving market environment grounded in more than 12k real-world news articles, policy documents, and earnings reports. To evaluate our proposed MarketSim, we develop a comprehensive benchmark that includes stocks from 8 GICS sectors and 3 representative real-world scenarios, along with 5 stylized facts for market complexity and 5 price-related statistical metrics. Extensive experiments demonstrate that MarketSim not only captures key complexity properties of real-world markets, but also outperforms state-of-the-art baselines in tracking high-frequency price dynamics with an average MAPE of 3.48%, providing a scalable testbed for market analysis.
Lay Summary
Stock markets are difficult to understand because prices emerge from the decisions of many different participants reacting to news, policies, company reports, and each other. Existing market simulators often face a trade-off: they either model the trading rules of real exchanges in detail, or they model more realistic human-like decision making, but rarely both. We built MarketSim, a large-scale stock market simulator powered by generative AI agents. In MarketSim, AI fund-manager agents read market information and form trading intentions, while trader agents execute these intentions in a high-frequency, NASDAQ-like market. The simulator includes more than 15,000 heterogeneous market participants and is grounded in real-world news, policy documents, and earnings reports. We evaluate MarketSim on 12 stocks across 8 industrial sectors and 3 real-world shock scenarios. The results show that MarketSim can reproduce important patterns observed in real markets and track high-frequency price dynamics more accurately than baseline methods. This provides a useful research testbed for studying how market shocks unfold and for stress-testing possible risk scenarios in a controlled environment.