Mars Protocol Litepaper 1.0
By: Mars Protocol
Tags: Luna, Finance, Mars, Crypto, Terra

Alpha-style leveraged yield farming as above will be the first application built, but we can also imagine levered Yearn-style vault strategies. An example would be a bLUNA ANC farming strategy.

Liquidations

Collateralised Borrowing

When borrowers’s loan-to-value LTV ratio falls below the required maintenance margin, which happens when their collateral decreases in value relative to their debt (or vice versa), they are susceptible to be liquidated. Any address can repay a fraction of a borrower’s debt (max fraction determined by the close factor) in exchange for an equivalent amount of the borrower’s collateral plus a bonus. Liquidators can choose to receive either liquidity tokens (which will be transferred from the borrower to them) or receive the underlying assets (which causes the borrower’s liquidity tokens to be burned).

Uncollateralised Borrowing

Liquidation for uncollateralised borrowing works similarly to that of the money market. For example, with the Mirror strategy, a user’s asset is in the form of staked MIR-UST LP tokens. If the value of these LP tokens falls below the liquidation threshold, defined as a percentage of the user’s debt, anyone can close the position. The assets are removed from the liquidity pool, and the UST portion immediately used to pay back the debt. The MIR portion can be claimed by liquidators who provide additional UST to pay off the remaining debt. For example, a liquidator who pays off 50% of the remaining debt is awarded 50% of these MIR.

3. Controller — Dynamic Interest Rates using Control Theory

The Interest Rate Pricing Problem

With traditional money markets such as Compound, the interest rate is set in a two-step process. First, a certain money market utilisation rate (amount borrowed / amount deposited) is targeted which reflects the riskiness of that asset. Then, a curve is hard-coded that aims to discourage utilisation past the optimal level by sharply increasing slope, and consequently interest rate.

The problem with this model is that the curve is fixed and cannot react to external market conditions. For instance, if there’s a particularly good stablecoin farm one week paying ~500% APR, then even at the ~90% interest rate corresponding to 100% utilisation on most money markets, borrowers will be unwilling to pay back their debts and depositors will be unwilling to supply more assets to the pool. Similarly, if external yields are extremely low, then the interest rate charged may be too high and result in sub-optimal utilisation.

This was extremely apparent during the first launch of Alpha Homora V2. Yields on Alpha Homora PERP/USDC pool were ~500% whereas USDC depositors on CREAM, who were lending to Alpha farmers, were only receiving ~50%. As a result, there wasn’t enough liquidity to enable farming on Alpha.

In traditional models, the only way to address this is by changing the money market’s interest rate model via a governance vote. This is slow, difficult to implement and requires an extremely active governance process that can constantly react to market conditions.

The Mars Solution — Reactive Interest Rates

Mars implements a different solution. Mars money market pools will still target an optimal utilisation rate, but rather than doing so via a curve, we use control theory to allow interest rates to adapt dynamically to market conditions in real-time.

In the traditional money market model described above, the interest rate is calculated based only on the current utilisation rate. Our idea is to look at the utilisation as a parameter that can be manipulated by another parameter (like temperature in a physical system can be manipulated using heating and cooling units). Keeping a response parameter constant is quite a common problem in control theory and there is a well known method to solve it — the proportional-integral-derivative (PID) controller and its variations. A PID controller continuously calculates the difference between the desired point (set point — optimal utilisation) and actual value (process variable — actual utilisation). Then it continuously corrects itself based on the proportional, derivative, and integral terms.

The Proportional-Derivative-Integral (PID) contains three terms, each with its own purpose:

1/ Proportional term: Yields a corrective response based on the error between target and actual utilisation. Kp is a constant which determines the magnitude of change in interest rate for a given error

2/ Integral term: Takes into account historical errors and integrates them in order to eliminate the residual error. Ki is a constant which determines how quickly IR should adjust based on previous errors.

3/ Derivative term: Estimates the future trend of the error based on its current rate of change. Kd is a constant which allows us to modulate the corrections to avoid overshooting.

We propose a way to implement this method in Credit Protocols. We assume that interest rate is the main factor that drives the utilisation and set that as the control parameter in our model, with utilisation being our response parameter. The overall algorithm to calculate the borrow interest rate can be seen below.