TradeFM: A Generative Foundation Model for Trade-flow and Market Microstructure
Organizations: J.P. Morgan AI Research, New York, NY, USA
Abstract
Foundation models have transformed domains from language to genomics by learning general-purpose representations from large-scale, heterogeneous data. We introduce TradeFM, a 524M-parameter generative Transformer that brings this paradigm to market microstructure, learning directly from billions of trade events across >9K equities. To enable cross-asset generalization, we develop scale-invariant features and a universal tokenization scheme that map the heterogeneous, multi-modal event stream of order flow into a unified discrete sequence -- eliminating asset-specific calibration. Integrated with a deterministic market simulator, TradeFM-generated rollouts reproduce key stylized facts of financial returns, including heavy tails, volatility clustering, and absence of return autocorrelation. Quantitatively, TradeFM achieves 2-3x lower distributional error than Compound Hawkes baselines and generalizes zero-shot to geographically out-of-distribution APAC markets with moderate perplexity degradation. Together, these results suggest that scale-invariant trade representations capture transferable structure in market microstructure, opening a path toward synthetic data generation, stress testing, and learning-based trading agents.
Figures & tables
| Model | Input | Assets | Params | Zero-Shot |
| DeepLOB | Full LOB | 5 | 60K | No |
| LOBS5 | Full LOB | 2 | 6.3M | No |
| MaRS | Full LOB | 500 | 1B | No |
| TradeFM | Event stream | 9K | 524M | Yes |
| Kolmogorov-Smirnov | Wasserstein | |||||
| ZI | Hawkes | TradeFM | ZI | Hawkes | TradeFM | |
| 10 | 0.376 | 0.039 | 0.013 | 0.0006 | 0.0004 | 0.0001 |
| 30 | 0.439 | 0.075 | 0.024 | 0.0015 | 0.0012 | 0.0002 |
| 60 | 0.429 | 0.101 | 0.035 | 0.0027 | 0.0023 | 0.0004 |
| 120 | 0.429 | 0.098 | 0.043 | 0.0043 | 0.0043 | 0.0007 |
| Quantity | Kolmogorov-Smirnov | Wasserstein | ||||
| ZI | Hawkes | TradeFM | ZI | Hawkes | TradeFM | |
| Spreads | 0.400 | 0.218 | 0.238 | 0.375 | 0.302 | 0.400 |
| Interarrival Times | 0.651 | 0.515 | 0.281 | 0.415 | 0.626 | 0.318 |
| Price Depth | 0.436 | 0.281 | 0.169 | 0.390 | 0.348 | 0.339 |
| Order Book Imbalance | 0.237 | 0.155 | 0.142 | 0.200 | 0.165 | 0.099 |
| Bid Volume | 0.460 | 0.296 | 0.386 | 0.616 | 0.278 | 0.130 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Time- | Time- | Asset | Avg. Daily | Midprice | Action | Side | Order | Vol. |
| step | stamp | Vol. (shs) | ($) | Price ($) | (shs) | |||
| 42 | 09:45:30 | AAPL | 53,496,022 | 182.45 | ADD | BUY | 182.44 | 500 |
| 43 | 09:45:38 | AAPL | 53,496,022 | 182.48 | ADD | SELL | 182.50 | 750 |
| 44 | 09:45:52 | AAPL | 53,496,022 | 182.50 | CANCEL | BUY | 182.49 | 300 |
| Model Size | Num. Train Tokens | Batch Size | GPUs | Train Time / Epoch (hrs) | Optimization |
| 125M | 2.6B | 24 | 3xA100 | 17 | Accelerate |
| 250M | 6.4B | 32 | 4xA10G | 29 | DeepSpeed ( Rajbhandari et al., 2020 ) |
| 500M | 10.7B | 24 | 3xA100 | 128 | Accelerate |
| Country | Number of Assets | Date-Asset Pairs | Tokens |
| US | 6,885 | 81,203 | 857,017,219 |
| China | 4,926 | 68,925 | 37,408,529 |
| Japan | 2,932 | 37,235 | 286,476,052 |
Quantitative Finance
Quantitative finance uses mathematical models, statistics, and machine learning to value assets, measure risk, and guide trading and portfolio decisions.
See all 191 papers