How modularity drives the next wave of DeFi Lending

Source : https://www.youtube.com/watch?v=XmqnImJFuuk

How modularity drives the next wave of DeFi Lending

Michael Bentley represents Euler, a lending protocol he started building in 2020 during the "DeFi summer" when decentralized finance was gaining significant traction.

However, in March 2023, Euler was exploited in a hack that drained $200 million in assets from the protocol. This was a devastating event, but Michael and his team were able to recover all the stolen assets within a few months

Despite the harrowing experience, Michael and his team learned valuable lessons and used them to develop Euler V2, a modular lending protocol that promises to offer more flexibility for lenders and borrowers.

Laurence Day represents the Wildcat protocol, which focuses on under-collateralized credit on the blockchain. He has a background in academia and finance, and was drawn to blockchain development because it allows programming money directly, which he found irresistible.

Both Michael and Lawrence acknowledge a certain level of masochism or obsession in their pursuit of building in DeFi

Lessons from the hacks (4:30)

Lessons from Euler hack :

  • Building secure smart contracts that handle millions of dollars is extremely difficult. Despite Euler V1 being carefully built, thoroughly audited, and having a large bug bounty, an exploit was still found in a niche part of the code.
  • Importance of simplicity and modularity in design. This allows each component to be well-tested and easily understood, resulting in a robust and flexible product.
  • Importance of team's resilience. The same team is now building Euler V2 with a heavy emphasis on security and a slow, thoughtful approach.

Lessons from Index Finance hack (and how it led him to Wildcat) :

  • Importance of smart contract security. While challenging due to the Turing-complete nature of smart contracts and limited fuzzing tools, Lawrence has embraced newer mechanisms that can improve security, despite added costs.
  • The legal aftermath of the Index Finance hack made him realize the disconnect between existing legal systems and decentralized finance (DeFi). This prompted him to attend law school to better navigate the legal challenges in DeFi.
  • Laurence believes on-chain credit mechanisms are a crucial missing piece for a digital economy. This realization led him to work on Wildcat

Definition of Modularity (9:20)

Michael from Euler Labs shares his definition of modularity:

From Michael's perspective, Modular code is short, simple, and does one thing exceptionally well. It's easily audited, tested, and can be composed with other modules like building blocks (Lego pieces).

Two different approaches :

  1. Top-down : building a monolithic codebase targeting a specific user need
  2. Bottom-up : identifying and abstracting key components, then composing them into a complex product

However, modularity alone isn't enough. It can be "chaotic" (modules built without cohesion, like Windows ecosystem) or "cohesive" (modules designed to work seamlessly together, like Apple ecosystem).

Euler's long-term ambition is to build in a cohesively modular way, creating a suite of DeFi applications that minimize fees, friction, and risks for users while working together seamlessly.

The only disagreement from Laurence is about using the term "Modular" as the word has been completely shadowed by Celestia and the Modular blockchains vision, and prefers to call them "Primitives" for DeFi.

The Risk management (13:35)

Both Michael and Lawrence agree that a founding principle of DeFi is giving users the freedom to choose their own risk-reward preferences.

Just like some people enjoy high-risk activities like skiing while others don't, DeFi users have varying risk appetites that should be accommodated.

Euler V2 deals with overcollateralized lending, where the collateral value must always exceed the loan value. This allows risk management to be encoded entirely in smart contracts without needing legal recourse.

Wildcat, on the other hand, focuses on undercollateralized lending, where the risk is the borrower's potential default. This introduces additional default risk beyond just smart contracts

In overcollateralized lending, there are two ways to manage the risks :

  1. Paternalism : the protocol manages risk for passive users, ensuring parameters adjust to economic changes
  2. Invisible Hand : Power users actively manage their positions across isolated pools, with the free market determining risk-reward dynamics.

Euler V2's goal is to accomodate both type of users and their risk preferences through different modules or pool configurations.

Wildcat takes a more locked-down approach to mitigate smart contract risk by heavily restricting contract interactions, even if it sacrifices some modularity.

However, the debt tokens issued can still be composed like money Legos.

Opportunities (18:50)

Tokenization of Real-World Assets : tokenizing real-world assets like equities, bonds, and treasuries, allowing them to be traded and earn yields within DeFi.

This integration of traditional finance assets with crypto-native assets opens up new opportunities for growth and innovation in DeFi.

Efficient and transparent markets : DeFi provides free, fair, and transparent markets that are more efficient than the closed systems in traditional finance.

Institutional Demand : As smart contract security and risk management improve through advancements in formal verification, fuzzing tools, and modularity, institutional demand for DeFi is expected to grow.

Challenges (22:30)

Sensible Regulation : Regulation is crucial for promoting transparency and avoiding the pitfalls of opaque "CeDeFi" platforms that breed collapse.

This is currently in USA. However, positive developments are emerging in Europe, with efforts like the UK Law Commission and the EU's MiCA 2 regulation focused on DeFi.

Smart Contract Risk : Addressing smart contract risk is crucial for building trust and attracting institutional adoption.

This challenge may never be solved, but there are improvements in security tools and formal verification methods.