The prosperity of Decentralized Finance (DeFi) unveils underlying risks, with reported losses surpassing 3.2 billion USD between 2018 and 2022 due to vulnerabilities in Decentralized Applications (DApps). One significant threat is the Price Manipulation Attack (PMA) that alters asset prices during transaction execution. As a result, PMA accounts for over 50 million USD in losses. To address the urgent need for efficient PMA detection, this paper introduces a novel detection service, DeFiGuard, using Graph Neural Networks (GNNs). In this paper, we propose cash flow graphs with four distinct features, which capture the trading behaviors from transactions. Moreover, DeFiGuard integrates transaction parsing, graph construction, model training, and PMA detection. Evaluations on a dataset of 208 PMA and 2,080 non-PMA transactions show that DeFiGuard with GNN models outperforms the baseline in Accuracy, TPR, FPR, and AUC-ROC. The results of ablation studies suggest that the combination of the four proposed node features enhances DeFiGuard's efficacy. Moreover, DeFiGuard classifies transactions within 0.892 to 5.317 seconds, which provides sufficient time for the victims (DApps and users) to take action to rescue their vulnerable funds. In conclusion, this research offers a significant step towards safeguarding the DeFi landscape from PMAs using GNNs.
翻译:去中心化金融(DeFi)的繁荣揭示了其潜在风险,据报道,2018年至2022年间,由于去中心化应用(DApps)中的漏洞,造成的损失已超过32亿美元。价格操纵攻击(PMA)是一种重大威胁,它能在交易执行期间改变资产价格。因此,PMA造成的损失超过5000万美元。为满足对高效PMA检测的迫切需求,本文引入了一种新颖的检测服务DeFiGuard,它使用图神经网络(GNNs)。在本文中,我们提出了具有四种不同特征的现金流图,以捕捉交易中的交易行为。此外,DeFiGuard集成了交易解析、图构建、模型训练和PMA检测。在一个包含208笔PMA交易和2080笔非PMA交易的数据集上的评估表明,采用GNN模型的DeFiGuard在准确率、真阳性率、假阳性率和AUC-ROC方面均优于基线方法。消融实验的结果表明,所提出的四种节点特征的组合增强了DeFiGuard的效能。此外,DeFiGuard能在0.892至5.317秒内对交易进行分类,这为受害者(DApps和用户)采取行动挽救其易受攻击的资金提供了足够的时间。总之,这项研究为利用GNNs保护DeFi生态系统免受PMA侵害迈出了重要一步。