> 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/integration-patterns.md).

# Integration Patterns

Moolah supports two external integration patterns. They operate at different layers of the lending stack.

## Which surface do I call?

A market can be gated on either side. Probe both before building against it — a gated market rejects a direct call:

```solidity
MOOLAH.providers(id, marketParams.collateralToken);  // non-zero -> collateral must route through it
MOOLAH.brokers(id);                                  // non-zero -> borrow/repay must route through it
```

| Your case                                  | Call                         | Reference                                                                            |
| ------------------------------------------ | ---------------------------- | ------------------------------------------------------------------------------------ |
| Plain ERC-20 collateral, variable rate     | Moolah directly              | [Contract & Interface Reference](/for-developer/lista-lending/contract-reference.md) |
| `slisBNB` collateral                       | `SlisBNBProvider`            | [Providers](/for-developer/lista-lending/providers.md)                               |
| Native BNB into a WBNB vault               | `BNBProvider`                | [Providers](/for-developer/lista-lending/providers.md)                               |
| StableSwap LP collateral                   | `SmartProvider`              | [Smart Lending & StableSwap](/for-developer/lista-lending/stableswap-integration.md) |
| Fixed-term borrowing                       | the market's `LendingBroker` | [Broker Reference](/for-developer/lista-lending/broker-reference.md)                 |
| Undercollateralized credit                 | `CreditBroker`               | [Loan Lifecycle](/for-developer/credit-loans/loan-lifecycle.md)                      |
| Depositing to earn, not borrowing          | the ERC-4626 vault           | [Vault Reference](/for-developer/lista-lending/vault-reference.md)                   |
| Moving a variable position to a fixed term | `PositionManager`            | [Position Conversion](/for-developer/lista-lending/position-conversion.md)           |
| Liquidating someone else's position        | `PublicLiquidator`           | [Liquidator Integration](/for-developer/lista-lending/liquidator-integration.md)     |

| Pattern  | Purpose                                                                                                  | Typical Usage                                                                                        |
| -------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| Provider | Handles collateral deposit/withdraw flow, asset conversion, and optional `slisBNBx` mint/burn callbacks. | `slisBNB` collateral, Lista StableSwap LP collateral, WBNB vault integrations, parts of credit flows |
| Broker   | Curates access to one or more markets and handles loan-origination logic.                                | Fixed term/rate lending products, credit loans                                                       |

## Provider Integration

A provider sits between user and Moolah core for specific collateral types. Instead of calling Moolah directly, users call provider contracts that normalize assets and route collateral into target markets.

| Provider          | Collateral Type                | `slisBNBx` Minting            |
| ----------------- | ------------------------------ | ----------------------------- |
| `SlisBNBProvider` | `slisBNB` liquid staking token | Yes                           |
| `SmartProvider`   | Lista StableSwap LP tokens     | Only the slisBNB/BNB instance |
| `BNBProvider`     | Native BNB wrapped to WBNB     | No                            |
| `CreditBroker`    | Lista Credit Token             | No                            |

> `CreditBroker` appears in **both** tables on purpose: on the Credit market it is registered as the collateral provider *and* as the broker. Both `Moolah.providers(id, creditToken)` and `Moolah.brokers(id)` return the same address, so it gates collateral movement and borrow/repay origination at once. It is the only contract registered in both roles.

## Broker Integration

A broker is a loan-origination layer for curated products. Unlike providers, brokers focus on terms, rates, and borrower eligibility before routing calls into Moolah.

Broker markets are created against `FixedRateIrm` rather than the adaptive curve, and the Moolah-level rate is left at zero — the broker's own term rate is what the borrower pays. `borrowRateView` on such a market returns `0` (subject to any configured floor), so read the rate from the broker's `getFixedTerms()` instead — see [IRM](/for-developer/lista-lending/irm.md) for when a `FixedRateIrm` market does carry a Moolah-level rate.

| Broker Type    | Product                               | Key Differentiator                                              |
| -------------- | ------------------------------------- | --------------------------------------------------------------- |
| Lending Broker | Lista fixed term & fixed rate markets | Uses `FixedRateIrm` instead of utilization-based adaptive curve |
| Credit Broker  | Lista Credit Loans                    | Supports undercollateralized borrowing with credit-limit gating |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bsc.lista.org/for-developer/lista-lending/integration-patterns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
