⚠️⚠️⚠️ WORK IN PROGRESS ⚠️⚠️⚠️
Mochi Protocol is a cross-chain, autonomously governed decentralized stable currency protocol fully-backed by a wide variety of crypto assets, including long-tail and yield-bearing assets. Mochi offers governance-free listing and condition-based stable currency minting capacity. Mochi adjusts collateral specific vault parameters such as collateral factor, liquidation factor, credit cap and stability fees automatically based on liquidity depth (calculated using a variety of reliable and stress-tested data sources) and credit utilization to provide the most capital efficient overcollateralized loans to users, while minimizing risk of shortfall for the protocol to protect and maintain solvency. Mochi unlocks productivity in a diverse variety of collateral, including long-tail, staked, wrapped, and yield bearing assets, to unlock new value and accelerate DeFi innovation.
Mochi is a decentralized stablecoin protocol which enables ungated, condition-based listing of collateral assets. Mochi users can leverage listed collateral to mint the USDM stablecoin through Mochi Vault smart contracts. Collateral specific vault parameters such as collateral factor, credit cap, liquidation factor and stability fees are algorithmically defined and dynamically updated based on total on-chain liquidity and credit utilization - therefore, Mochi vaults are autonomous. This allows a much wider variety of crypto assets, including long-tail and less liquid tokens, with otherwise healthy markets, to get listed, enable collateralization, and mint the USDM stablecoin.
The USDM stablecoin is soft pegged to the USD and Mochi helps maintain the peg with dedicated, highly capital efficient stable pegged-asset pools. This value is fully-backed by overcollateralized vaults with credit parameters assigned based on total on-chain liquidity and credit utilization.
A vault is a smart contract which allows users to deposit accepted token collateral and mint the USDM stablecoin. Only users depositing listed collateral types may open vaults. To avoid liquidation, vaults must maintain their collateral ratio above the liquidation ratio.
USDM is a decentralised stablecoin which uses overcollateralization to maintain its value and peg; it is backed by the TVL in all Mochi vaults.
Autonomously governed vaults will ensure all debts can be safely liquidated to repay loans.
At launch, ERC-20 and ETH network LP tokens will be accepted. In the next iterations, Mochi aims to offer support for a wide range of assets.
New protocols with over a minimum amount of combined liquidity (as decided by the DAO) across decentralized exchanges in accepted pairs (WBTC, ETH, DAI, USDC, USDT, USDM) can request to be listed after at least 4 weeks of maintaining that liquidity. The minimum liquidity through the past 4 week period must be maintained above the minimum amount (which can be set by the DAO).
Further, promotion and demotion through the Risk Factor Categories will also be based on the minimum liquidity through the past 4 week period, and all credit parameters will be updated accordingly.
DeFi requires a protocol that can match the rapid pace of development and innovation in the space. It should be dynamic enough for its users to practice unencumbered, flexible finance.
Mochi fills this need by expanding access to credit to a much wider range of protocols and automating decision making by algorithmically setting listing requirements and vault parameters.
Mochi vault parameters are algorithmically set and dynamically updated based on Chain-State Storage Relay and other data sources.
Protocols are grouped into Risk Factor Categories which determine the Collateral Factor, Liquidation Factor, and (along with utilization) the Stability Fees.
Mochi Vaults are separated into 6 different Risk Factor Categories with the parameters listed in the table below:
RFC | Credit Cap | CF | LF | Min SF | Max SF | Liq Fee | Liquidator Fee |
---|---|---|---|---|---|---|---|
1 | 5% circ. market cap | 90% | 95% | 2.33% | 3.50% | 4.5% | 0.5% |
2 | Calculated based | 80% | 85% | 2.33% | 4.00% | 10% | 1% |
3 | on safe slippage | 75% | 80% | 2.33% | 4.50% | 12.5% | 1.5% |
4 | analysis. Refer to | 65% | 75% | 2.33% | 5.00% | 15% | 2% |
5 | "Mochi Credit | 55% | 65% | 2.33% | 5.25% | 17.5% | 2.5% |
6 | Cap Calculation" | 45% | 60% | 2.33% | 5.50% | 20% | 3% |
Mochi relies on empirical data of aggregate on-chain on liquidity depth to determine the level of credit default risk. Protocols will be classified into Risk Factors Categories (RFC) on a scale of 1-6. Where 1 is the lowest risk, and 6 the highest.
Classification | Risk Factor Category (RFC) | Conditions |
---|---|---|
STABLE | 1 | Assets based on or derived from a USD peg |
ALPHA | 2 | ETH/BTC or > liquidity depth to cause slippage across aggregated on-chain liquidity |
GAMMA | 3 | > liquidity depth to cause slippage across aggregated on-chain liquidity |
DELTA | 4 | liquidity depth to cause slippage across aggregated on-chain liquidity |
ZETA | 5 | liquidity depth to cause slippage across aggregated on-chain liquidity |
SIGMA | 6 | liquidity depth to cause slippage across aggregated on-chain liquidity |
Collateral Factor, or Loan-to-value (LTV) is the amount of USDM debt as a percentage of deposited collateral a user/protocol has accrued. It is capped based on the Token’s Risk Factor Category(RFC) (refer to Collateral Factor/Ratio Max on this table). The CF for a vault can be calculated as:
This is the loan-to-value (LTV) and calculated in real time. For example, if the current collateral deposited has a market value of $, and the user borrows $. then the CF is .
CF for a vault must always be maintained below the Liquidation Factor (LF) to keep the vault from being liquidated.
At loan initiation, the max CF is achieved when the user withdraws the largest loan possible against the deposited collateral. A safety buffer is maintained between max CF and LF to protect users against liquidations due to normal volatility.
Max CF, safety buffer and LF are defined for each RFC as per section 2.10.
The Liquidation Factor is the Collateral Factor at which the vault will be liquidated. It is the ratio of debt/market value of collateral at which collateral assets will be liquidated to recover the amount borrowed by the user. CF should be maintained below LF to maintain the Vault.
As an example:
If CF >= LF, assets will be liquidated.
The Liquidation Factor for each RFC is set in a conservative manner such that Mochi can rapidly recover debts in the worst case scenario where the market value of the asset crashes.
Stability Fees are an annual amount in USDM owed on minted USDM to maintain protocol robustness.
Some current DeFi lending protocols utilize a static fee structure similar to Maker. Mochi provides an improvement over the static fee structure by employing dynamic stability fees which adjust according to market conditions. This allows the protocol to maximize utilization and revenue while providing the most competitive rates to users, as well as help stabilize the USDM peg.
Mochi implements a variable stability fee mechanism that adjusts according to the Risk Factor Category and Utilization.
Utilization (u)- represents the ratio of borrowed USDM to the maximum USDM debt that can be assigned to a protocol (credit cap).
The minFee and maxFee are set by the DAO for each RFC.
Stability fee versus utilization for the various RFCs
Discussion
The stability fee function aims to satisfy the following conditions:
Impact of Utilization (u):
Impact of RFC:
Credit Cap represents the maximum amount of USDM debt which can be assigned to a protocol or collateral type across all vaults. It is algorithmically set for each protocol as a proportion of the combined liquidity depth (LD) across the major decentralized exchange (DEX) pool pairs.
The Credit Cap of a protocol is defined initially as:
This document contains safe slippage analysis for the purpose of credit cap calculation. Slippage control to determine safe credit caps is a key factor in ensuring safe liquidations.
Based on empirical data collected from liquidity aggregators, the following line of best fit equation was obtained for slippage and number of tokens sold ():
(1)
where:
- price decrease; it cannot be less than or greater than ,
- total number of tokens sold,
And, , , , and are constants specific to the coin.
When collateral is liquidated, the asset price decreases and the final price is given by formula . However, the average price at which tokens are sold will be higher than the resulting market price at the end of liquidation. We assume slippage does not depend on whether the swaps are split in parts or sold all at once.
Since liquidations are not instantaneous, say, before liquidation could be completed, ya tokens are sold in the market, and in accordance to formula the price slipped by . (natural slippage).
After that, due to vault liquidation, number of tokens are sold (total number of tokens sold (natural+liquidation) is ), and therefore net price slippage is .
Blue line represents dependence between slippage fraction and number of tokens sold in accordance with formula .
Total slippage loss during liquidation can be graphically represented as the area of the red shape. If the amount of tokens sold was small then we could consider that slippage is constant and losses would be a product of the amount of tokens sold and current slippage.
Since slippage changes, we have to use integration. However, the area of red shape can’t be found by direct integration, because the inverse of function cannot be solved in simple terms.
Green shape represents the definite integral of within segment .
This value has no clear economic meaning, but can be used as an intermediate result for further calculations.
Finally, the net price loss can be found using the formula below:
This value can be calculated without iteration only if values , , , are known. In our modelling, we already know what fraction of an asset price can be safely lost (max.safe price loss), (natural slippage), (calculated using formula ) and values and have to be found.
The final goal of the iterative process is to converge to .
In order to obtain , introduce an iteration algorithm.
Superscript added to variables that depend on iteration number.
Assume that dependence between slippage and number of tokens is close to linear, therefore if we know the maximum safe loss , and , then can be calculated during first iteration by formula below:
Iteration process converges when
After the above iteration process we obtain value , and then use it to find the number of tokens that can be sold to keep slippage within a safe range.
The number of tokens that can be sold during liquidation to keep it breakeven is calculated as .
Therefore, the safe credit cap is given by:
This value ensures that based on the model proposed, liquidation will be safe.
Model constraints and comments:
Variable | Column 2 |
---|---|
Fraction of price decrease; it can be not less than or greater than | |
Number of tokens sold | |
Fraction of price decrease after natural slippage | |
Fraction of price decrease after natural slippage and liquidation | |
Number of tokens sold during natural slippage | |
Number of tokens sold during natural slippage and liquidation | |
Maximum safe slippage | |
Estimation of on -th iteration. | |
Fraction of value lost during liquidation (if all tokens sold at price before natural slippage, it would be ) | |
Value of calculated on -th iteration | |
Liquidation factor | |
Price of coin |
Step 1: RFC determination for $AAVE (based on sell order which causes slippage)
Number of tokens to cause slippage is given by line of best fit equation:
(1)
Where and , , , and are constants.
Value of sell order @
For Aave, this equation yields
Using table below, RFC is then assigned as
Classification | Risk Factor Category(RFC) | Conditions |
---|---|---|
STABLE | 1 | Assets based on or derived from a USD peg |
ALPHA | 2 | ETH/BTC or liquidity depth to cause slippage across aggregated on-chain liquidity |
GAMMA | 3 | liquidity depth to cause slippage across aggregated on-chain liquidity |
DELTA | 4 | liquidity depth to cause slippage across aggregated on-chain liquidity |
ZETA | 5 | liquidity depth to cause slippage across aggregated on-chain liquidity |
SIGMA | 6 | liquidity depth to cause slippage across aggregated on-chain liquidity |
Step 2: Calculate max.safe price loss
Import params for RFC from table:
RFC | 1 | 2 | 3 | 4 | 5 | 6 |
---|---|---|---|---|---|---|
LF(liquid_CF) | ||||||
liquidator_Fee | ||||||
liquidation_Fee |
Assume the vault is about to be liquidated ,
Loan value =
Then, total value of loan that must be recovered to prevent value with
Therefore, maximum safe price loss
Step 3: Calculate max.safe slippage using iteration
Assume natural slippage of maximum safe price loss (assumption based on RFC)
Therefore,
For iteration 1,
Therefore,
Next, find the effective market price lost using the formula:
and can be calculated using the omni equation from above.
We get,
The definite integral is calculated as follows:
Since it is a definite integral with given bounds and , we can ignore the constant.
Therefore, the result is given by:
substitute in equation
) = substitute in equation
Thus,
And,
And,
Then,
Finally,
Effective market price lost =
Find the residual error = absolute value of Effective market price lost - maximum safe price lost
Therefore, iteration must continue as long as residual error is not below .
For second iteration,
is given by the formula
Therefore,
Complete iteration using and using the same methodology as the first iteration, to get
Calculate residual error
Therefore, another iteration is required.
For third iteration,
is given by the formula
Therefore,
Complete iteration 3 using the same methodology, find the residual error.
Perform additional iterations until the residual error is .
For AAVE, the iterative process yielded a negligible residual error at iteration , giving estimated safe slippage =
Step 4: Calculate Safe Credit Cap
Natural slippage =
Token amount for natural slippage (calculated using 1)
Max.safe slippage =
Token amount for maximum safe slippage (calculated using 1)
Safe token liquidation amount after natural slippage
Liquidation divests collateral assets to USDM to maintain protocol solvency. It happens when the collateral factor becomes equal to the liquidation factor.
In Mochi protocol, every USDM is overcollateralized which minimizes shortfall risk and ensures peg stability.
If the Collateral Factor (CF) rises to become equal to the Liquidation Factor (LF), the user's vault will be subject to liquidation. Anyone can trigger a liquidation directly via the smart contract interface, by sending a trigger transaction. There are also liquidation bots that consistently monitor Vaults and trigger liquidations if the Token Price meets the User’s Vault Liquidation Price or lower.
A Dutch auction starts for underlying collateral with a linear decrease in price.
For example, if there is a 100 USDM debt, which includes the 10% liquidation fee; when a liquidator buys the collateral for 100 USDM, 90 USDM is burned to repay the user’s debt, and the remaining 10 USDM goes to the treasury.
Table 4. Dutch auction algorithm
While True:
Calculate CF and LF
IF CF⩾LF:
Initialize blockprice with (spot + liqfree) value
Set pricestep to liqfee / numblocks
For block in Blocks:
While block is NOT sold:
Try to sell block
IF blockprice > spot
Set blockprice to (blockprice - pricestep)
All Mochi Vaults will support flash loans of USDM which enable smooth, reliable, safe and consistent liquidations. Liquidator keepers will receive a variable fee from to up to of the vaults debt - based on the vaults token class. Learning from the experience of Black Thursday, Mochi liquidations process is much more resilient and stress tested to deal with extreme circumstances.
With flash loans, a liquidator doesn't need to source USDM to buy collateral. Instead, they can flash borrow USDM @ 0.1337% fee to buy the collateral, liquidate the collateral and repay the USDM debt in a single transaction. This ensures efficient liquidations where the users/bots do not need to wait for the "right pricing" to liquidate, which protects the protocol from shortfall risk.
After collateral realization (when the debt position has been successfully sold to a bidder):
The Mochi Chain-State Storage Relay (CSSR) model ensures that any relevant token state is committed to on-chain data availability. It does so by separating the process into:
Bifurcating the process ensures that StateProof can open up access to chain-states, saving the state of previous blocks to help support a diverse range of token data. This expands the limitations of current forms of historical data access since a pair can only submit data once in every 256 blocks.
Below describes how the StorageProof CSSR works:
With the StorageProof CSSR, it is easy to access accurate historical on-chain data of long-tail assets, which has not been possible before.
Since Mochi allows users to deposit LP tokens as collateral, calculating the LP token's critical data is required. We can use the CSSR Router to route through multiple layers and unwrap the data of the underlying token.
Let’s say we want to calculate the price of the “ETH<>BTC Uniswap V2 LP token.”: