Decentralized Finance (DeFi) has revolutionized the financial landscape by providing open, permissionless, and decentralized alternatives to traditional financial systems. However, the rapid growth of DeFi has also exposed significant risks, particularly within its critical infrastructure—Decentralized Exchanges (DEXs) and Protocols for Loanable Funds (PLFs). This work presents a comprehensive risk analysis survey focusing on the protocol layer (PL) and smart contract (SCL) layer.
We examine the underlying mechanisms, vulnerabilities, and threat vectors inherent to DEXs and PLFs. We provide a structured approach to identifying, assessing, and mitigating risks. This survey integrates technical, economic, and governance perspectives, offering a holistic view of risk management in DeFi. We propose practical guidelines and methodologies for enhancing the security and resilience of the critical infrastructure of DeFi, thereby fostering a more stable and reliable ecosystem.