Ghost-Filled Orders: Detecting and Testing Atomicity Violations in Non-Custodial Prediction Markets
cs.CR
Submitted: 2026-09-15
Updated: 2026-09-15
Comments: 15 pages, 4 figures
License: http://creativecommons.org/licenses/by/4.0/
The gist: Blockchain based prediction markets combine offchain order management with onchain settlement.
Terminology
Abstract
Blockchain based prediction markets combine offchain order management with onchain settlement. This architecture supports user controlled custody, since users keep funds in wallets or smart contracts while submitting signed orders to an offchain order book. However, it creates an atomicity gap. An order may be valid when accepted or matched offchain, but become invalid before the corresponding onchain settlement transaction is executed. This behavior, often called ghost filled orders by the community, can cause trades that appear filled offchain to fail onchain. This paper studies this atomicity gap through a case study of Polymarket. We show how the delay between offchain order acceptance and onchain settlement allows adversaries to invalidate unfavorable orders after observing market outcomes or price movements. We then quantify the scale and financial impact of this behavior over a nine-month period from August 12, 2025, to May 22, 2026, using 1.8 million reverted transactions involving Polymarket official smart contracts. Our analysis separates attacker profit from market and user loss, and develops conservative measurement rules to avoid overclaiming impact. We further develop a methodology for testing other blockchain based prediction markets and apply it to three additional markets. We find that all three are vulnerable to the same class of attack, and that one design enables direct attacker profit. We have reported the findings to all three projects; one project had acknowledged the issue at the time of the study.
Sources
- Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges
- SoK: Market Microstructure for Decentralized Prediction Markets (DePMs)
- The Anatomy of a Decentralized Prediction Market: Microstructure Evidence from the Polymarket Order Book
- The Ghosts of Polymarket: When Off-Chain Matches Meet On-Chain Reverts
- Sereum: Protecting Existing Smart Contracts Against Re-Entrancy Attacks
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs