Lux, T. & Marchesi, M. · 1999
Scaling and criticality in a stochastic multi-agent model of a financial market
Nature 397, 498–500
The foundational paper. Defines the chartist-vs-fundamentalist dynamics this playground uses.
01 · The Playground
This is a live simulation of a financial market — built from interacting agents, not stochastic assumptions. Price is not input; it is an output of how traders decide. Adjust the mix below. Inject a shock. Watch volatility clusters, bubbles, and crashes emerge on their own.
Emergence · The Playground
Adjust the mix of trader types. Inject a shock. Watch prices emerge from their interactions — just like the real thing. No Gaussian assumptions. No closed-form pricing. Just agents.
Preset Scenarios
Buy when price < fair value
Follow momentum
Random decisions
Based on Lux & Marchesi (1999). Runs entirely in your browser. Deterministic given seed.
Most traders see charts. We show you the minds that draw them.
02 · The Model
Most financial models assume prices follow a clean stochastic process — Geometric Brownian Motion, Heston, jump-diffusion. These models give you closed-form answers but hide the ugly truth: markets are not noise-generating machines. They are people trading.
In 1999, Thomas Lux and Michele Marchesi published a different kind of market model in Nature. Instead of assuming a price process, they simulated the traders. Heterogeneous agents with simple rules. Different beliefs. Different reaction functions. And they found something remarkable: the price that emerged looked exactly like real markets — fat-tailed returns, volatility clustering, bubbles, crashes.
This playground is a reduced version of that idea. Four agent types. Deterministic rules. Everything runs in your browser at 60 fps. Same seed, same output — so you can share a configuration and we'll both see the same market.
03 · The Agents
Rule
Buys when price < perceived fair value
What they represent
The slow, patient capital. Institutions. Value investors. Believes markets revert to truth.
Rule
Follows momentum (short MA vs long MA)
What they represent
The trend follower. CTAs. Technical traders. Believes the tape tells the future.
Rule
Random action each step
What they represent
The retail flow. News-chasers. Reactive. Doesn't believe anything consistently.
Rule
Mean-reverts inventory — buys when short, sells when long
What they represent
The liquidity provider. Profits on spread, not direction. Keeps the market functioning.
04 · What Emerges
Big moves come in bursts. Quiet periods last weeks. The simulation reproduces this without any volatility parameter.
Crashes happen more often than a Gaussian says. The distribution of price changes has heavy tails — like real markets.
Chartist dominance creates runaway momentum. Eventually the fundamentalists overwhelm — and the crash propagates in one step.
Shift the agent mix and the whole market behaves differently. No retraining, no parameters — just different participants.
05 · Reading list
Lux, T. & Marchesi, M. · 1999
Nature 397, 498–500
The foundational paper. Defines the chartist-vs-fundamentalist dynamics this playground uses.
Brock, W. A. & Hommes, C. H. · 1998
Journal of Economic Dynamics and Control 22, 1235–1274
Adaptive belief switching — agents can change types based on performance.
Chiarella, C. & Iori, G. · 2002
Quantitative Finance 2, 346–353
Order-book-level extension with heterogeneous agents.
Farmer, J. D. & Joshi, S. · 2002
Journal of Economic Behavior & Organization 49, 149–171
Shows how price-impact effects combined with simple strategies produce fat-tailed returns.
Next