Documentation
SocialsStatisticsLaunch App
  • Welcome to Mars Protocol
  • Getting Started
    • How to set up a Wallet
    • Connect your wallet
    • Using a Credit Account
  • Credit Accounts
  • Perpetual Futures (Perps)
    • Perps Vault (Counterparty Vault)
    • Funding Rate Mechanism
    • Price Impact
    • Open Interest Caps
    • Vault Solvency Protection
    • Health Factor
    • Liquidations
  • Spot & Margin Trading
  • Lending & Borrowing
  • Leveraged Yield Farming
  • High Leverage Strategies
  • Managed Vaults
    • Creating a Vault
      • How to Resume Vault Creation After Failed Transaction
    • Managing a Vault
    • Depositing into Vault
  • Risk Methodology
    • Asset Listing
    • Protocol Risk Framework
    • Perps Risk Framework
      • Maximum Leverage & LTVs
      • SkewScale
      • Open Interest Caps
      • Maximum Funding Velocity
      • Mitigating Risks of Static Parameters
    • Deposit Caps Risk Framework
  • Governance
    • MARS Token
  • Smart Contracts
    • Address Provider
    • Account NFT
    • Credit Manager
    • Health
    • Incentives
    • Oracle
    • Params
    • Red Bank
    • Rewards Collector
    • Swapper
    • Zapper
    • Perps
  • Brand kit
    • The Mars Brand
  • Legal
    • Mars FUD Bible
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • Notations
  • Model Deposit Cap
  • Expert Based Cap
  • Key Model Assumptions
  • Key Model Parameters
  • Numerical Example
Edit on GitHub
Export as PDF
  1. Risk Methodology

Deposit Caps Risk Framework

A simplified framework for rapidly estimating deposit caps in money markets using liquidation modeling and on-chain liquidity analysis.

Last updated 3 days ago

This methodology provides a streamlined approach to estimate deposit caps for money markets between the main RF runs []. Due to the time-intensive process required by the full framework, this simplified version enables rapid cap evaluation and monitoring at interim points.

Notations

  • β\beta%β is the minimum liquidation bonus

  • LLL is the β\beta%β on-chain depth (available liquidity with slippage β\betaβ)

  • uoptu_{opt}uopt​ is the optimal utilization threshold (80% is used for all assets for simplicity)

  • xx%x is the liquidated portion of the debt

  • ddd are the liquidated funds

  • QQQ is the total on-chain liquidity

  • TTT is the recovery time for DEX liquidity to get restored after massive liquidation

Model Deposit Cap

Consider an arbitrary liquidation of size ddd. Suppose it takes TTT minutes for the DEX liquidity LLL (β\beta%β depth) to get restored.

In this case, a liquidation will be composed of n=dLn = \frac{d}{L}n=Ld​ iterations, where each iteration will take TTT minutes, and will execute 1/n1/n1/n-th of the liquidation. In total N=n⋅TN = n \cdot TN=n⋅T time units will elapse before the liquidation is fully executed.

Hence, the liquidation period can be estimated as follows:

NL=n⋅T=dL⋅TN_L = n \cdot T = \frac{d}{L} \cdot TNL​=n⋅T=Ld​⋅T

Let NLN_LNL​ is a known liquidation period. If the debt is not liquidated over this period, it goes bankrupt. To estimate Loan-to-Value (LTV) risk parameters, we assume a minimum one-day liquidation period. In 99% of cases, even extreme price changes within this period should not result in bankruptcy. Therefore, the deposit cap can be set at an amount that can be liquidated within this timeframe (NL=24hN_L = 24hNL​=24h).

From this equation, we can find the maximum amount that can be liquidated within a duration of NLN_LNL​ assuming a periodic recovery occurs every TTT hours:

d=NLT⋅Ld = \frac{N_L}{T} \cdot Ld=TNL​​⋅L

Estimation of liquidatable amount ddd:

BorrowedFunds=uopt⋅DepositCapBorrowedFunds = u_{opt} \cdot DepositCapBorrowedFunds=uopt​⋅DepositCap

If xx%x of all borrowed funds are liquidated, the corresponding amount of collateral liquidated will be:

d=BorrowedFunds⋅x⋅(1+β)d = BorrowedFunds \cdot x \cdot (1 + \beta)d=BorrowedFunds⋅x⋅(1+β)

where β\betaβ is the liquidation bonus.

The deposit cap can be determined by solving the following equation:

uopt⋅DepositCap⋅x⋅(1+β)=NLT⋅Lu_{opt} \cdot DepositCap \cdot x \cdot (1 + \beta) = \frac{N_L}{T} \cdot Luopt​⋅DepositCap⋅x⋅(1+β)=TNL​​⋅L

From which we have the model deposit cap:

ModelDepositCap=NLT⋅Luopt⋅x⋅(1+β)ModelDepositCap = \frac{N_L}{T} \cdot \frac{L}{u_{opt} \cdot x \cdot (1 + \beta)}ModelDepositCap=TNL​​⋅uopt​⋅x⋅(1+β)L​

Expert Based Cap

The model cap is limited by an expert-based cap, which is set at 150% of the total on-chain liquidity:

ExpertCap=150ExpertCap = 150% \cdot QExpertCap=150

For new markets the cap is set at 30% of the total on-chain liquidity.

Key Model Assumptions

  • Linear recovery of on-chain liquidity after liquidation

  • No market impact of liquidations on the price (liquidation cascade is not modelled)

  • Deposit caps are determined independently for each market, disregarding combined effects

These simplifying assumptions are offset by using conservative parameters for the recovery period and liquidatable portion, alongside expert-derived caps.

Key Model Parameters

The key model parameters are:

  • xx%x is the liquidated portion of the debt

  • TTT is the recovery time for DEX liquidity to get restored

Historical data should be used to estimate both parameters.

The liquidatable portion, determined by the account's simulation algorithm, is conservatively set at 30% for all assets in this simplified risk framework. Simulations indicate that this percentage typically ranges from 5% to 25%.

Estimating the liquidity recovery period following significant liquidations is challenging due to the difficulty in acquiring data on extreme on-chain liquidation events. However, observed arbitrage activity typically restores liquidity within minutes.

We conservatively consider three parameters:

  • Base - 6h

  • Optimistic - 2h

  • Pessimistic - 12h

Numerical Example

  • β=5\beta = 5%β=5

  • QQQ is the total on-chain liquidity

  • uopt=80u_{opt} = 80%uopt​=80

  • x=30x = 30%x=30

  • T=2hT = 2hT=2h

  • NL=24hN_L = 24hNL​=24h

ModelDepositCap=242⋅L0.8⋅0.3⋅(1+0.05)≈47⋅LModelDepositCap = \frac{24}{2} \cdot \frac{L}{0.8 \cdot 0.3 \cdot (1 + 0.05)} \approx 47 \cdot LModelDepositCap=224​⋅0.8⋅0.3⋅(1+0.05)L​≈47⋅L

For xyk-type pool, the 5% depth is determined as follows:

L=Q2⋅0.05L = \frac{Q}{2} \cdot 0.05L=2Q​⋅0.05

Then

ModelDepositCap=1.19⋅QModelDepositCap = 1.19 \cdot QModelDepositCap=1.19⋅Q

For PCL-type pool, we can apply adjustment of ~1.5x to increase the depth:

L=Q2⋅0.05⋅1.5=0.0375⋅QL = \frac{Q}{2} \cdot 0.05 \cdot 1.5 = 0.0375 \cdot QL=2Q​⋅0.05⋅1.5=0.0375⋅Q

Then

ModelDepositCap=1.78⋅QModelDepositCap = 1.78 \cdot QModelDepositCap=1.78⋅Q

The expert cap is set to 150% of Q. So, the final cap would be:

FinalDepositCap=min⁡(ModelDepositCap,ExpertCap)=1.5⋅QFinalDepositCap = \min(ModelDepositCap, ExpertCap) = 1.5 \cdot QFinalDepositCap=min(ModelDepositCap,ExpertCap)=1.5⋅Q
Deposit Cap Methodology