# Detecting Various DeFi Price Manipulations with LLM Reasoning

arXiv: https://arxiv.org/abs/2502.11521 · HTML: https://mlsanity.com/paper/2502.11521/

## Key facts

- Cited by 4 papers in the map (data through 14 Oct 2026).
- Builds on 19 of its 77 references that are in the map.
- First posted on arXiv 17 Feb 2025.

## Builds on (most cited first, 19 of 19)

- [LoRA: Low-Rank Adaptation of Large Language Models](https://mlsanity.com/paper/2106.09685/) (2021)
- [Scaling Instruction-Finetuned Language Models](https://mlsanity.com/paper/2210.11416/) (2022)
- [The Curious Case of Neural Text Degeneration](https://mlsanity.com/paper/1904.09751/) (2019)
- [PAL: Program-aided Language Models](https://mlsanity.com/paper/2211.10435/) (2022)
- [GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysis](https://mlsanity.com/paper/2308.03314/) (2023)
- [LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning](https://mlsanity.com/paper/2401.16185/) (2024)
- [Combining Fine-Tuning and LLM-based Agents for Intuitive Smart Contract Auditing with Justifications](https://mlsanity.com/paper/2403.16073/) (2024)
- [PropertyGPT: LLM-driven Formal Verification of Smart Contracts through Retrieval-Augmented Property Generation](https://mlsanity.com/paper/2405.02580/) (2024)
- [SoK: Decentralized Finance (DeFi) Attacks](https://mlsanity.com/paper/2208.13035/) (2022)
- [Blockchain Large Language Models](https://mlsanity.com/paper/2304.12749/) (2023)
- [Quantifying Blockchain Extractable Value: How dark is the forest?](https://mlsanity.com/paper/2101.05511/) (2021)
- [High-Frequency Trading on Decentralized On-Chain Exchanges](https://mlsanity.com/paper/2009.14021/) (2020)
- [Attacking the DeFi Ecosystem with Flash Loans for Fun and Profit](https://mlsanity.com/paper/2003.03810/) (2020)
- [Untangling Blockchain: A Data Processing View of Blockchain Systems](https://mlsanity.com/paper/1708.05665/) (2017)
- [On the Just-In-Time Discovery of Profit-Generating Transactions in DeFi Protocols](https://mlsanity.com/paper/2103.02228/) (2021)
- [FlashSyn: Flash Loan Attack Synthesis via Counter Example Driven Approximation](https://mlsanity.com/paper/2206.10708/) (2022)
- [Demystifying Invariant Effectiveness for Securing Smart Contracts](https://mlsanity.com/paper/2404.14580/) (2024)
- [Following Devils' Footprint: Towards Real-time Detection of Price Manipulation Attacks](https://mlsanity.com/paper/2502.03718/) (2025)
- [SoK: Decentralized Finance (DeFi) -- Fundamentals, Taxonomy and Risks](https://mlsanity.com/paper/2404.11281/) (2024)

## Built on by (most cited first, 4 of 4)

- [Resisting Manipulative Bots in Meme Coin Copy Trading: A Multi-Agent Approach with Chain-of-Thought Reasoning](https://mlsanity.com/paper/2601.08641/) (2026)
- [Rethinking and Exploring String-Based Malware Family Classification in the Era of LLMs and RAG](https://mlsanity.com/paper/2507.04055/) (2025)
- [Discovering Persistent Behavioural Patterns for Interpretable Blockchain Forensics](https://mlsanity.com/paper/2608.12864/) (2026)
- [DeFiFusion: Combining Transaction Events with Smart Contracts to Detect Price Manipulation Attacks](https://mlsanity.com/paper/2609.11008/) (2026)

## Abstract (arXiv)

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.
