Loans
Borrowing:
Mechanism: Users can borrow EGGS using NEST as collateral.
Loan Terms:
Collateral Requirement: Users can borrow up to 99% of their NEST's value in EGGS (99% Loan-to-Value Ratio).
Duration: Minimum 1 day, Maximum 365 days.
Interest: Interest rates are calculated on a linear scale with a base rate of 0.05%. Interest is collected up front, or upon initiation of a loan, from the borrowed amount.
Liquidation: If a loan defaults, then the NEST collateral is burned. Since loans are over-collateralized, burning the collateral causes the ratio of EGGS per NEST to increase. NEST collateral from liquidated positions are burned collectively, every day, at 00:00 UTC.
Interest Rate Calculation and Example in Python:
def linear_interest_rate(days, slope, base_rate):
"""
Calculate interest rate based on a linear model.
:param days: Number of days for the loan term
:param slope: Slope of the interest rate increase per day
:param base_rate: Base interest rate (for 1 day or 0 days)
:return: Interest rate in percentage
"""
return slope * (days - 1) + base_rate # Adjusting for 1-day base
# Example usage:
slope = 0.0548 # from our calculation above
base_rate = 0.05 # 0.05% for 1 day as an example
days = 10
interest_rate = linear_interest_rate(days, slope, base_rate)
print(f"The interest rate for a {days}-day loan is approximately {interest_rate:.2f}%")
Burning Example (Liquidation):
Let's say there is 100 NEST tokens in existence, and there is 100 EGGS tokens backing them on the contract. That means the price of 1 NEST is 1 EGGS. A user can take a loan that is 99% of their NEST's value. In this case, they use 100 NEST to borrow 99 EGGS. The user fails to repay their loan on time, leading the position to be liquidated. 99.7% of the collateral, or 99.7 NEST, is burned and the remaining 0.3%, or 0.3 NEST, is distributed to LP incentives, burn wallet and the team. Since the user's collateral was all of the NEST tokens in existence, the only NEST tokens that remain are the 0.3 NEST that were distributed. The user failed to repay the loan of 99 EGGS, so there is now 1 EGGS in the contract's backing. We can calculate the new price of NEST by doing 1 EGGS / 0.3 NEST = 3.333... EGGS. The price of every NEST token has increased!
For simplicity, this example does not account for interest, which further increase EGGS backing per NEST.
Instant Default (Redeem NEST for EGGS):
Similar to how NEST can be minted from the contract by depositing EGGS, NEST can also be burned for the underlying EGGS:
The redemption process involves taking a single day loan against your NEST and purposefully defaulting. This allows you to walk away with the underlying EGGS while your NEST is burned.
Instant defaults are subject to same 1% collateral premium and interest rates as other loans.
Last updated