arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.11521cs.CRcs.AI
收藏

利用LLM推理检测各种DeFi价格操纵

Detecting Various DeFi Price Manipulations with LLM Reasoning

Daoyuan Wu is the co-first author.(达元吴是共同第一作者);Ye Liu is the corresponding author.(叶刘是通讯作者)

Juantao Zhong, Daoyuan Wu, Ye Liu, Maoyi Xie, Yang Liu, Yi Li, Ning Liu

AI总结:

针对DeFi价格操纵检测中非标准价格模型效果不佳的问题,提出首个基于LLM的方法DeFiScope,通过微调价格专用LLM并挖掘模式,实现高召回率与精确率,并发现大量未知攻击。

摘要:

DeFi(去中心化金融)是当今加密货币和智能合约最重要的应用之一。它在链上管理着数千亿美元的总锁仓价值(TVL),但仍然容易受到常见的DeFi价格操纵攻击。尽管有像DeFiRanger和DeFort这样的最先进(SOTA)系统,我们发现它们对于自定义DeFi协议中的非标准价格模型效果不佳,而这些模型占过去三年报告的95起DeFi价格操纵攻击中的44.2%。在本文中,我们介绍了首个基于LLM的方法DeFiScope,用于检测标准和自定义价格模型中的DeFi价格操纵攻击。我们的洞察是,大型语言模型(LLMs)具有一定的智能,能够从智能合约源代码中抽象出价格计算,并根据提取的价格模型推断代币价格变化的趋势。为了进一步增强LLMs在这方面的能力,我们利用Foundry合成链上数据,并用于微调一个DeFi价格专用的LLM。结合从低级交易数据中恢复的高级DeFi操作,DeFiScope根据系统挖掘的模式检测各种DeFi价格操纵。实验结果表明,DeFiScope在真实世界攻击上实现了80%的高召回率,在可疑交易上实现了96%的精确率,在良性交易上实现了零误报,显著优于SOTA方法。此外,我们评估了DeFiScope的成本效益,并通过帮助我们的行业合作伙伴确认147起真实世界的价格操纵攻击(包括发现81起以前未知的历史事件)证明了其实用性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑