Towards a fully rl-based market simulator

Leo Ardon, Nelson Vadori, Thomas Spooner, Mengda Xu, Jared Vann, Sumitra Ganesh

Introduction

Understanding the complex interplay between actors in financial markets is a fundamental challenge in quantitative finance. Traditional approaches often rely on statistical models that view participants in isolation or multi-agent systems (MAS) governed by rigid, hand-coded heuristics. These methods frequently fail to capture the adaptive, strategic nature of real-world trading. Researchers from J.P. Morgan AI Research have addressed this gap by developing a multi-agent market simulator where both Liquidity Providers (LPs) and Liquidity Takers (LTs) are controlled by Reinforcement Learning (RL) agents.

Methodology: A Partially Observable Stochastic Game

The simulator models the market as a Partially Observable Stochastic Game, consisting of three primary components:

  1. Liquidity Providers (LPs): RL agents that set bid and ask prices, aiming to maximize profit while managing inventory risk and maintaining market share.
  2. Liquidity Takers (LTs): RL agents that respond to LP quotes. They can range from "flow-driven" (executing trades regardless of price) to "PnL-driven" (trading only when advantageous).
  3. Electronic Communication Network (ECN): A statistical model calibrated with L2-level order book data that replicates real-world volume and price variations using multivariate Gaussian mixture models.

Key Innovations

To manage the complexity of thousands of agents, the authors utilize Shared Policies, where a single neural network is trained for the entire family of LPs and another for LTs. Furthermore, Parametrized Rewards allow agents to be assigned a "type" parameter ($w$) at the start of an episode. This parameter weights different objectives, enabling a single trained policy to interpolate across a vast range of behaviors, from purely flow-driven to highly sophisticated profit-driven strategies.

Emergent Market Dynamics

One of the most significant findings is the emergence of sophisticated trading strategies without explicit programming. As the reward parameter $w$ increases, shifting the LT agent's focus toward profit maximization, the agent learns to time the market effectively.

Emergent trading behaviors as the reward parameter $w$ shifts from flow-driven ($w=0.0$) to PnL-driven ($w=1.0$).

As shown in Figure 5, when $w=0.0$, the LT trades continuously (flow-driven). However, as $w$ approaches 1.0, the agent discovers a "buy low, sell high" strategy, selectively trading only at price extremes. This "informed" behavior puts pressure on LPs, who respond by widening spreads to protect themselves from being "picked off."

Risk and Profitability Analysis

The simulator allows for a granular analysis of how different agent types impact market stability and profitability. The distribution of Profit and Loss (PnL) reveals the inherent trade-offs in these roles.

PnL distributions for Inventory and Spread across different agent types, highlighting the trade-offs between market-making and informed trading.

Figure 6 illustrates that LPs (green) maintain a broad spread PnL distribution, reflecting their role in capturing the bid-ask spread while managing inventory risk. In contrast, Flow LTs (blue) show a concentrated negative spread PnL, representing the cost they pay for immediate liquidity. PnL-driven LTs (orange) shift the distribution, demonstrating how informed flow can extract value from the market, often at the expense of the market maker's spread.

Conclusion and Future Work

This RL-based simulator provides a powerful tool for observing emergent market behaviors and the co-evolution of trading strategies. By making both sides of the trade "intelligent," the researchers have created a more dynamic and realistic environment for financial research. Future work aims to replace the statistical ECN with a learning agent and incorporate variable trade quantities to further enhance the simulator's fidelity to real-world market conditions.

Summary updated

BibTeX
@inproceedings{ardon2021towards,
  author = {Leo Ardon and Nelson Vadori and Thomas Spooner and Mengda Xu and Jared Vann and Sumitra Ganesh},
  title = {{Towards a fully rl-based market simulator}},
  booktitle = {ICAIF},
  year = {2021},
  url = {https://openreview.net/forum?id=fvCVH3hUh2},
}
Figure