Smart Contract Risk in DeFi Lending: What Can Go Wrong

In DeFi, code holds your money. If the code has a flaw, an attacker can drain funds in minutes. Smart contract risk is the main trade-off for removing the company from lending.

What can go wrong

  • Bugs in accounting or liquidation logic.
  • Exploits that combine several protocols, often using flash loans.
  • Oracle manipulation that feeds wrong prices.
  • Admin key compromise or malicious upgrades.
  • Dependencies: a problem in another protocol or token used by your pool.

How to assess a protocol

CheckWhy it matters
AuditsIndependent review of the code, with fixes
Time live and value securedCode tested in real conditions
Bug bountyIncentive for researchers to report flaws
Upgrade controlsTimelocks and multi-signature keys reduce sudden changes
Incident historyHow the team handled past problems

Read more in DeFi lending audits explained.

How to reduce your exposure

  1. Spread funds across protocols.
  2. Prefer protocols with long track records and multiple audits.
  3. Limit token approvals and revoke unused ones.
  4. Follow official channels for incident alerts.

Back to the risk and security hub.

Frequently asked questions

No. Audits reduce risk but cannot find every issue, especially outside their scope.

An exploit that borrows large amounts within one transaction to manipulate prices or logic, then repays immediately.

Sometimes protocols compensate users or recover funds, but there is no guarantee.

This page is for educational purposes only and is not financial, investment or tax advice. Crypto assets are volatile; you can lose all of your money.