Mastering Morpho Blue with the Nuant Simulator

Published on:
January 11, 2024
Reading time:
5 min

In the ever-evolving world of decentralized finance (DeFi), Morpho Labs has emerged as a game-changer since its launch in June 2021. Co-founded by Paul Frambot and Merlin Egalite, the company secured an impressive $18 million in funding from A16Z, Variant, Nascent and Coinbase Ventures. With a focus on improving money market protocols, Morpho Labs introduces three groundbreaking products: Morpho Optimizer, Morpho Blue, and Meta Morpho.

> Morpho Optimizer which facilitates peer-to-peer (P2P) matching between borrowers and lenders, enhancing rates for both parties involved.

> Morpho Blue which allows the creation of composable, decentralized and permissionless money markets.

MetaMorpho which is the first permissionless lending vault on top of Morpho Blue.

Morpho Optimizer has demonstrated its impact with a supplied volume of over $1.20 billion and a borrowed volume exceeding $699.29 million. The platform's available liquidity stands at an impressive $5.28 billion, showcasing its pivotal role in reshaping decentralized finance dynamics.

This article will highlight Morpho Labs' second product named Morpho Blue, while exploring the value of Nuant's DeFi simulator in the context of optimizing the use of Morpho Blue.

Introducing Morpho Blue

As existing money markets and lending protocols are governed by DAOs, relying on several votes each week to update risk parameters, the need for a new layer—a primitive that enables composability, decentralization, and permissionlessness market creation—has become increasingly evident.

Enter Morpho Blue, a lending primitive designed by Morpho Labs to address the limitations of current DeFi protocols. At its core, Morpho Blue offers a trustless and efficient lending solution with permissionless market creation, opening doors to a new era of money market protocol.

Morpho Blue can be described in three main points:

Trustless:

Morpho Blue stands out as a trustless lending primitive, embodying immutability and governance minimization. With a concise codebase, users can easily check the reliability of Morpho Blue's codebase. This commitment to trustlessness ensures the security of user assets while minimizing the need for complex governance structures. This is in contrast to other lending projects with thousands of lines of code and risk parameters submitted by risk service provider in close source and voted by token holders.

Efficient:

Efficiency is at the heart of Morpho Blue's design. By allowing higher collateralization factors, Morpho Blue enables users to benefit from better interest rates and a significant reduction in gas costs. This efficiency enhances the user experience and allows greater freedom. With other protocols, the parameters are proposed by risk service provider or community members and voted on. Then the market parameters of an asset will be identical for everyone. With Morpho Blue, several risk service providers offer different risk parameters.

Flexible:

Morpho Blue introduces a clear separation between risk management and the immutable core protocol, creating an open base layer that offers an unprecedented level of flexibility in decentralized lending. This flexibility is manifested through permissionless market creation and permissionless risk management.

On top of Morpho Blue, MetaMorpho will abstract complexity for users while providing risk profiles: RWAs, crypto assets, institutes. For example SteakhouseFi will build a USDC MetaMorpho Vault focused on Real World Assets (RWA). SteakhouseFi will initially lend against authorised tokenised short-term US Treasury Bills (bIB01) issued to KYC's users by BackedFi.

Risk Experts in Permissionless Risk Management Layer

Morpho Labs envisions a diverse ecosystem built on top of Morpho Blue, with risk experts taking center stage in the permissionless risk management layer. These experts will play a crucial role in configuring risk parameters for each lending/borrowing market. It is therefore crucial for risk experts to use simulation tools when creating the various market parameters (LTV, LT, LB, Supply Cap, Borrow Cap, LPF, etc.).

Current Approach:
Figure 1
Morpho Blue's Approach:
Figure 2

Nuant Simulator

At Nuant, our mission is to become the leading data infrastructure and solutions provider for all financial institutions to benefit from the crypto asset economy. We aim to empower our clients with innovative tools and technologies that increase operational efficiency, reduce risk and maximize returns. By leveraging our expertise, experience, and cutting-edge technologies, we strive to deliver unparalleled value to our clients to help them gain the edge.

We introduced the Nuant Quantitative System (NQS) in May 2023 as a brand-new, state-of-the-art solution designed to tackle the unique challenges of DeFi quantitative risk assessment and strategies simulation.

Since then, it has evolved into the Nuant Simulator which provides a robust suite of tools for quantitative analytics, risk management, and research, enabling portfolio managers, quant strategists, data scientists and developers to confidently navigate the complex DeFi ecosystem.

What sets the simulator apart are its extensive capabilities:

> Run simulations with unlimited tokens for thorough market analysis.

> Simulate borrow, collateral deposit, swaps and dex liquidity provision scenarios to study associated risks and opportunities

> Mimic real-world behaviors like liquidity addition and position exit for accurate insights.

> Evaluate performance and risk of individual strategies.

> Capture long-term user interactions for a broader perspective.

The simulator comprises three layers:

The Data Stream is a powerful blockchain data infrastructure that combines data fetching, aggregation, efficient storage, and reliable delivery from leading DeFi protocols like Uniswap, Aave, and Compound, providing a comprehensive and up-to-date view of the DeFi landscape.

The Quantitative Framework is a state-of-the-art framework that empowers users to model, evaluate, and optimize DeFi protocols and strategies. Leveraging the Data Stream’s solid foundation, the QF features cross-protocol simulation and advanced simulations, enabling users to assess the risks of various protocols, analyze performance, and compare DeFi strategies in a unified environment.

The Integrated Environment is a web-based IDE that enables developers to rapidly build, test, and deploy data-intensive applications and analytics leveraging blockchain data. Based on the popular Visual Studio Code platform, IE supports popular programming languages like Python, TypeScript, and Solidity and offers seamless integration with the Data Stream and Quantitative Layer.

An Example:

Nuant had already produced a Risk Assessment Report of Compound v2 using the simulator to stress test the protocol’s stability and evaluate the risks faced by investors.

There are several risks associated with interacting with DeFi protocols; however, with lending protocols, the amount of bad debt (non-repayable loans) is a predominant indicator of health. The most immediate risk facing investors, which the report addresses, is liquidation. As the value of debt and collateral changes, investors must maintain a minimum collateral level against each position in order to avoid liquidation.

Another risk is protocol liquidity risk. Since the assets posted as collateral can be borrowed by other users, an investor may be unable to withdraw funds if the protocol liquidity (the total amount of token supplied that has not been borrowed by debtors) is less than the deposit.

To assess the combined effects of these risks, the Nuant DeFi Simulation Engine replicates protocol dynamics to generate cross-protocol, multi-agent simulations, which allows for the testing of multiple protocols under different market conditions and agent behaviors.

How can Morpho Blue’s new Risk Experts use Nuant’s simulator?

As they need to tailor risk analysis and management for the specific needs of the markets they aim to build, risk managers can leverage the simulator to build markets on top of Morpho Blue.

In its current state, Nuant users can use our implementation of compound simulator to study various types of market scenarios.

Let’s take the example of a Risk expert willing to create a new lending pool (ETH/USDC) on Morpho Blue.

This risk expert wants to have an attractive pool compared to AAVE or Compound so his goal is to allow users to have a higher LTV (loan to value). With a higher LTV lenders will earn more yield and borrowers will be able to borrow a larger amount of assets.However this will increase the probability of liquidation and thus the probability of the pool having bad debt. The risk expert uses the simulator to understand the behaviour of the lending pool with various market conditions.

Let’s dive into this :

The first step consists in creating the pool that we are willing to simulate. Here let’s not toggle the calibration button in order to manually set the various parameters.

Parameters1

The second step is to set the various risk parameters (those are the historical parameters corresponding to the period between September 1st and October 31st 2023) and only change the collateral factors.

Parameters2a
Parameters2b
Parameters2c
Parameters2d

The last step is to simulate random paths for the price of ETH throughout the given period, let’s calibrate the spot parameters in order to have realistic price paths.

Parameters

Now, let’s analyse the various results

First we have the result of the simulated paths for the price of ETH:

results1

We can notice that in average, the price went up, so we can expect that, in average, the simulated compound users will withdraw their ETH from the protocol in order to avoid being liquidated.

results2

As we expected, the total amount borrowed in ETH is indeed falling, and we note that the area around the curve is quite thin, which underlines that this behavior is less volatile.

results3

Finally, we note that there are exactly 0 failed withdrawals over the duration of the simulation, which reinforces our belief that a risk manager could have deployed this pool on Morpho Blue and that it would not have generated bad debt.

In conclusion, we have showcased the capabilities of the Nuant Simulator in analyzing market scenarios and assessing risk parameters for Morpho Blue. However, it's important to note that the simulator is still set to evolve, with endless possibilities for further advancements and enhancements. With continued development and refinement, the Nuant Simulator has the potential to become an even more powerful tool for risk analysis and decision-making in the field of decentralized finance.

Conclusion

Morpho Blue's innovative design and trustless lending solution have positioned it as a future key player in the decentralized finance landscape. By offering permissionless market creation and flexible risk management, Morpho Blue empowers users to optimize their lending and borrowing experience.

With risk experts utilizing emerging tools such as Nuant's simulator to analyze market scenarios and assess risk parameters, Morpho Blue is set to revolutionize the way users interact with money market protocols.

Please keep in mind that the risk manager is ultimately responsible for making informed decisions regarding the creation and management of markets on Morpho Blue. The Nuant Simulator is provided as a tool to assist in risk analysis and decision-making, but it is not a substitute for careful consideration and expertise in the field of decentralized finance.

Similar articles