RFS Apply
Request for Startups

Tithe: ML-Enabled Lending

2024-08-01

State of On-Chain Lending

On-chain credit is a fundamental primitive in decentralized finance that enables exposure to different asset mixes without directly purchasing the underlying, allowing for more efficient markets. Among the different offerings available in the DeFi landscape, collateralized money markets, or lending markets, are often used as a building block to enable permissionless access to liquidity and yield. Top on-chain lending protocols have billions of dollars of liquidity locked in them and have originated hundreds of millions of dollars of loans. Because of the major role that lending plays, it’s important that the pools in this ecosystem can react and adapt to the real time market structures they inhabit. Not only is this essential in the context of optimizing borrow and supply rates, it can also guard against more drastic situations, such as the potential of incurring bad debt on the pool. Given the composable nature of lending markets, these rates and the health of these lending pools can have cascading downstream effects that impact the whole DeFi ecosystem.

In April of 2024, the liquid restaking token known as ezETH de-pegged on a news event, hitting as low as $700 on Uniswap. This resulted in a liquidation cascade, netting over $65 million across protocols like Morpho and Gearbox. An ongoing debate has arisen: Is it preferable to have a lending protocol approach like Morpho, where users can create pools with custom risk factors in a permissionless fashion, or is it better to have pool creation curated and risk-monitored by DAO governance? We think that those who are working on lending shouldn’t have to make such a strong tradeoff between user freedom/flexibility and adaptive risk management. But the UX of today’s lending protocol landscape is not equipped to handle this in a flexible manner, where most deployed lending pools are static and immutable, taking in minimal external inputs that are manually provided. How can pools effectively model the world they live in? And how do they efficiently and dynamically adjust themselves in response to those models?

Introducing Tithe

In the current world, it’s uncommon for lending protocols to adjust pool parameters. When it does happen, it’s usually as the result of some specific governance initiative: a third-party typically comes in to assess the protocol and produce some analysis backed by modeling that can be translated into parameter updates (after another vote of course). The fact that these kinds of pool/protocol changes happen rarely is not a signal that they are unnecessary, rather it seems to be an issue of friction and lack of infrastructure that allows for direct communication between protocols, models and data. But it shouldn’t have to be this way, because machine learning is such a powerful toolset for lending protocols. If used effectively, it can be leveraged to model the future state of the pool against the current state of the world in which that pool operates. Enabling a pool to make key decisions around its parameters based on these predicted outcomes from the model is what allows you maximum user expression while still managing risk. And with Ritual, we can finally empower developers to seamlessly integrate machine learning models into their lending protocol.

To showcase this, we’ve prototyped Tithe: a lending protocol that allows you to deploy isolated markets whose parameters can be adjusted by machine learning models.

Tithe animated

As an example of such a lending pool, we’ve trained a model that utilizes a variety of on and off chain features to predict the LTV (Loan-to-Value) of the pool. This predictive insight is valuable and we can use it in realtime to protect the health of the pool: when the prediction is signaling a high LTV beyond a certain threshold, we know that we can dynamically adjust the LLTV (Liquidation-Loan-to-Value) for new deposits. The LLTV parameter for a lending pool is the LTV threshold at which positions will be liquidated at. Being able to adjust this for future deposits when our models are signaling the potential for bad debt in the pool lets us get ahead of the situation and can help potentially reduce losses if conditions really take a turn for the worse.

We use Ritual’s infrastructure to call this ML model natively on-chain, allowing for model inference and parameter updates on the pool to happen in the same transaction. Ritual makes it easy to abstract away the complexity of managing the inference request lifecycle. It allows developers to focus on the business logic, whereas otherwise they would have to deal with complex statement management and asynchronous programming.

Looking Forward

Ritual Chain’s infrastructure will allow builders to push the limits of risk management for on-chain lending in new and unique ways, while also extending the capabilities to augment their protocol with safety features that are more reactive and adaptive to a variety of signals. Ultimately we think that the lending protocols that innovate on this will be able to translate the efficiency and optimization gains from these models into higher yields and more efficient pool utilization.

Finally, beyond the technical aspects of this prototype, we think the general approach introduces an intriguing dynamic around the creation and competition of these models. A marketplace for models that serve lending protocols could be an interesting project on its own. Model creators could earn a portion of the fees generated by pools and the design space for applying these models is very wide. A decentralized marketplace for this would provide a community for these creators to collaborate, share best practices and also further strengthen the economic incentives around model creation for DeFi protocols. Above, we explored maintaining the health of lending pools by predicting LTV to adjust liquidation thresholds and avoid bad debt, however this is just the tip of the iceberg: with sophisticated models, all core functionality can now incorporate machine learning intelligence previously only available in an off-chain or web2 context.

Potential areas for exploration include using interest rate models that incorporate features beyond pool supply and demand, leveraging account on-chain history to assess user credit, among other possibilities. We’d be interested to see folks explore these ideas and more to build dynamic and robust lending protocols on Ritual. The marketplace creates a plug-and-play ecosystem that incentivizes creativity to develop best-in-class lending pool models. It’s a win-win situation: lenders get access to sophisticated, continuously optimized models and a wider range of different ways to express risk, while talented model creators have a direct path to monetize their expertise.

Interested in building this all the way? Make sure to apply to Altar.