DeFi Vault Risk Framework
Designed a V1 risk framework deliberately built for speed under high-growth and maintainability by a small team, without sacrificing risk management.
The Problem
A vault curator allocates depositor capital across venues, strategies, and assets. Every allocation carries the risk of loss, whether from a protocol exploit (operational and technology risk) or market and credit risk, such as from a stablecoin depeg.
The V1 risk framework replaces qualitative judgment with a consistent, quantified process that works across different types of strategies. Risk is quantified in a single weighted score, allowing it to scale across assets and strategies. Exposure to known failure modes is fully prevented or capped before capital is deployed, and allocation follows the strongest risk-adjusted yield rather than the highest headline yield.
Approach
The framework is built to be maintained by a small team and to react quickly to a shifting DeFi market. The model is designed to work across different DeFi strategies (e.g. lending, borrow loops). It scores risk across multiple dimensions, including blockchain risk, protocol risk, asset risk, and strategy risk (e.g. credit risk in lending). The risk evaluation then feeds into vault management decisions, including maximum risk thresholds, maximum allocation weights, and allocations based on risk-adjusted yield. Furthermore, the risk assessment informs parameter selection, such as the selected loan-to-value ratio for loans. The risk modelling involves stress-testing via Monte-Carlo simulations and Merton Jump-Diffusion models using Python.
Risk Factors
- Blockchain Risk: Risk of the underlying blockchain. Metrics include e.g. TVL over time, uptime, and technical mechanisms like forced withdrawal options for L2s.
- Protocol Risk: Risk of protocols used. Metrics include time-weighted TVL, audits, and exploit history including responses & compensation plans.
- Asset Risk: Risk of assets the vault is exposed to. For example, the vault has exposure to assets it holds or collateral assets it lends against. In the case of backed assets like stablecoins, the framework evaluates elements such as collateral, collateralization rate, redemption mechanisms, smart contract security and admin controls to identify potential stress scenarios.
- Strategy Risk: For instance, the risk of bad debt for lending strategies, considering asset risk, market parameters & oracles, and DEX liquidity scenarios.
- A) Current DEX liquidity is discounted to account for market shocks where liquidity historically dries up (liquidity risk).
- B) Uses historical price data to calibrate fat-tailed (leptokurtic) models, such as Merton Jump-Diffusion models, which account for the true nature of crypto markets. Thousands of Monte Carlo simulations stress-test the strategy against extreme jump events to determine risk (e.g. risk of bad debt when lending) and identify parameters (e.g. LTV ratios when borrowing). Limitation: Price history for crypto assets, especially new ones, is short. Moreover, for backed assets like stablecoins, secondary market price is not a reliable risk signal. Exposure is to the underlying strategy backing the token (e.g. private credit), and losses surface in net asset value (NAV) once realized, not in price beforehand.
Tail losses are explicitly modelled via jump-diffusion models.
The resulting loss distribution, with VaR and ES at the 99th percentile.
How Risk Informs Vault Strategies
The risk assessment drives four decisions:
- Consideration Set: Apply maximum risk thresholds to disqualify assets that exceed a vault’s risk tolerance. Assets can be excluded based on individual risk metrics, composite risk scores within a category, or the total risk score.
- Maximum Allocations: Hard caps on the maximum exposure a vault can take per chain, protocol, and asset. For instance, a lending optimizer may cap its maximum allowed exposure to protocols (e.g. Morpho, Euler), markets (e.g. cbBTC-USDC, WBTC-USDC, WBTC-USDT), collateral assets (e.g. caps individually for cbBTC & WBTC, and collectively as exposure to BTC-related assets) across markets and protocols, and risk groups (e.g. risk group A, B, C). I built a demo version for what such a lending optimizer can look like here.
- Actual Allocations: Final sizing compares the yield premium against the modelled risk premium.
- Parameter Selection: Risk factors inform a vault’s parameters. For example in a borrow loop, LTV is set based on the market’s LLTV, oracle design, and the modelled price volatility between debt and collateral asset.
V2 Risk Framework
Status: In the research stage. The logic below reasons from how V2 improves upon V1 and is not yet implemented.
V1 prioritized speed under hyper-growth and made deliberate simplifications to stay maintainable by a small team. It aimed to be directionally correct on a large number of assets to prevent losses, which it succeeded in. As a tradeoff, it sacrificed detail and lead to an overly broad exclusion of assets, filtering out assets that warranted inclusion (false positives).
These are the limitations of V1 that V2 targets:
- Real-time scoring: V1 scored risks at the moment of allocation and required manual review afterwards. V2 aims to run dynamically, with real-time monitoring and automated simulations (operational improvement).
- Depth: V1 had to balance speed against depth. For example, asset issuers within the same vertical (e.g. stablecoin backed by private credit) received similar asset risk scores, and the scoring range within a vertical stayed narrow. V2 introduces granular checklists per asset type and deeper data analysis to better differentiate risk within a vertical.
- Multi-level simulation: Following from the depth, V2 uses the additional data per asset to run multi-level simulations rather than relying on vertical-level information.
Every risk resolves to two numbers: the probability of a loss and the loss given default (LGD).
Illustrative bad debt calculation logic for a lending vault
For a stablecoin lending optimizer, the loss to depositors is built in two stages.
Stage 1 - Loss on the collateral token: The model builds negative price scenarios for the collateral asset. Native assets (BTC) draw on historical volatility; backed assets (stablecoins) draw on a strategy-specific loss assessment of the underlying reserves (private credit, lending optimizer). Jump-diffusion and alternate-scenario stress tests turn these into a set of loss scenarios, each with a probability and a size. The model then applies safeguards like collateralization ratio, liquidation mechanism, equity cushion, senior tranche, insurance, etc. The output is a loss distribution for the collateral token.
Stage 2 - Bad debt for lenders: For each collateral-loss scenario, the model traces the liquidation path. Liquidation volume follows from the liquidation loan-to-value (LLTV) and borrower health factors; whether liquidation happens depends on liquidator profitability. The model ranks every route into a waterfall, most profitable first: (1) decentralized exchange (DEX) liquidity via slippage curves, (2) primary redemption capacity net of duration and fees, (3) third-party protocols. Stress scenarios discount DEX liquidity and redemption capacity. Where liquidation is unprofitable, the lender absorbs bad debt equal to outstanding debt minus value recovered from collateral.
Outcome
- 0 losses
- since inception (May 2025); TVL scaled to $100M
- Unaffected
- by Stream Finance & other blowups as assets have been disqualified by the risk framework
- Selected by Base
- as Day 1 launch partner for tokenized equity vaults