Source-linked AI summary

Simulating Financial Market via Large Language Model based Agents

Shen Gao, Yuntao Wen, Minghang Zhu, Jianing Wei, Yuhan Cheng, Qunzi Zhang, Shuo Shang

arXiv:2406.19966v1cs.CL

TL;DR

Traditional economic models based on rationality do not fully capture complex human behavior. ASFM combines a simulated stock market with LLM-based trading agents; experiments report consistency with real-market behavior and preliminary economics findings.

  • Problem

    Traditional economic methods based largely on rationality cannot fully capture complex human behavior in markets.

    Source: §1 · p. 1
  • Method

    ASFM combines a simulated stock market with real-market order matching and LLM-based agents that observe market conditions and trade using strategy profiles and tool learning.

    Source: §1 · p. 2
  • Results

    ASFM's simulated-market observations are reported as consistent with real-world markets, and its findings in two economic research scenarios align with preliminary research findings.

    Source: §1 · p. 2
  • Takeaways & Limitations

    ASFM provides a simulated market framework for exploring trader behavior bias and large-trader impact.

    Source: §1 · p. 2

    ASFM remains a pilot study, and its scope omits participants and behaviors such as banks, loans, bond issuance, and broader asset types.

    Source: §5 · p. 8

Abstract

from arXiv · show

Most economic theories typically assume that financial market participants are fully rational individuals and use mathematical models to simulate human behavior in financial markets. However, human behavior is often not entirely rational and is challenging to predict accurately with mathematical models. In this paper, we propose \textbf{A}gent-based \textbf{S}imulated \textbf{F}inancial \textbf{M}arket (ASFM), which first constructs a simulated stock market with a real order matching system. Then, we propose a large language model based agent as the stock trader, which contains the profile, observation, and tool-learning based action module. The trading agent can comprehensively understand current market dynamics and financial policy information, and make decisions that align with their trading strategy. In the experiments, we first verify that the reactions of our ASFM are consistent with the real stock market in two controllable scenarios. In addition, we also conduct experiments in two popular economics research directions, and we find that conclusions drawn in our \model align with the preliminary findings in economics research. Based on these observations, we believe our proposed ASFM provides a new paradigm for economic research.

1 Introduction

Traditional economic models struggle to capture complex human behavior, while human-subject trading experiments are costly and difficult to scale. The paper proposes ASFM, a simulated stock market with LLM-based traders, and reports consistency with real-market behavior and preliminary economics findings.

1 Introduction

  • Traditional economic theories often assume rational participants, but these approaches cannot fully capture complex human behavior.The paper also notes that irrational behavior is difficult to predict with mathematical models.Source: §1 · pp. 1–2
  • Human-subject experiments can test economic theories and market mechanisms, but are costly and difficult to scale to large, long-term studies.Source: §1 · p. 2
  • ASFM combines a simulated stock market and LLM-based traders with diverse profiles, market observation, and tool-learning-based trading actions.Its market includes listed companies and an order-matching system, and it simulates participant proportions to make trading data more like real-market data.Source: §1 · p. 2
  • ASFM is reported to reproduce real-market principles in two controlled scenarios and align with preliminary findings in two economic research directions.The scenarios examine interest-rate changes and inflation shocks; the further directions examine trader behavior bias and large-trader impact.Source: §1 · p. 2
  • The authors argue that integrating LLMs with financial mechanisms could transform economic research and policy analysis.Source: §1 · p. 2

2 ASFM Framework

ASFM models listed companies and trader agents in a simulated market where orders are matched and prices updated. The framework connects agent profiles and observations to tool-based trading decisions.

2.1 Problem Formulation

  • The formulation represents listed companies, traders, holdings, cash, market observations, and buy, sell, or hold tools that generate trading code and orders.Source: §2.1 · pp. 2–3

2.2 Overall Framework

  • The framework combines a simulated stock market with LLM-based trading agents, and contrasts agent-only simulation with traditional research involving human annotators.The market uses order matching and daily price updates; agents use profiles, market observations, and tool learning to trade.Source: §2.2 · p. 3, Figure 1 · p. 3

2.3.1 Listed Company

  • Simulated companies reflect real-market industry-sector proportions, use business descriptions and historical prices, and start from real stock prices for five days.Source: §2.3.1 · p. 3

2.3.2 Order Matching System

  • Opening matching prioritizes the lowest asks and highest bids, while continuous matching exposes unmatched orders so agents can adjust bids and place new orders.The day’s average transaction price becomes each stock’s closing price.Source: §2.3.2 · p. 4

2.4 LLM-based Trading Agent

Trading agents receive strategy profiles and account information, observe stock and policy data, then use documented trading tools to execute actions. These modules connect an agent’s stated preferences and current market context to constrained buy, sell, or hold decisions.

2.4.1 Agent Profile

  • Profiles assign value, institutional, contrarian, or aggressive strategies and provide account information on cash, holdings, and returns.The value-investor example seeks stocks priced below intrinsic value and high-quality companies undervalued by the market.Source: §2.4.1 · p. 4

2.4.2 Agent Observation

  • Agents observe 15 days of stock prices, historical order-book prices, and current economic-policy news to inform investment actions.Source: §2.4.2 · pp. 4–5

2.4.3 Agent Action

  • Agents use documented buy, sell, and hold tools, each parameterized by stock code, quantity, and price; each agent may buy or sell a given stock at most twice daily.Source: §2.4.3 · p. 5

3 Experimental Setup

The experiments evaluate ASFM’s trading dynamics, test agent modules, and model companies and investors using China A-share market characteristics. They examine controlled policy shocks and vary investor behavior and trader capital to study market responses.

3.1 Evaluation Metrics

  • Order Number, Order Execution Rate, Turnover Rate, and Volatility measure orders, execution, trading activity, and price fluctuations, respectively.The metrics are used to evaluate trading dynamics in the simulated market.Source: §3.1 · p. 5

3.2 Ablation Models

  • The ablations replace diverse profiles with a shared simple trading instruction or remove observation, leaving recent stock prices as input.These variants test the effectiveness of the profile and observation modules.Source: §3.2 · p. 5

3.3 Simulated Stocks

  • Simulated companies draw on real listed companies’ business descriptions and cover 11 industry sectors.The sector mix includes energy, materials, industrial, consumer discretionary and staples, healthcare, financial, information technology, telecommunication services, utilities, and real estate.Source: §3.3 · p. 5

3.4 Simulated Agents

  • The simulated agents use four investor strategies, with their proportions and initial capital based on China’s A-share market.Value, institutional, contrarian, and aggressive investors are represented in a 2:1:1:1 ratio, with initial capital of 20K, 15K, 0.4K, and 6K, respectively.Source: §3.4 · p. 5

3.5 Simulated Scenarios

  • Scenarios test interest-rate cuts and inflation shocks, then vary investor-type proportions and agent capital to examine behavioral bias and large-trader impact.The framework compares all-value and all-aggressive investor markets with the real-market mix, and varies starting capital to examine returns.Source: §3.5 · p. 6

4 Experimental Results

ASFM’s simulated market responds to policy shocks in ways the paper says align with economic theory, while changes in investor composition and trader capital produce different market outcomes. Ablations also show distinct effects when the agent profile or observation module is removed.

4.1 Ablation Study

  • Removing the profile module yields the lowest turnover rate and volatility, while removing observation increases volatility and order execution rate.The authors attribute the profile result to converging actions that can make trades harder to complete, and the observation result to more random, uninformed trading.Source: §4.1 · pp. 6–7

4.2 Policy Shock Analysis: Influence of Cutting Interest Rates

  • After a Federal rate-cut announcement, average stock returns gradually increase, while real estate and financial stocks show different responses.The paper reports this pattern as consistent with economic theory; it describes real estate and energy as potentially benefiting from lower financing costs and banks as potentially facing narrower net interest margins.Source: Figure 2 · p. 7, §4.2 · p. 7

4.3 Influence of Inflation Shock

  • Both excessively high and low inflation reduce returns, while inflation between 2–3% corresponds to relatively high agent and overall market returns.The simulation informs agents of the inflation rate through news and evaluates returns after 30 trading days.Source: Figure 3 · p. 7, §4.3 · p. 8

4.5 Exploring the Large Trader Impact

  • After 30 trading days, small traders generally show higher return growth than large traders, whose returns are poorer.The authors suggest large traders may have difficulty finding enough trading counterparts, making their actions less flexible, and state that the result aligns with preliminary economic conclusions.Source: Figure 4 · p. 7, §4.5 · p. 8

4.4 LLM and Behavioral Economics: Exploring the Trader with Behavior Bias

  • An all-value-investor market has volatility 0.1% lower than the real-market mix, while an all-aggressive market has higher order quantity, turnover, and volatility.The paper presents this as a simulation of investor behavior bias; it argues LLM agents can incorporate behavioral characteristics and biases into economic models.Source: §4.4 · p. 8

5 Future Directions

ASFM is presented as a pilot study, with future work needed to expand its market components, company dynamics, and modeled agent behaviors.

5 Future Directions

  • The authors characterize ASFM as a pilot study of LLM-based agents in economic modeling, with further directions to explore.Source: §5 · p. 8
  • The market should incorporate participants and behaviors such as banks, loans, bond issuance, and a wider variety of assets.The paper notes that these are important real-market components whose economic impacts should be considered.Source: §5 · p. 8
  • Listed companies’ operational status should change with market fluctuations and affect their stock prices.Source: §5 · p. 9
  • Agents should model additional behaviors, including employment, mutual-fund purchases, and real-estate purchases, which may affect personal assets.Source: §5 · p. 9

6 Related Work

Prior work applies LLM agents to multiple tasks, including economics, while ASFM differs from a macroeconomic approach by making market decisions fully agent-based and observation-driven.

6 Related Work

  • LLM-agent research has explored profiles, memory, planning, executable actions, and collaboration across tasks such as travel planning and software development.The cited work also covers recommendation systems and multimodal tasks.Source: §6 · p. 9
  • LLMs have been applied in economics to financial sentiment analysis, text classification, named entity recognition, and stock-movement prediction.The passage cites examples of ChatGPT sentiment analysis correlated with market movements, financial-data-and-news price prediction, and expert-role synthesis.Source: §6 · p. 9
  • Unlike [51], which uses LLM agents to predict numerical indices within mathematical bank and government models, ASFM makes decisions through agents observing the market.The authors describe this as a fully agent-based microeconomic model and a new paradigm for modeling complex human behavior.Source: §6 · p. 9

7 Conclusion

ASFM combines an LLM-based trader with a simulated market and real trading mechanism, then evaluates the framework across four scenarios. The authors report that it reflects market dynamics and policy information, with behavior aligned to trading strategies.

7 Conclusion

  • ASFM’s trader uses profile instructions, market and policy observation, and a tool-learning-based action module.Source: §7 · p. 9
  • The simulated market uses an actual trading mechanism and allows agents with different strategies and initial capital to trade.Source: §7 · p. 9
  • Four scenarios test a federal interest-rate cut, inflation shock, trader behavior bias, and large-trader impact.Source: §7 · p. 9
  • The authors report that ASFM understands market dynamics and financial policy information, with agents making strategy-aligned decisions that mirror human behavior’s complexity and variability.The paper presents ASFM as a new perspective for more dynamic and realistic financial-market simulation research.Source: §7 · p. 9

A.1 Instruction of Agent Trading Strategy

The agent-trading instructions distinguish four investor profiles, each with a different stated preference and trading horizon.

A.1 Instruction of Agent Trading Strategy

  • Value investors seek stocks priced below intrinsic value and favor fundamental analysis and long-term stable returns over short-term fluctuations.Source: §A.1 · p. 13
  • Institutional investors represent large investment companies, use in-depth analysis and risk management, and seek stable, reliable returns.Source: §A.1 · p. 13
  • Contrarian investors buy when sentiment is low and sell when it is high, relying on patience, market psychology, and fundamental analysis.Source: §A.1 · p. 13
  • Aggressive investors pursue short-term profits through quick trades informed by technical analysis and market trends, accepting higher risk.Their instructions emphasize monitoring market dynamics and being ready to enter or exit quickly.Source: §A.1 · p. 13

A.2 Detailed Definition of Companies

The simulated market defines ten listed companies across diverse sectors, with an initial price series specified for each.

A.2 Detailed Definition of Companies

  • EN001 represents oil and gas, MA002 chemical materials, IN003 industrial equipment, and CC004 consumer electronics, each with specified initial prices.Their profiles span extraction, materials used in construction and manufacturing, mechanical equipment and automation, and high-end products such as smartphones and laptops.Source: §A.2 · p. 13
  • DC005 covers daily consumer goods, HC006 healthcare, FI007 financial services, and IT008 software and information technology, each with specified initial prices.The profiles include food and beverages, medical devices and pharmaceuticals, banking, insurance and asset management, and software development and IT services.Source: §A.2 · p. 13
  • TS009 represents telecommunications, UT010 utilities, and RE011 real estate development and management, each with specified initial prices.The profiles describe data and communication services; water, electricity and natural gas; and commercial and residential projects.Source: §A.2 · p. 14
Loading 2406.19966v1…