How price manipulation attacks are carried out on crypto loan systems
Price oracle manipulation is a common attack on DeFi protocols. Based on the statistics from Chainalysis (https://www.chainalysis.com/blog/oracle-manipulation-attacks-rising/), in 2022, DeFi protocols lost 403.2 million USD in 41 separate price oracle manipulation attacks. Most of the attacks impacted decentralized crypto loan systems and drained the assets of smart contracts, which caused a huge loss for investors and users.
For decentralized crypto loan systems, oracle manipulation attacks are usually not caused by the defects of smart contracts themselves. The attacks happen due to the vulnerability of the price oracles that are being used. Before diving into how to build a reliable price oracle, we need to understand how these attacks happen. We will see an example by attacking the crypto loan system we built in Chapter 11, An Introduction to Crypto Loans and Chapter 12, Implementing an Asset Pool Smart Contract...