A new research paper, "Ghost-Filled Orders: Detecting and Testing Atomicity Violations in Non-Custodial Prediction Markets," was recently published on arXiv, shedding light on a critical security vulnerability within decentralized prediction markets. The study, which includes a detailed case study of Polymarket, identifies and quantifies the impact of 'ghost-filled orders'—a phenomenon where off-chain matched orders fail to settle on-chain due to changes in blockchain state.

Understanding Atomicity Violations

The core issue stems from the hybrid architecture of non-custodial prediction markets, which combine off-chain order management with on-chain settlement. While this design offers benefits like user-controlled custody and transparency, it introduces an 'atomicity gap.' An order, valid when accepted and matched off-chain, can become invalid by the time its settlement transaction is executed on-chain. This time-of-check to time-of-use (TOCTOU) vulnerability allows for the manipulation of market outcomes.

The paper formalizes these 'ghost-filled orders' as an atomicity violation where the blockchain state required for settlement is altered by the order maker between the off-chain match and the on-chain settlement. This can lead to trades that appear filled off-chain ultimately failing on-chain, creating an unfair trading environment.

Detection and Financial Impact

Researchers developed a comprehensive framework of detectors and probes to classify reverted settlement transactions and identify the underlying order-invalidating transactions. Applying this framework to Polymarket, the study analyzed 1.8 million reverted transactions involving Polymarket smart contracts over a nine-month period, from August 12, 2025, to May 22, 2026.

The findings revealed that 100% of these reverts were classified by the framework, with order-invalidating transactions identified for 96.6% of user-controlled reverts. A significant financial impact was observed, with responsible parties avoiding over $61 million USD in losses, predominantly in high-frequency crypto 'Up/Down' markets. The data further indicated that 94% of these reverted transactions resulted in avoided losses.

Implications for Market Design

Beyond Polymarket, the research extended its auditing methodology to three additional blockchain-based prediction markets. All three were found to be vulnerable to the same class of atomicity violations. Notably, one market's 'fairness-inducing' delay mechanism, intended to protect users, was found to inadvertently provide an expanded window for malicious actors to invalidate unfavorable trades, enabling direct attacker profit.

The paper defines two key properties for a secure market: ensuring that invalidating one's own order does not damage other users in bundled settlements, and preventing asymmetric post-fill invalidation windows. These findings underscore the need for robust market design and continuous auditing to mitigate these vulnerabilities in the evolving landscape of decentralized finance.

Background and Context

The challenges highlighted by this research are inherent to the design of many decentralized applications that rely on a hybrid off-chain/on-chain architecture. The delay between off-chain actions and on-chain finality creates a window for exploitation, a problem not unique to prediction markets but particularly impactful given their financial nature. This study contributes to a growing body of academic work examining security and manipulation risks in blockchain-based markets, emphasizing the complexities of ensuring fair and atomic transactions in a decentralized environment.

What to Watch

As this paper is a preprint on arXiv, the next step will likely involve peer review and potential publication in a scientific journal. The detailed methodology and findings provide a crucial resource for developers and auditors of non-custodial prediction markets. Market operators are expected to review their smart contract designs and off-chain matching mechanisms to address these atomicity violations, potentially leading to more secure and resilient platforms in the future. The academic community will also likely build upon this research to further explore and mitigate similar vulnerabilities across the broader DeFi ecosystem.

Original announcement: arXiv