# Lending Risks

Despite Granite’s robust security measures and software development practices, there are still risks associated with lending that could result in funds being temporarily or permanently inaccessible.

### Market Utilization and Liquidity Constraints

As discussed in the [Interest Rates](about:blank#interest-rates) section, interest rates for borrowers are determined by the utilization rate of the market. When the utilization rate passes the kink, it increases quickly in order to incentive liquidity in the market - this liquidity comes from borrowers repaying loans or LPs depositing additional funds to lend. The kink is the optimal utilization rate for the market, the ideal ratio of borrowed assets to total supply to optimize for withdrawal liquidity and minimize interest rates.

Even with this mechanism, it’s possible that utilization rates may spike, causing a liquidity shortage where funds are not available in the protocol to process withdrawals. If this occurs, LPs may experience withdrawal constraints and would need to wait until more liquidity becomes available before being able to withdraw.

If this conditions persists, interest will accrue rapidly enough on borrower positions that they will be pushed into liquidation, freeing up funds for LP withdrawals.

### Bad Debt Exposure

Bad debt occurs when the collateral value of a position is insufficient to cover the borrower’s debt, resulting in a loss for the protocol.

Bad debt can be incurred in two ways:

* **Liquidation failure:** This can occur when an asset used as collateral lacks liquidity or when there are inefficiencies in the liquidation process.

  > To protect the protocol from this threat, Granite employs batch liquidations (allowing for the liquidation of multiple positions at once), a robust off-chain network of liquidators, and caps that limit borrowing based on the depth of liquidation DEX/CEX pools.
* **Oracle failure:** This occurs when the oracle network fails to update prices accurately during extreme market conditions or network congestion, resulting in improper liquidations based on inaccurate price data.

  > To protect the protocol from this threat, Granite employs Pyth price oracles. These oracles are highly regarded in the blockchain industry for their resilience and security.

In the unlikely occurrence of a bad debt event, losses from the bad debt will be socialized based on the [Loss Socialization Process](about:blank#loss-socialization-process).

### Loss Socialization Process

If a bad debt event occurs, the protocol will automatically socialize the losses in the following order:

1. Safety Module stakers
2. Protocol Reserve
3. Unstaked LPs

> **Example 1:**

* Safety Module stakers: $20,000
* Protocol Reserve: $50,000
* Unstaked LPs: $300,000

> If a bad debt event of $15,000 occurs, the Safety Module stakers will be slashed by $15,000, leaving $5,000 remaining. The Protocol Reserve and Unstaked LPs will not be slashed at all since the losses were covered by the Safety Module stakers.

> **Example 2:**

* Safety Module stakers: $20,000
* Protocol Reserve: $50,000
* Unstaked LPs: $300,000

> If a bad debt event of $75,000 occurs, the Safety Module stakers will be slashed by $20,000 (fully), the Protocol Reserve will be slashed by $50,000 (fully), and the Unstaked LPs will be slashed by $5,000.

Note that staked LPs (in the Safety Module) who are in cooldown but have not yet withdrawn will still have their position slashed immediately upon a bad debt event.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.granite.world/core-protocol-features/liquidity-provisioning/lending-risks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
