# Lending Terms

Borrowers on Credit v1 can pick among a set of **lending terms**. This is a data structure with all the parameters for a loan, including:

```
address collateralToken
uint256 maxDebtPerCollateralToken
uint256 interestRate
uint256 maxDelayBetweenPartialRepay
uint256 minPartialRepayPercent
uint256 openingFee
uint256 hardCap
```

Some of these are self explanatory. Note that the max debt per collateral token, or collateral ratio, is in unit terms and does not reference any external price feed. The opening fee is added to the user's debt balance. The hard cap is a maximum debt ceiling regardless of how much capital is voting for that term in a gauge.

The `interestRate` and `hardCap` can be adjusted through optimistic governance, the other parameters are fixed upon lending term creation. The team is in the process of developing a dedicated governance flow for interest rate adjustment so that it can proceed faster than the 1-week timeline for "full" governance proposals. This mechanism will have two days for voting and a one day timelock, similar to onboarding.

The `maxDelayBetweenPartialRepay` and the `minPartialRepayPercent` are not relevant for most loans are useful for certain special loans, consider the following example of a lending term that has a plugin with the DAI Savings Rate so the collateral earns yield via rebasing:

```
collateralToken: DAI
maxDebtPerCollateralToken: 0.99e18
interestRate: 0.05e18 (5%)
maxDelayBetweenPartialRepay: 7.884e+6 (seconds, equals three months)
minPartialRepayPercent: 0.02e18 (2%)
openingFee: 0.0005e18 (5 bips)
hardCap: 1e26 ($100m)
```

This setup allows 1:1 minting with a small opening fee. In the event that the DAI Savings Rate is lower than the interest rate on the loan, the periodic repayment forces borrowers to realize their losses before the loan's 1% collateralization is worn through, without requiring any intervention on the part of GUILD holders to call the loan, or an offboard-onboard cycle to reactivate the lending term the next time rates flip. In general, this functionality is useful for like-kind rebasing assets.

When a borrower opens a loan, their collateral asset is transfered to the lending term they are using. Upon repayment or when the loan is called, the interest due is calculated and added to the debt amount.

If governance [offboards a lending term](https://credit-guild.gitbook.io/introduction/governance), outstanding loans under that term may be called. Once called, the collateral for the loan is sent to the auction house. There is no liquidation penalty. The standard auction house uses a Dutch auction model where the amount of collateral offered to repay a borrower's full debt increases over time. If this fails, a gradually increasing discount is applied to the debt to attempt a partial recovery.

There is a tradeoff where a longer auction means less value leaked to bidders, but more risk of bad debt in the case of a volatile asset. At launch the protocol will have only a single auction house. Either multiple auction houses, or integrating auction duration into lending terms, is one of the upgrades the DAO can consider in the period following launch. In the meantime, the value leaked will still be substantially less than flat-penalty liquidation models as are common today.

<figure><img src="https://338959884-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfzMdp0yM8XIbpZXK4aNC%2Fuploads%2F8rJdJYzog9cP5Z0syA7O%2Fecg_loanevents.drawio%20(1).png?alt=media&#x26;token=018053cc-1814-4858-8fab-e5851df9f0f1" alt=""><figcaption><p>Lifecycle of a loan</p></figcaption></figure>
