{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/trades-generating-realistic-market","title":"TRADES: Generating Realistic Market Simulations with Diffusion Models","arxiv_id":"2502.07071","date":"2025-01-31","proceeding":null,"authors":["Leonardo Berti","Bardh Prenkaj","Paola Velardi"],"abstract":"Financial markets are complex systems characterized by high statistical noise, nonlinearity, and constant evolution. Thus, modeling them is extremely hard. We address the task of generating realistic and responsive Limit Order Book (LOB) market simulations, which are fundamental for calibrating and testing trading strategies, performing market impact experiments, and generating synthetic market data. Previous works lack realism, usefulness, and responsiveness of the generated simulations. To bridge this gap, we propose a novel TRAnsformer-based Denoising Diffusion Probabilistic Engine for LOB Simulations (TRADES). TRADES generates realistic order flows conditioned on the state of the market, leveraging a transformer-based architecture that captures the temporal and spatial characteristics of high-frequency market data. There is a notable absence of quantitative metrics for evaluating generative market simulation models in the literature. To tackle this problem, we adapt the predictive score, a metric measured as an MAE, by training a stock price predictive model on synthetic data and testing it on real data. We compare TRADES with previous works on two stocks, reporting an x3.27 and x3.47 improvement over SoTA according to the predictive score, demonstrating that we generate useful synthetic market data for financial downstream tasks. We assess TRADES's market simulation realism and responsiveness, showing that it effectively learns the conditional data distribution and successfully reacts to an experimental agent, giving sprout to possible calibrations and evaluations of trading strategies and market impact experiments. We developed DeepMarket, the first open-source Python framework for market simulation with deep learning. Our repository includes a synthetic LOB dataset composed of TRADES's generates simulations. We release the code at github.com/LeonardoBerti00/DeepMarket.","url_abs":"https://arxiv.org/abs/2502.07071v2","url_pdf":"https://arxiv.org/pdf/2502.07071v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"trades-generating-realistic-market","repo_url":"https://github.com/leonardoberti00/deepmarket","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"mae","method_name":"MAE"}],"datasets_introduced":[{"slug":"trades-lob","name":"TRADES-LOB","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.07071","atlas_url":"https://app.syntology.ai/?focus=2502.07071","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.07071"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leonardoberti00/deepmarket","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c15cfcf5bf87dbea","entry":"load_and_compute_log_returns","repo":"leonardoberti00/deepmarket","repo_kind":"official","path":"evaluation/visualizations/comparison_core_coef_lags.py","file_url":"https://github.com/leonardoberti00/deepmarket/blob/HEAD/evaluation/visualizations/comparison_core_coef_lags.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c15cfcf5bf87dbea"}},{"code_sha256_prefix":"d719cb0cdc1095da","entry":"load_and_compute_volatility","repo":"leonardoberti00/deepmarket","repo_kind":"official","path":"evaluation/visualizations/comparison_core_coef_lags.py","file_url":"https://github.com/leonardoberti00/deepmarket/blob/HEAD/evaluation/visualizations/comparison_core_coef_lags.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d719cb0cdc1095da"}},{"code_sha256_prefix":"161d055a72ed57f2","entry":"load_and_compute_volume","repo":"leonardoberti00/deepmarket","repo_kind":"official","path":"evaluation/visualizations/comparison_core_coef_lags.py","file_url":"https://github.com/leonardoberti00/deepmarket/blob/HEAD/evaluation/visualizations/comparison_core_coef_lags.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"161d055a72ed57f2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}