> For the complete documentation index, see [llms.txt](https://docs.bsc.lista.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bsc.lista.org/for-developer/lista-lending/protocol-extensions.md).

# Protocol Extensions

Moolah extends Morpho Blue with protocol-level controls designed for production risk management and product flexibility.

## Minimum Loan Restriction (`minLoan`)

Each market can enforce a minimum borrow amount.

* Borrow transactions that result in debt below `minLoan` revert.
* Partial repay transactions that leave remaining debt below `minLoan` also revert.

This avoids dust positions that are expensive to liquidate and can increase bad-debt risk.

## Reentrancy Protection

State-changing paths apply `nonReentrant` guards, including:

* `supply()`
* `borrow()`
* `repay()`
* `withdrawCollateral()`
* `liquidate()`

## Upgradeability

Moolah is deployed as an upgradeable system.

* Upgrade authority is controlled by `DEFAULT_ADMIN_ROLE`.
* Execution is delayed by TimeLock.
* TimeLock provides a 1-day review window before upgrade takes effect.

## Oracle Architecture

Moolah oracles expose a `peek()` interface with 8-decimal price scale (`1e8`).

### Resilient Oracle

For resilient/multi-source oracle design, see:

* [Multi-Oracle](/for-developer/multi-oracle.md)

### PT Linear Discount Oracle

PT tokens use a linear discount model against underlying asset price before maturity.

* Typical use case: PT-based collateral markets such as `PT-USDe / USD1`
* Discount formula:

```
discount = baseDiscount x (timeToMaturity / totalDuration)
```

At maturity, discount goes to zero and oracle returns full underlying price.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.bsc.lista.org/for-developer/lista-lending/protocol-extensions.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.
