The Derivation of Modular Narrative: The Modular Evolution of DeFi Lending
Author: YBB Capital Researcher Ac-Core
TLDR
The essence of modular lending is not just cross-chain and aggregation, but both play important roles in modular lending;
Modular lending leverages the security, consensus, and data availability provided by the base layer, primarily focusing on functional modularization at the execution and application layers;
Modular lending breaks down its processes into multiple independent modules, such as collateral management, interest rate calculation, risk assessment, and liquidation mechanisms, with communication between modules facilitated through standardized interfaces;
Currently, the characteristics of modular DeFi protocols are similar to the logic of OP Stack's one-click chain deployment, requiring the establishment of module combinations based on their own protocols to create new financial products and services.
I. The Origin of Modularization
The concept of modular blockchain originated from two white papers. In 2018, Mustafa Albasan and Vitalik Buterin co-authored the paper "Data Availability Sampling and Fraud Proofs," which proposed a system allowing light clients to receive and verify fraud proofs from full nodes, designing a data availability sampling protocol to reduce the trade-off between on-chain capacity and security, addressing blockchain scalability issues without sacrificing security and decentralization.
Subsequently, in 2019, Mustafa Albasan detailed a new architecture in the "Lazy Ledger" white paper, which used blockchain for sorting and ensuring the availability of transaction data without being responsible for transaction execution and verification. This new architecture aimed to solve the scalability issues of existing blockchain systems and was referred to as the "smart contract client." The execution of smart contracts was carried out through another execution layer on this client, which was the prototype of Celestia (the first modular data availability layer project).
With the emergence of Rollup technology, this concept became more concrete, where the logic is to execute smart contracts off-chain and upload the results as proofs to the execution layer of the "client." By reflecting on the architecture of blockchains and new scaling technologies, Celestia emerged, defining a new paradigm of "modular blockchain."
II. The Emergence of Modular Blockchain
Modular blockchains aim to solve the "impossible triangle" problem in the blockchain space through decoupling and reorganization. In simple terms, it breaks down the main functions of a single chain into multiple layers, each focusing on achieving specific functions to achieve scalability. Generally, the basic functions of a monolithic chain can be divided into the following four functional layers:
Data Availability Layer: Responsible for ensuring that data in the network can be accessed and verified, including data storage, transmission, and verification functions, ensuring the transparency and trust of the blockchain network. Representative DA projects include Celestia, Avail, EigenDA, etc. Monolithic public chains like Ethereum and Solana can also support DA needs (Bitcoin, due to its non-Turing completeness, lacks good verification solutions for traditional Rollups, but its scalability exploration is progressing rapidly);
Consensus Layer: Responsible for the protocol among nodes to achieve consistency of data and transactions in the network. It verifies transactions and creates new blocks through consensus algorithms (such as PoW or PoS). Most DA projects also require their own consensus layer, usually designed for low hardware requirements and simple verification for light nodes;
Execution Layer: Responsible for processing transactions and executing smart contracts, including transaction verification, execution, and state updates. Layer 2 projects (such as Arbitrum, Optimism, ZKsync) belong to modular blockchains that only have execution layer functions, verifying transaction correctness through the main chain and inheriting the security of the main chain;
Settlement Layer: Responsible for the final settlement of transactions, ensuring the transfer of assets and permanent recording on the blockchain. The main function of the modular settlement layer is to verify the validity proofs and state data of Rollups, with well-known projects like Dymension and Cevmos.
In early history, solutions like the Lightning Network and sidechains around Bitcoin can be seen as "modular pioneers." However, due to Bitcoin's non-Turing completeness, these scaling solutions progressed slowly and had various flaws, leading to limited adoption. Traditional blockchains attempted to solve the trilemma by reconstructing the underlying framework, but with limited effectiveness. To address this issue, Vitalik Buterin proposed improvements around Rollups. With the maturation of fraud proofs and zero-knowledge proofs, the Lego-like construction method of building execution layer architecture on Ethereum gradually became a reality, and Ethereum defined its ultimate path as a layered scaling route centered around Rollups. The Rollup-centric upgrade approach is expected to surpass previous scaling solutions and become the ultimate solution for public chain expansion.
III. The Evolution of Modularization --- Modular Lending
Image Source: Legendary Quant
DeFi modular lending utilizes the security, consensus, and data availability provided by the base layer, primarily focusing on functional modularization at the execution and application layers, running these functional modules on top of the blockchain. Its main modular components include: a collateral management module responsible for storing, managing, and processing user collateral to ensure its security and compliance; an interest rate calculation module that dynamically adjusts lending rates based on market supply and demand, user credit scores, and other factors; a risk assessment module that evaluates the credit risk of borrowers, determining whether to approve loan requests and the required amount of collateral; and a liquidation mechanism module that triggers liquidation procedures when borrowers fail to repay on time, protecting the interests of the platform and other users.
The modular lending system needs to obtain all necessary transaction and contract data from the data availability layer for interaction and verification between modules. The operational results of each module need to be confirmed and recorded through the consensus layer to ensure that all module state changes are secure and consistent. Most of the logic of modular lending operates on the execution layer, implementing the functions of each module through smart contracts. The final settlement and liquidation of lending transactions rely on the settlement layer, ensuring the finality of lending and liquidation transactions.
3.1 Core Concepts
Modular Design: Breaking down the lending process into multiple independent modules, such as collateral management, interest rate calculation, risk assessment, and liquidation mechanisms. Each module can be developed, tested, and deployed independently;
Interoperability: Modules communicate through standardized interfaces, allowing for easy combination of different modules and even cross-platform use of certain modules;
Upgradability: Since each module is independent, a specific module can be upgraded without affecting the operation of the entire system. This feature allows the system to quickly respond to market changes and technological advancements;
Security: Modular design can isolate risks. For example, if a specific module has a security vulnerability, only that module needs to be fixed without affecting the entire system.
3.2 Key Components
Collateral Management Module: Handles the deposit, withdrawal, and management of collateral, ensuring the security and compliance of user collateral;
Interest Rate Calculation Module: Dynamically adjusts lending rates based on market supply and demand, borrower credit scores, and other factors;
Risk Assessment Module: Evaluates the risk of borrowers, determining whether to approve loan requests and the required amount of collateral;
Liquidation Mechanism Module: Triggers liquidation procedures when borrowers fail to repay on time, ensuring the safety of the lending platform's funds.
3.3 Advantages
Flexibility: Different modules can be combined as needed to meet diverse lending requirements;
Efficiency: Optimizing the performance of each module improves the overall system efficiency;
Innovativeness: Allows developers to innovate for specific problems, introducing new modules to enhance functionality;
Transparency: The modular system has higher transparency, with the operational logic and state of each module being auditable and verifiable individually.
3.4 The Role of Cross-Chain and Aggregation in Modular Lending
Image Source: Cross-Chain Bridges Explained
The essence of modular lending is not merely cross-chain and aggregation, although both play important roles in modular lending. The core idea of modular lending is to modularize various functional aspects of the lending process to enhance the system's flexibility, scalability, security, and innovativeness. Cross-chain and aggregation are parts of how modular lending achieves its core concepts, but they are not the only or complete content.
Cross-Chain (Interoperability):
Cross-chain technology: Enables assets and functional modules on different blockchains to interoperate. This is crucial for modular lending as it allows users to transfer assets between different blockchains and utilize various decentralized applications (dApps);
Multi-chain support: By supporting multiple blockchains, lending platforms can enhance their usability and flexibility, attracting more users and assets.
Aggregation:
Aggregation protocols: Aggregate multiple lending protocols and liquidity pools, providing a unified interface and better user experience. For example, users can access multiple lending markets through a single aggregation platform to obtain optimal lending rates;
Liquidity aggregation: By aggregating multiple liquidity sources, it improves capital utilization efficiency and market liquidity.
3.5 Other Key Aspects of Modular Lending
Modular Design:
Functional modularization: Breaking down the lending process into independent functional modules (such as collateral management, interest rate calculation, risk assessment, and liquidation mechanisms), each module can be developed, deployed, and upgraded independently;
Standardized interfaces: Modules communicate through standardized interfaces, ensuring compatibility and interoperability between modules.
Security and Risk Management:
Risk isolation: Modular design can isolate risks within specific modules; if a module encounters issues, it will not affect the entire system;
Security audits: Each module can undergo individual security audits, enhancing the overall system's security.
Flexibility and Scalability:
Flexible combinations: Users and developers can flexibly combine different modules based on needs, adapting to diverse lending requirements;
Scalability: The system's functionality and performance can be expanded by adding or replacing modules without needing to reconstruct the entire system.
Today, some established DeFi platforms like Aave, Compound, and MakerDAO have also begun adopting modular design concepts. For example, MakerDAO is evolving towards a SubDAO model with lower centralization, while Aave's protocol consists of multiple smart contracts that handle borrowing, collateral management, liquidation, and other functions separately. Developers and users can combine these contracts as needed and even develop new contracts to extend the platform's functionality.
IV. Modular Lending Projects
4.1 Morpho Labs
Morpho Labs aims to enhance the efficiency and user experience of decentralized lending markets through technological innovation and optimization, promoting the development of the DeFi ecosystem. Through modular design and frictionless transaction mechanisms, Morpho Labs hopes to attract more users and capital into decentralized finance, with innovations in Morpho Blue and Meta Morpho enhancing DeFi lending efficiency and interoperability.
Image Source: Morpho Labs Official
Morpho Blue
Morpho Blue is an advanced version of a lending protocol provided by Morpho Labs, designed to minimize deployment and create independent lending markets for crypto assets (ERC20 and ERC4626 tokens) on the Ethereum Virtual Machine, aiming to provide a trustless base layer for lenders, borrowers, and applications, adopting dual licensing (BUSL-1.1 and GPLv2), and once deployed, it will run permanently on the Ethereum blockchain (1). Key features and components include:
Collateral: Users borrowing assets must provide collateral in supported crypto assets;
Liquidation Loan-to-Value (LLTV): The protocol sets a minimum value requirement for collateral relative to the borrowed asset. For example, if this ratio is 90%, the value of the borrowed asset must not exceed 90% of the collateral value, or the position will be liquidated;
Borrowing: Users initiate the borrowing process by interacting with the protocol. They specify the amount of assets they wish to borrow and provide the required collateral;
Interest Rates: Borrowers pay interest on the borrowed amount. The interest amount paid is based on the interest rate model used by the protocol. Interest accumulates over time and is paid when the borrower repays the loan;
Repayment: Borrowers can repay the borrowed assets and accrued interest at any time. Once the repayment is confirmed on-chain, borrowers can withdraw their collateral from the smart contract;
Liquidation Mechanism: To reduce default risk, the protocol includes a liquidation mechanism. If the value of the borrowed asset exceeds LLTV (due to market fluctuations or accrued interest), the position can be partially or fully liquidated to repay the loan and any outstanding interest;
Lending: Users initiate the lending process by interacting with the protocol. They specify the amount of assets to be lent and transfer those assets to the smart contract;
Withdrawal: Lenders can withdraw loan assets and accrued interest at any time, provided there is sufficient market liquidity.
A notable feature of Morpho Blue is the ability to create permissionless trading markets, allowing users to create independent markets composed of loan assets, collateral assets, liquidation loan-to-value (LLTV), oracles, and interest rate models (IRM). Each parameter is selected at the time of market creation and remains permanent and immutable, with LLTV and interest rate models needing to be chosen from a series of options approved by the Morpho management department.
Meta Morpho
Meta Morpho is an independent meta-protocol designed to create Meta Morpho Vaults (lending vaults) on top of Morpho Blue, facilitating seamless integration and interoperability across different DeFi platforms and protocols. Its main features include:
Cross-Platform Integration: Meta Morpho allows users to seamlessly transfer assets and strategies between different DeFi protocols;
Enhanced Interoperability: Through standardized interfaces and protocols, Meta Morpho provides better interoperability, making collaboration between different DeFi protocols smoother;
Automated Management: Smart contracts and automation tools make asset management and strategy execution more efficient and reliable;
Liquidity Aggregation: Aggregating liquidity from different platforms improves overall market liquidity and efficiency.
4.2 Euler Finance
Image Source: Euler Finance Official
According to news on February 22, 2024, the lending protocol Euler Finance announced its upcoming restart and the release of version 2. This version is a modular lending platform, primarily consisting of Euler Vault Kit (EVK) and Ethereum Vault Connector (EVC), aimed at enhancing the protocol's flexibility and functionality (2).
Euler Vault Kit (EVK)
EVK is a toolkit that allows users to create and manage custom "vault" systems. EVK enables users to deposit their assets into the vault and set different strategies and rules as needed. EVK integrates with EVC, allowing developers to freely build ERC-4626 vaults. Key features of EVK include:
Custom Strategies: Users can set different strategies based on their needs and risk preferences. For example, specific lending rates and liquidation rules can be established;
Multi-Asset Support: EVK supports various assets, allowing different types of crypto assets to be deposited into the vault;
Flexible Management: Users can flexibly manage and adjust vault settings to adapt to market changes and personal needs;
Security: Through smart contracts and decentralized technology, EVK provides high security, ensuring the safety of user assets.
Ethereum Vault Connector (EVC)
EVC is a tool designed to connect EVK on Ethereum. EVC enables users to seamlessly transfer assets and strategies between different DeFi protocols, empowering vaults to act as collateral for other vaults, facilitating seamless communication between ERC-4626 vaults and other smart contracts. Key features of EVC include:
Unified Interoperability Layer: EVC allows users to transfer assets from one vault to another, regardless of whether these vaults belong to the same protocol. This greatly increases asset liquidity and flexibility;
Strategy Sharing: Users can share and apply the same strategies across different vaults, simplifying management processes;
Automated Management: Through smart contracts, EVC can automate the management of asset transfers and strategy applications, reducing the complexity of manual operations;
Enhanced Liquidity: EVC improves the liquidity of the entire DeFi ecosystem by connecting different vaults, enabling users to utilize their assets more effectively.
Euler Vault Kit (EVK) and Ethereum Vault Connector (EVC) are important features introduced by Euler Finance, aimed at providing higher flexibility and management efficiency. Through EVK, users can create and manage custom vaults; through EVC, users can seamlessly transfer assets and strategies between different vaults. These tools enhance users' control and management capabilities over their assets, contributing to the overall liquidity and efficiency of the DeFi ecosystem.
V. Perspectives on Current Modular Lending
DeFi protocols refer to a series of decentralized applications (dApps) built on blockchain networks that provide traditional financial services such as lending, trading, and insurance on-chain without relying on traditional financial institutions. Modular DeFi protocols improve the flexibility and innovativeness of DeFi protocols by breaking these services into independent modules, allowing users and developers to flexibly combine and utilize different functions.
Currently, DeFi mainly consists of yield aggregators, lending, derivatives, options, and insurance protocols. These modules can be freely combined to create new financial products and services. However, their essential characteristics are similar to the logic of OP Stack's one-click chain deployment, where modular DeFi protocols need to establish module combinations based on their own protocols to create new financial products and services.
Modular DeFi brings flexibility but also comes with potential risks. UniSwap sparked the DeFi boom, becoming the "source code" for various DeFi protocols today. Since the emergence of UniSwap, it has never suffered a hack, fundamentally due to relying on a simple core invariant (tokenBalanceX * tokenBalanceY = k) and its combination with its immutable smart contracts.
However, the flexibility of modularization also brings relative complexity. The high interconnectivity between different DeFi protocols raises the question of whether the failure of a potentially upgradable contract in an individual protocol could trigger a chain reaction affecting other protocols, leading to overall systemic risk, which is an important aspect to consider.
Extended Links:
(1) https://github.com/morpho-org/morpho-blue/blob/main/LICENSE
(2) https://www.euler.finance/blog/euler-v2-the-new-modular-age-of-defi