# Mechanisms

<details>

<summary>Interest Rate Calculation</summary>

### Interest Model

The protocol applies an upfront interest payment at loan origination, rather than accruing over time. Borrowers receive the borrow amount minus interest and must only repay the principal.<br>

<h4 align="center"><span class="math">A_{net} = B - I</span></h4>

<p align="center">Borrow Amount = total borrow amount - Interest</p>

### Interest Rate Formula:

The protocol uses a utilization-based variable rate model that adjusts based on pool usage:

#### Calculate duration as fraction of year

<h4 align="center"><span class="math">\phi = \frac{t}{T}</span></h4>

<p align="center">durationPortion = duration / 365 days</p>

#### Calculate utilization ratio with base offset

<h4 align="center"><span class="math">\rho = \frac{D + B}{2\cdot S} + c</span></h4>

<p align="center">ratio = (outstandingDebt + borrowAmount) / (2*totalSupply) + 0.75</p>

#### Calculate effective interest rate

<h4 align="center"><span class="math">r_{eff} = \rho \cdot (r_b + (m \cdot r_b \cdot \phi))</span></h4>

<p align="center">effectiveRate = ratio x (baseRate + (slope × baseRate × durationPortion))</p>

#### Calculate total interest due

<h4 align="center"><span class="math">I = r_{eff} \cdot B \cdot \phi</span></h4>

<p align="center">totalInterest = effectiveRate × borrowAmount × durationPortion<br></p>

#### Variables:

*B* **=** Amount of HONEY being borrowed\
\&#xNAN;*t* = Loan Duration \
\&#xNAN;*D* = outstandingDebt: Total HONEY currently borrowed across all loans\
\&#xNAN;*S* = totalSupply: Total gHONEY supply (represents available liquidity)\
\&#xNAN;*rb =* ​baseRate: Protocol base interest rate (set by governance)\
\&#xNAN;*m* = slope: Utilization sensitivity multiplier (set by governance)\
\&#xNAN;*c* = Interest rate constant 0.75 (75%) added to utilization ratio\
\&#xNAN;*T* = Seconds per year (31,536,000)

</details>

<details>

<summary>Risk Parameters</summary>

### Collateral Parameters

#### NFT Fair Value System

The protocol uses an admin-set fair value system for NFT collections:

Each whitelisted NFT collection has a nftFairValue (set in HONEY terms).\
Only NFTs with nftFairValue > 0 can be used as collateral.\
Fair values are set and updated by the multisig.\
\
Maximum Loan = nftFairValue - interest

#### Loan-to-Value (LTV) Calculation

Effective LTV Ratio:

The maximum amount that a borrower can borrow is set by:\
\
(i) the maximum utilization rate (90%) and; \
(ii) a fixed proportion of the $HONEY value of the collateral's unvested BERA (Fair Value) at time of origination

Borrowing Limits:

* Per-Loan Maximum: totalSupply / 10 (10% of total pool)
* Minimum Borrow: No explicit minimum (subject to gas costs)

**Bit Bears = 30%**\
**All other Bong Bear collections = 20%**

### Loan Term Parameters

Initial Loan Terms:

* minDuration: Minimum loan duration (seconds)
* maxDuration: Maximum loan duration (seconds)

Renewal Terms:

* renewMinDuration: Minimum duration for loan renewal
* renewMaxDuration: Maximum duration for loan renewal

*Renewals only allowed when timeRemaining < renewMinDuration*\
*Renewals only allowed before grace period expiry*

### Pool Parameters

#### Adjustable Parameters managed by governance

* Utilization Rate: Maximum Utilization set by governance (90%)
* Reserve Factor: 100% of the interest is sent to the multisig (Bribes/Insurance Fund)
* Interest Rate Slope: Can be changed via changeLendingParams()&#x20;

</details>

<details>

<summary>Liquidations</summary>

Loan Default and Liquidation

1. Loan duration expires without full repayment
2. Loan enters liquidation state
3. 48 hour auction ensues, during which third parties can bid for the liquidated collateral, with bids beginning at value of outstanding debt. Highest bidder at end of 48 hour period is able to claim the collateral.&#x20;
4. Winner of auction can claim collateral.&#x20;
5. Funds raised from auction sent back to lending pool, with excess value above outstanding debt sent to Goldilocks DAO multisig as revenue.&#x20;
6. In the event of an unsuccessful auction, the NFT is sent to Goldilocks DAO multisig. An insurance fund is used to ensure minimum bid is made or to repay value of outstanding loan in event of unsuccessful auction, where possible.&#x20;

</details>
