Risk management is the cornerstone of any successful lending protocol. Thoughtful risk parameters can lower borrowing costs while maintaining liquidity, maximize returns for lender LPs, and drive protocol growth through capital efficiency. But when risk parameters are mishandled, the fallout during extreme market events—like terrifying liquidation cascades—can be catastrophic.
Now, imagine a protocol with risk parameters that dynamically respond to market conditions, automatically adjusting based on advanced (or even ML-based) models. This system could continuously optimize collateral ratios, liquidation thresholds, interest rates, and reserve parameters across markets—striking the perfect balance between maximizing revenue and mitigating insolvency risks.
Sounds amazing, right? So why hasn’t decentralized lending adopted this yet?
On-Chain Data Limitations: Smart contracts can’t access comprehensive historical data due to blockchain smart contract limitation.
Computation Constraints: Running complex ML and risk models directly on-chain is prohibitively expensive in terms of gas costs and time.
As a result, lending protocols have been stuck, unable to directly utilize verifiable on-chain data for trustless, dynamic risk management.
But here’s the good news: Mendi (soon to rebrand to Malda) is changing the game.
Partnering with Brevis: Solving the Problem with ZK Co-Processing
Dynamic risk management requires three critical components:
Verifiable Input Data – Historical blockchain data like liquidity depth and asset price volatility.
Verifiable Computation – Advanced modeling to calculate optimal parameters.
On-Chain Parameter Updates – Seamless updates to the protocol via smart contracts.
While protocols can already handle the third step (updating parameters), the first two have historically required centralized solutions—opaque black boxes running proprietary models on private servers with parameters and setups unknown to the community. While neither the input data nor the computation are verifiable on-chain due to the various centralized entities involved, outputs are shared with protocol DAOs or integrated via centralized oracles, often bypassing transparency and exposing protocols to misaligned incentives.
The result? DeFi risk management starts to resemble TradFi's Moody’s problem—a system where risk managers serve both asset providers and markets. It can easily make people ask: Are they acting in the best interest of investors, or prioritizing the interests of their paying clients?
Although it was naturally the approach many lending protocols went with as there were no feasible alternatives, this is by no means in-line with the ethos of DeFi or decentralization. While the current risk management setup is bound to lead to problems down the road, we at Mendi believe that DeFi should be designed and implemented with a long-term time horizon.
Instead of relying on centralized entities, Mendi will integrate with Brevis, a zk-coprocessor that enables fully verifiable, trustless risk management:
Verifiable Input Data – Brevis extracts historical on-chain data and generates a ZK-proof attesting to its integrity.
Verifiable Computation – Using zkVM and ZKML frameworks such as Brevis SpaZK, the proof is fed into a risk model to calculate new parameters.
Trustless Updates – The model’s results, verified via ZK-proofs, trigger a callback function to update protocol parameters. Faulty proofs prevent updates, ensuring the system’s security.
To ensure transparency, Mendi will open-source the entire implementation from day one, allowing the community to audit and verify the models and computation pipelines. This is risk management the way decentralized lending was meant to be—intelligent, secure, trustless, and community-driven.
Open-source innovation has transformed blockchain and machine learning alike. We’re committed to building dynamic risk management in the same transparent, collaborative way.
We’ll soon onboard community developers who share our passion for combining blockchain and ML, giving them the tools to shape Mendi’s future with verifiable data and models.
Join us, and help Liberate DeFi.
About Mendi
Mendi Finance, soon to be rebranded as Malda, is a decentralized lending protocol currently on the Linea blockchain. In Q1, we will elevate the protocol to new heights by seamlessly unifying liquidity across Ethereum Mainnet and L2s through the integration of ZK proofs.
Brevis is an efficient, verifiable off-chain computation engine that brings limitless computation capacity to existing smart contract blockchains. Utilizing zero-knowledge proofs, Brevis offloads data-intensive, costly computations from on-chain environments to a drastically lower-cost off-chain engine, and empowers Web3 applications to scale seamlessly while preserving the security of L1 trust assumptions.
With Brevis’s versatile Go SDK, smart contracts can access blockchain states, transactions, and receipts across multiple blockchains and timeframes. DApps can transform complex business logic that are expensive to execute with smart contracts into succinct, low-cost circuit outputs that are mathematically verifiable on-chain. Powered by Brevis, use cases like data-driven DeFi, personalized GameFi experiences, and on-chain reputation systems can unlock the full potential of decentralized data, and accelerate blockchain adoption on a broader scale.
Find out more about Brevis: 🌐Website | 🗨️Telegram | 🐦X | 📘SDK Docs