Overcollateralized Loans

Core Concepts: Liquidation Risk Elimination and General Conditions

Why do we use dynamic mathematical models?

Dynamic models offer several key advantages, particularly in the rapidly evolving ecosystem of decentralized finance (DeFi). Here are some reasons why they are particularly beneficial:

Real-Time Adaptability

Static models can become quickly outdated or fail to capture the ever-changing variables in financial markets. Dynamic models, on the other hand, adjust in real-time, providing the ability to instantly react to market conditions.

Risk Mitigation

Dynamic models can be fine-tuned to better manage and mitigate risks. They can adapt to varying levels of volatility, borrower behavior, and other risk factors to ensure the system stays robust.

Efficiency

Dynamic models allow for automated adjustments, reducing the need for manual intervention and thereby improving operational efficiency. They also enable optimal resource allocation by automatically adjusting to changes in demand and supply.

Fairness and Transparency

With dynamic models, all participants get rates, premiums, and opportunities based on the latest data, ensuring a more equitable distribution of resources and opportunities. These real-time adjustments are transparent and can be audited, fostering trust within the ecosystem.

Scalability

Dynamic models are better suited to handle the increasing complexity that comes with scale. As a DeFi platform grows, it's crucial to have models that can adjust to the new scale while maintaining system integrity.

Customization

Users with different needs and risk profiles can benefit from a model that adapts dynamically. A dynamic model can offer customized rates, terms, and other features based on individual behavior and broader market movements.

In summary, dynamic models in DeFi platforms offer real-time adaptability, enhanced risk management, and operational efficiency. Their ability to adjust to ever-changing variables makes them crucial for building a resilient and scalable financial infrastructure.

Introduction

Overcollateralized loans have become an aspect of the ever changing decentralized finance (DeFi) landscape. These financial tools allow users to deposit assets as collateral in order to borrow assets. While they provide a means of obtaining loans without intermediaries it is essential to comprehend the mathematical foundations behind them. This section delves into the concepts with a focus on the mechanisms that aim to minimize liquidation risk and the overall requirements, for overcollateralized loans.

Liquidation Risk Elimination Overview

Liquidation risk refers to the possibility of the borrowers assets being sold off if their value drops below a threshold in relation to the borrowed amount. Ensuring that this risk is minimized or eliminated is crucial, for maintaining the reliability and trustworthiness of DeFi platforms. To achieve this various mathematical and functional strategies are utilized.

Dynamic Collateral Adjustment (DCA)

Mathematical Model

AdditionalCollateral=LoanAmount×(NewVolatility100OldVolatility100)Additional Collateral=Loan Amount×(New Volatility100−Old Volatility100)

Inputs

  • Loan Amount: The initial amount borrowed.

  • New Volatility: The updated volatility rate.

  • Old Volatility: The previous volatility rate.

Output

  • Additional Collateral: The extra collateral needed to balance the loan.

Code Example

def calculate_additional_collateral(loan_amount, new_volatility, old_volatility):
    additional_collateral = loan_amount * ((new_volatility / 100) - (old_volatility / 100))
    return additional_collateral

Insurance Pools

Mathematical Model

The insurance premiums can be dynamically adjusted using the formula:

Premium=LoanAmount×(RiskScore100+Volatility200)Premium=Loan Amount×(Risk Score100+Volatility200)

Inputs

  • Loan Amount: The initial amount borrowed.

  • Risk Score: A metric to quantify the borrower's risk.

  • Volatility: The volatility of the collateral.

Output

  • Premium: The insurance premium.

Code Example

def calculate_premium(loan_amount, risk_score, volatility):
    premium = loan_amount * ((risk_score / 100) + (volatility / 200))
    return premium

Dynamic Mathematical Model for Liquidation Risk Elimination

Mathematical Model

Inputs:

  • LALA: Loan Amount

  • CVCV: Current Collateral Value

  • LRLR: Liquidation Ratio (often set at 1.028 or 102.8%)

  • PP: Market Price of the asset used as collateral

Outputs:

  • LTVLTV: Loan to Value ratio

  • LL: Liquidation Point

Equations:

LTV=LACV×100\begin{equation} LTV = \frac{{LA}}{{CV}} \times 100 \end{equation}
L=LA×LR\begin{equation} L = LA \times LR \end{equation}

The liquidation risk is eliminated if CVCV remains above LL, given the current market price PP.

Code Example:

def liquidation_risk_elimination(loan_amount, collateral_value, liquidation_ratio):
    LTV = (loan_amount / collateral_value) * 100
    liquidation_point = loan_amount * liquidation_ratio
    return LTV, liquidation_point

Mathematical Model for Insurance Pools

Mathematical Model for Insurance Premiums

Inputs:

  • RR: Risk Profile of the Borrower

  • VV: Volatility of the Collateral

  • II: Initial Insurance Premium rate

Outputs:

  • PP: Premium for Insurance

Equation:

P=I+(R×V)P=I+(R×V)

Code Example:

def calculate_premium(initial_rate, risk_profile, volatility):
    return initial_rate + (risk_profile * volatility)

Risk Profiles and Dynamic Adjustments

The level of risk R is continuously modified based on factors, including the behavior of borrowers market conditions and the performance of collateral. This adaptive adjustment enables insurance pricing to be more responsive creating an ecosystem.

General Conditions for Overcollateralized Loans

Loan-to-Value (LTV) Ratio

Mathematical Model

LTVRatio=LoanAmountCollateralAmount×100LTV Ratio=Loan AmountCollateral Amount×100

Inputs

  • Loan Amount: The initial amount borrowed.

  • Collateral Amount: The total amount of collateral deposited.

Output

  • LTV Ratio: The Loan-to-Value ratio.

Code Example

def calculate_LTV(loan_amount, collateral_amount):
    ltv = (loan_amount / collateral_amount) * 100
    return ltv

Interest Rates

While the initial interest rate is set at 4.5%, the formula to calculate the interest after nnnn years is:

Interest=LoanAmount×(0.045+0.01×(n1))Interest=LoanAmount×(0.045+0.01×(n1))Interest=Loan Amount×(0.045+0.01×(n−1))Interest=Loan Amount×(0.045+0.01×(n−1))

Code Example

def calculate_interest(loan_amount, n_years):
    interest = loan_amount * (0.045 + 0.01 * (n_years - 1))
    return interest

Loan Amount Calculation

Mathematical Model

The loan amount is determined by the collateral amount and the asset's volatility.

Loan Amount=Collateral×(1Volatility100)\text{Loan Amount} = \text{Collateral} \times \left(1 - \frac{\text{Volatility}}{100}\right)

Inputs

  • Collateral: The total amount of assets deposited as collateral.

  • Volatility: The expected fluctuation in the asset price.

Output

  • Loan Amount: The maximum amount that can be borrowed.

Code Example

def calculate_loan_amount(collateral, volatility):
    loan_amount = collateral * (1 - (volatility / 100))
    return loan_amount

Interest Rates

Mathematical Model

The interest rate is capped at a maximum of 4.5%, and the loan term is restricted to a maximum of one year.

Interest=LoanAmount×0.045Interest=Loan Amount×0.045

Inputs

  • Loan Amount: The amount borrowed.

Output

  • Interest: The maximum amount of interest accrued, capped at 4.5% for a loan duration of 1 year.

Code Example

def calculate_max_interest(loan_amount):
    return loan_amount * 0.045

Repayment

Mathematical Model

Each repayment xx affects the stop-loss limit.

NewStopLoss=OldStopLossxNew Stop-Loss=Old Stop-Loss−x

Inputs

  • Old Stop-Loss: Previous stop-loss limit.

  • xx: The amount repaid.

Output

  • New Stop-Loss: Updated stop-loss limit.

Code Example

def update_stop_loss(old_stop_loss, repayment):
    new_stop_loss = old_stop_loss - repayment
    return new_stop_loss

Liquidation

Mathematical Model

LiquidationValue=LoanAmount×1.028Liquidation Value=Loan Amount×1.028

Inputs

  • Loan Amount: The amount borrowed.

Output

  • Liquidation Value: The value at which the loan will be liquidated.

Code Example

def calculate_liquidation_value(loan_amount):
    liquidation_value = loan_amount * 1.028
    return liquidation_value

Stop-Loss

Mathematical Model

The stop-loss is set at 2.8% above the loan value to mitigate default risk.

StopLoss=LoanAmount×1.028Stop-Loss=Loan Amount×1.028

Inputs

  • Loan Amount: The amount borrowed.

Output

  • Stop-Loss: The asset value at which automatic liquidation occurs if the collateral falls below this level.

Code Example

def calculate_stop_loss(loan_amount):
    stop_loss = loan_amount * 1.028
    return stop_loss

Dynamic Insurance Pools

Insurance pools that are dynamic play a role in decentralized finance (DeFi) systems by providing loans that are overcollateralized. These pools serve as a safety net protecting against defaults or unexpected events. In this section we will delve into the aspects that make these pools effective tools, for mitigating risks.

Insurance Pool Size and Coverage Ratio

Mathematical Model

The size of the insurance pool (II) is often determined by a Coverage Ratio (CRCR) that specifies what percentage of the total loan value is covered by the pool. The formula to calculate the ideal size of the insurance pool is:

I=CR×TotalLoanValueI=CR×Total Loan Value

Inputs

  • CRCR: Coverage Ratio, a constant usually ranging from 0.1 to 1.

  • Total Loan Value: The sum of all active loans in the system.

Output

  • II: The ideal size of the insurance pool.

Code Example

def calculate_insurance_pool_size(CR, total_loan_value):
    insurance_pool_size = CR * total_loan_value
    return insurance_pool_size

Premium Rate Calculation

Mathematical Model

The insurance premium rate (PRPR) might be calculated as a function of the Coverage Ratio (CRCR) and the overall risk profile (RR) of the loan portfolio:

PR=CR×RPR=CR×R

Inputs

  • CRCR: Coverage Ratio

  • RR: Overall risk profile of the loan portfolio

Output

  • PRPR: Insurance premium rate

Code Example

def calculate_premium_rate(CR, risk_profile):
    premium_rate = CR * risk_profile
    return premium_rate

Dynamic Adjustment of Premiums

Mathematical Model

The insurance premium (PP) is often dynamically adjusted based on both the insurance premium rate (PRPR) and the loan amount (LL):

P=PR×LP=PR×L

Inputs

  • PRPR: Insurance premium rate

  • LL: Loan amount

Output

  • PP: Insurance premium

Code Example

def calculate_dynamic_premium(PR, loan_amount):
    dynamic_premium = PR * loan_amount
    return dynamic_premium

Dynamic Collateral Adjustment

In DeFi systems that offer overcollateralized loans, dynamic collateral adjustment is a fundamental risk-mitigation strategy. It continuously monitors the market value of collateral and prompts borrowers to top up their collateral if the value depreciates below a certain threshold. This section offers a mathematical understanding of this dynamic mechanism.

Basic Collateral Ratio

Mathematical Model

The Collateral Ratio (CRCR) is calculated using the formula:

CR=Collateral ValueLoan Value×100CR = \frac{\text{Collateral Value}}{\text{Loan Value}} \times 100

Inputs

  • Collateral Value: The current market value of the collateral deposited.

  • Loan Value: The amount borrowed.

Output

  • CRCR: Collateral Ratio in percentage

Code Example

def calculate_collateral_ratio(collateral_value, loan_value):
    collateral_ratio = (collateral_value / loan_value) * 100
    return collateral_ratio

Additional Collateral Needed

Mathematical Model

The Additional Collateral Needed (ACAC) can be calculated based on the change in volatility (ΔVΔV) and the loan amount:

AC=Loan Amount×(New Volatility100Old Volatility100)AC = \text{Loan Amount} \times \left( \frac{\text{New Volatility}}{100} - \frac{\text{Old Volatility}}{100} \right)

Inputs

  • New Volatility: The updated measure of asset price fluctuation.

  • Old Volatility: The previous measure of asset price fluctuation.

  • Loan Amount: The original loan value.

Output

  • ACAC: Additional Collateral Needed

Code Example

def additional_collateral_needed(loan_amount, new_volatility, old_volatility):
    AC = loan_amount * ((new_volatility / 100) - (old_volatility / 100))
    return AC

Stop-Loss Trigger

Mathematical Model

The stop-loss trigger is set at 2.8% above the loan value. The Stop-Loss Value (SL) is therefore:

SL=LoanValue×1.028SL=Loan Value×1.028

Inputs

  • Loan Value: The amount borrowed.

Output

  • SLSL: Stop-Loss Value

Code Example

def calculate_stop_loss(loan_value):
    stop_loss = loan_value * 1.028
    return stop_loss

Minting of "test_coins_erc20"

Minting in the context of DeFi usually involves generating new tokens as part of a collateralized loan agreement. When a user over-collateralizes a loan, stablecoins like "test_coins_erc20" can be minted and provided to the borrower. This section breaks down the math and mechanics of this process.

Minting Ratio

Mathematical Model

The Minting Ratio (MRMRMRMR) determines how many test_coins_erc20 are minted per unit of collateral. The formula is:

MR=LoanAmountCollateralValueMR=Loan AmountCollateral Value

Inputs

  • Loan Amount: The total loan value in the native asset.

  • Collateral Value: The total value of the collateral locked.

Outputs

  • MRMR: Minting Ratio

Code Example

def minting_ratio(loan_amount, collateral_value):
    MR = loan_amount / collateral_value
    return MR

Number of test_coins_erc20 Minted

Mathematical Model

The number of test_coins_erc20 (TCTC) minted is calculated as follows:

TC=LoanAmount×MRTC=Loan Amount×MR

Inputs

  • Loan Amount: The total loan value in the native asset.

  • MRMRMRMR: Minting Ratio

Outputs

  • TCTC: Number of test_coins_erc20 minted.

Code Example

def number_of_testcoins_minted(loan_amount, MR):
    TC = loan_amount * MR
    return TC

Gas Fee for Minting

Mathematical Model

The Gas Fee (GFGF) for minting is calculated based on the Ethereum gas price (GG) and the gas needed for the minting transaction (NN):

GF=G×NGF=G×N

Inputs

  • GG: Current Ethereum gas price in Gwei.

  • NN: Gas needed for the minting transaction.

Outputs

  • GFGF: Gas Fee for minting.

Code Example

def gas_fee_for_minting(gas_price, gas_needed):
    GF = gas_price * gas_needed
    return GF

Detailed Mechanism for Minting "test_coins_erc20"

Mathematical Model

Inputs:

  • CC: Collateral deposited

  • LALA: Loan amount

  • MRMR: Minting Rate (fraction of the loan amount that is minted as stablecoins)

Outputs:

  • MM: Number of "test_coins_erc20" minted

Equation:

M=LA×MRM=LA×MR

The minting rate MRMRMRMR can be defined as a constant or be made dynamic based on various economic factors such as supply, demand, and stability fees.

Code Example:

def mint_test_coins_erc20(loan_amount, minting_rate):
    return loan_amount * minting_rate

Pool Management

Mathematical Model for Pool Management

Inputs:

  • TPTP: Total Pool assets

  • LALLAL: Loan amount locked

  • FF: Fees accrued

Outputs:

  • FTAFTA: Free to allocate assets in the pool

Equation:

FTA=TP(LAL+F)FTA=TP−(LAL+F)

This equation gives a snapshot of the pool's status and how much capital is available for new loans or other investments.

Code Example:

def free_to_allocate(total_pool, loan_amount_locked, fees):
    return total_pool - (loan_amount_locked + fees)

Staking Mechanisms for Validators

Mathematical Model

Inputs:

  • VV: Validator's stake

  • TPTP: Total Pool assets

  • SRSR: Staking rate (The rate at which staking rewards accrue)

  • TT: Time (in some consistent unit like days)

Outputs:

  • RR: Rewards

Equation:

R=V×(TPV)×SR×TR = V \times \left( \frac{TP}{V} \right) \times SR \times T

The idea here is that the reward is proportional to the validator's stake, the total pool assets, and the time for which they've staked, adjusted by a staking rate SRSRSRSR.

Code Example:

def calculate_rewards(validator_stake, total_pool, staking_rate, time):
    return validator_stake * (total_pool / validator_stake) * staking_rate * time

Last updated

Logo