Projects per year
Abstract
DeFi (Decentralized Finance) is one of the most important applications of today’s cryptocurrencies and smart contracts. It manages hundreds of billions in Total Value Locked (TVL) on-chain, yet it remains susceptible to common DeFi price manipulation attacks. Despite state-of-the-art (SOTA) systems like DeFiRanger and DeFort, we found that they are less effective to non-standard price models in custom DeFi protocols, which account for 44.2% of the 95 DeFi price manipulation attacks reported over the past three years.
In this paper, we introduce the first LLM-based approach, DeFiScope, for detecting DeFi price manipulation attacks in both standard and custom price models. Our insight is that large language models (LLMs) have certain intelligence to abstract price calculation from smart contract source code and infer the trend of token price changes based on the extracted price models. To further strengthen LLMs in this aspect, we leverage Foundry to synthesize on-chain data and use it to fine-tune a DeFi price-specific LLM. Together with the high-level DeFi operations recovered from low-level transaction data, DeFiScope detects various DeFi price manipulations according to systematically mined patterns. Experimental results show that DeFiScope achieves a high recall of 80% on real-world attacks, a precision of 96% on suspicious transactions, and zero false alarms on benign transactions, significantly outperforming SOTA approaches. Moreover, we evaluate DeFiScope’s cost-effectiveness and demonstrate its practicality by helping our industry partner confirm 147 real-world price manipulation attacks, including discovering 81 previously unknown historical incidents.
In this paper, we introduce the first LLM-based approach, DeFiScope, for detecting DeFi price manipulation attacks in both standard and custom price models. Our insight is that large language models (LLMs) have certain intelligence to abstract price calculation from smart contract source code and infer the trend of token price changes based on the extracted price models. To further strengthen LLMs in this aspect, we leverage Foundry to synthesize on-chain data and use it to fine-tune a DeFi price-specific LLM. Together with the high-level DeFi operations recovered from low-level transaction data, DeFiScope detects various DeFi price manipulations according to systematically mined patterns. Experimental results show that DeFiScope achieves a high recall of 80% on real-world attacks, a precision of 96% on suspicious transactions, and zero false alarms on benign transactions, significantly outperforming SOTA approaches. Moreover, we evaluate DeFiScope’s cost-effectiveness and demonstrate its practicality by helping our industry partner confirm 147 real-world price manipulation attacks, including discovering 81 previously unknown historical incidents.
| Original language | English |
|---|---|
| Title of host publication | 2025 40th IEEE/ACM International Conference on Automated Software Engineering, ASE 2025: Proceedings |
| Publisher | IEEE |
| Pages | 1781-1793 |
| Number of pages | 13 |
| ISBN (Electronic) | 9798350357332 |
| DOIs | |
| Publication status | Published - Nov 2025 |
| Event | 2025 40th IEEE/ACM International Conference on Automated Software Engineering - Seoul, Korea, Republic of Duration: 16 Nov 2025 → 20 Nov 2025 |
Publication series
| Name | IEEE/ACM International Conference on Automated Software Engineering |
|---|---|
| Publisher | IEEE |
| ISSN (Print) | 1938-4300 |
| ISSN (Electronic) | 2643-1572 |
Conference
| Conference | 2025 40th IEEE/ACM International Conference on Automated Software Engineering |
|---|---|
| Abbreviated title | ASE 2025 |
| Country/Territory | Korea, Republic of |
| City | Seoul |
| Period | 16/11/25 → 20/11/25 |
Funding
This research was supported by Lingnan Grant SUG-002/2526, HKUST TLIP Grant FF612, the National Natural Science Foundation of China (Project No. 72304232), the Singapore Ministry of Education Academic Research Fund Tier 2 (T2EP20224-0003) and the Nanyang Technological University Centre for Computational Technologies in Finance (NTU-CCTF). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of MOE and NTU-CCTF.
Keywords
- large language model
- smart contract
- defi
- price manipulation
- vulnerability detection
Fingerprint
Dive into the research topics of 'Detecting Various DeFi Price Manipulations with LLM Reasoning'. Together they form a unique fingerprint.Projects
- 1 Active
-
Understanding and Testing the Security of Large Language Model Context Protocols (MCP)
WU, D. (PI)
1/09/25 → 31/08/27
Project: Grant Research