Decentralized Finance (DeFi), a blockchain-based financial service ecosystem, is rapidly growing by providing innovative financial services. However, it also poses various risks, such as the 2025 Bybit hack and the 2022 TerraUSD (UST) collapse. Theref...
Decentralized Finance (DeFi), a blockchain-based financial service ecosystem, is rapidly growing by providing innovative financial services. However, it also poses various risks, such as the 2025 Bybit hack and the 2022 TerraUSD (UST) collapse. Therefore, anomaly detection in DeFi is essential and crucial to ensure the security and trustworthiness of the DeFi ecosystem. Nevertheless, due to the technical complexity of DeFi—such as its intricate protocol structures and the interactions among smart contracts—and the high volatility of the market, anomaly detection in DeFi remains a very challenging task.
This paper proposes a novel methodology for effectively detecting anomalies in DeFi and stablecoins. Specifically, we introduce a new deep learning model, the Anomaly VAE-Transformer, which combines a Variational Autoencoder (VAE) for extracting short-term local information and a Transformer for capturing long-term dependencies among data. Based on a deep understanding of DeFi protocols, we collect and analyze diverse on-chain data from Olympus DAO, a representative DeFi protocol, and USDT, the most widely used stablecoin, to extract features suitable for anomaly detection. We then demonstrate the superiority of the proposed model by closely analyzing anomaly cases that were successfully detected in Olympus DAO and USDT. By detecting abnormal behaviors in DeFi through the proposed method, malicious attacks and structural changes in DeFi protocols can be promptly identified, which is expected to protect users' assets and improve the security, reliability, and transparency of the DeFi market.