arXiv:2609.11008cs.CRSep 2026

Manuscript Offprint

arXiv:2609.11008

DeFiFusion: Combining Transaction Events with Smart Contracts to Detect Price Manipulation Attacks

Rui Cao, Shaojing Fan, Liming Fang, Yuchan Liu, Yingying Jiao, Zhenguang Liu

Rui Cao, Shaojing Fan, Liming Fang, Yuchan Liu, Yingying Jiao, Zhenguang Liu

Abstract—Decentralized Finance (DeFi) has emerged as a rapidly growing blockchain-based financial service, where market transaction dynamics and underlying smart contract logic are intricately intertwined. This autonomous interplay, while eliminating centralized intermediaries, significantly expands the vulnerability surface of DeFi protocols to Price Manipulation Attacks (PMAs), which have already inflicted catastrophic financial losses. Despite their gravity, existing detection paradigms suffer from fundamental limitations. Transaction-centric methods lack awareness of contract execution semantics, making them prone to false positives under legitimate market volatility, while static contract analyses ignore real transaction behaviors and frequently report vulnerabilities that are infeasible to exploit in practice. This disconnect undermines the reliability and practicality of PMA detection.

We present DeFiFusion, a dual-modal PMA detection framework that closes this gap by jointly modeling transaction events and smart contract semantics within a unified pipeline. Our core insight is that PMA maliciousness emerges only from the interaction between transaction behaviors and the contract logic they exploit; neither signal suffices in isolation. Accordingly, we derive price-manipulation-aware event encoding for extracting fine-grained temporal and economic features tailored to manipulation patterns. We further introduce LLM-based contract semantic extraction to supply the execution-logic context that prior behavioral methods lack. To fuse these modalities, we propose a Dual-Modal Projection-Fusion Transformer (DPF-Transformer) with T5-style relative positional encoding, capturing the cyclic multi-stage execution structures that distinguish PMAs from benign market activity.

To enable rigorous evaluation, we curate one of the largest and most up-to-date PMA datasets, consisting of 225 confirmed real-world attacks from 2020 to 2026. Extensive experiments demonstrate that DeFiFusion consistently achieves state-of-the-art detection performance, effectively recalling 222 of the 225 PMA cases while maintaining a precision of 96.10%. Moreover, in a forward-looking evaluation on 2026 DeFi activity, DeFiFusion attains 100% recall on 18 real-world PMA incidents, demonstrating its practicality for real-world DeFi security monitoring.

Index Terms—Decentralized finance, price manipulation attack, smart contract, Large Language Model, Transformer

I. INTRODUCTION

Blockchain and its transformative services, notably Decentralized Finance (DeFi), have fundamentally reshaped the landscape of modern finance [1]. By leveraging this infrastructure, DeFi provides a transparent, permissionless, and non-custodial alternative to traditional financial systems, significantly lowering entry barriers and intermediation costs, which in turn has catalyzed the explosive growth of the entire ecosystem [2]. As of early 2026, the DeFi ecosystem encompasses thousands of active projects, with the Total Value Locked (TVL) consistently exceeding $120 billion [3]. However, this rapid expansion has introduced complex systemic risks [4]. Among these, Price Manipulation Attack (PMA) has emerged as a primary concern [5]. By artificially manipulating market prices, attackers undermine the economic equilibrium and pricing mechanisms of DeFi protocols. Such exploits have resulted in billions of dollars in financial losses and severely compromised the economic stability of the decentralized ecosystem [6].

Existing work on PMA detection largely falls into two categories: transaction-behavior-based detection [6], [7], [8], [9] and contract-code-based static analysis [10], [11], [12]. The former excels at identifying price anomalies by monitoring on-chain execution traces or extracting key events and associated state variables, thereby capturing active exploits. Conversely, contract-code-based methods focus on uncovering logical vulnerabilities within source code, enabling the proactive identification of potential exploits prior to deployment.

However, treating transaction behavior and contract logic as independent signals fundamentally limits detection fidelity. Transaction-based methods operate as black-box monitors that lack semantic awareness of contract execution, causing them to misclassify sophisticated manipulations as legitimate market volatility. Conversely, static analyses abstract away runtime behaviors and evolving market conditions, often producing large numbers of theoretical vulnerabilities that cannot be triggered in practice [13]. These limitations highlight a key missing link: price manipulation emerges from the interaction between adversarial transaction sequences and specific contract execution semantics, neither of which can be fully understood in isolation.

Rui Cao and Liming Fang are with the School of Computer Science and Technology, Nanjing University of Aeronautics and Astronautics, China. (email: caorui@nuaa.edu.cn, fangliming@nuaa.edu.cn)

Shaojing Fan is with the Department of Electrical and Computer Engineering (ECE), National University of Singapore, Singapore. (e-mail: dcsfs@nus.edu.sg)

Yuchan Liu is with the School of Aerospace Engineering, Nanjing University of Aeronautics and Astronautics, China. (e-mail: cecilia-steele930@gmail.com)

Yingying Jiao is with the Zhejiang University of Technology, China. (email: yingyingjiao21@gmail.com)

Zhenguang Liu is with the Zhejiang University (The State Key Laboratory of Blockchain and Data Security, Zhejiang University), and with Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security, China. (e-mail: liuzhenguang2008@gmail.com)

Corresponding Authors: Liming Fang, Zhenguang Liu, and Yingying Jiao.

To address this gap, we propose DeFiFusion, a novel PMA detection framework explicitly designed to jointly model transaction events and smart contract semantics within a unified analysis pipeline. DeFiFusion is motivated by the observation that PMAs exhibit recurring, multi-stage execution patterns whose malicious intent becomes evident only when transaction-level behaviors are interpreted in the context of contract logic. Accordingly, DeFiFusion consists of three phases. First, we propose price-manipulation-aware event encoding, which performs fine-grained temporal and economic modeling of transaction events to capture manipulation-oriented execution patterns. Second, it leverages Large Language Models (LLMs) [14], [15], [16], [17], [18] to encode high-level semantic representations of smart contracts, providing execution-aware context for transaction interpretation. Finally, these multimodal representations are fused using a Dual-Modal Projection-Fusion Transformer classifier (DPF-Transformer) [19] with T5-style relative positional encoding (T5-RPE) [20], enabling precise modeling of the sequential dependencies and cyclic structures characteristic of PMAs. This design allows DeFiFusion to reliably distinguish adversarial price manipulation from benign market fluctuations.

Extensive evaluation of DeFiFusion on two real-world datasets, including 225 verified PMA incidents from 2020 to 2026, shows that it outperforms state-of-the-art (SOTA) methods across all metrics (precision 96.10%, recall 98.67%) and achieves 100% recall on 18 real-world 2026 PMA events, demonstrating its robustness and effectiveness in detecting emerging attacks.

In summary, this paper makes the following contributions:

• We establish that PMA maliciousness is manifested through the interaction between transaction behaviors and the smart contract semantics they exploit. This fundamentally limits the effectiveness of either transaction-centric or contract-centric detection in isolation. Motivated by this insight, we introduce DeFiFusion, the dual-modal detection framework that explicitly couples transaction events with contract semantics in a unified detection pipeline, overcoming the divide between dynamic event behaviors and static code analysis for PMA detection.

  • We devise price-manipulation-aware event encoding that serves as feature engineering tailored to transaction events involved in PMAs. Furthermore, for the first time in this domain, we integrate T5-style relative positional encoding into the Dual-Modal Projection-Fusion Transformer Classifier. This design effectively captures the unique sequential dependencies characteristic of price manipulation, enabling precise discrimination between malicious price distortions and normal market fluctuations.

  • We construct and release a comprehensive dataset of 225 verified PMA cases from 2020 to 2026, representing the largest and most up-to-date public collection of real-world PMA incidents. This dataset not only enables rigorous evaluation of DeFiFusion's detection performance, but also provides the research community with a critical benchmark for advancing practical PMA detection.

References (35)