Detecting Various DeFi Price Manipulations with LLM Reasoning
Authors:
- 16 November 2025
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 1781-1793
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.Keywords
All Related Versions
Funding Information
- National Natural Science Foundation of China
- Ministry of Education
This publication has 20 references indexed in Scilit:
- Combining Fine-Tuning and LLM-Based Agents for Intuitive Smart Contract Auditing with Justifications2025
- DeFiRanger: Detecting DeFi Price Manipulation AttacksIEEE Transactions on Dependable and Secure Computing, 2023
- SoK: Decentralized Finance (DeFi) Attacks2023
- Quantifying Blockchain Extractable Value: How dark is the forest?2022
- Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit2021
- High-Frequency Trading on Decentralized On-Chain Exchanges2021
- On the Just-In-Time Discovery of Profit-Generating Transactions in DeFi Protocols2021
- Flash Boys 2.0: Frontrunning in Decentralized Exchanges, Miner Extractable Value, and Consensus Instability2020
- Gigahorse: Thorough, Declarative Decompilation of Smart Contracts2019
- Note on the Sampling Error of the Difference Between Correlated Proportions or PercentagesPsychometrika, 1947