# Markets

> Markdown export of the Gearbox Protocol documentation page for agents and retrieval systems.

Canonical page: https://docs.gearbox.finance/developers/gm-concept-markets
Source file: content/developers/gm-concept-markets.mdx
Section router: https://docs.gearbox.finance/developers/llms.txt
Section full export: https://docs.gearbox.finance/developers/llms-full.txt

A Gearbox Market is a pooled lending system: one Pool, multiple Credit Managers, many Credit Accounts. This page explains how these components connect.

## Architecture

```mermaid
flowchart TD
    L1[Lender A] --> Pool
    L2[Lender B] --> Pool
    L3[Lender C] --> Pool

    Pool[Pool - ERC-4626] --> CM1[Credit Manager A]
    Pool --> CM2[Credit Manager B]

    CM1 --> CA1[Credit Account]
    CM1 --> CA2[Credit Account]
    CM1 --> CA3[Credit Account]
    CM2 --> CA4[Credit Account]
```

## Pool

The Pool is a passive ERC-4626 vault holding a single underlying asset (USDC, WETH, DAI). It does not lend directly to borrowers — it allocates capital to Credit Managers.

**Diesel Tokens** — when lenders deposit, they receive dTokens (dUSDC, dWETH). These are yield-bearing receipt tokens:
- Non-rebasing: value accrues through exchange rate increases
- Represent a pro-rata share of all Pool assets
- Yield comes from interest paid by *all* connected Credit Managers

The lender's experience is simple: deposit → hold dToken → withdraw with yield. No need to pick strategies.

## Credit Manager

The Credit Manager is the **policy keeper** of a specific lending strategy. It defines:

| Parameter | What It Controls |
| --- | --- |
| **Collateral tokens** | Which tokens can be held in Credit Accounts |
| **Liquidation Thresholds** | Per-token discount factors for solvency calculation |
| **Adapters** | Which DeFi protocols Credit Accounts can interact with |
| **Debt limits** | Min/max debt per account |
| **Fees** | Liquidation premium, protocol fee |

A single Pool typically has multiple Credit Managers — each representing a different risk profile configured by its Market Curator.

### Debt Ceiling

Each Credit Manager has a **Debt Ceiling** — the maximum amount it can borrow from the Pool. This is how risk isolation works:

- Credit Manager A (blue chips, LT 85-90%) gets \$80M ceiling
- Credit Manager B (emerging tokens, LT 60-75%) gets \$10M ceiling
- If B's strategy causes bad debt, the loss is capped at \$10M

## Credit Account

The Credit Account is where borrowing happens. When a user opens a Credit Account under a specific Credit Manager:

1. User deposits collateral into the account
2. Credit Manager borrows from the Pool on the account's behalf
3. Borrowed funds are sent directly to the Credit Account
4. User deploys capital via [Multicalls](https://docs.gearbox.finance/developers/gm-concept-multicalls) (swap, farm, stake)
5. Credit Manager checks solvency after every operation

The Credit Account is an isolated smart contract — its state (collateral, debt, enabled tokens) is separate from every other account.

## Quotas

Quotas exist only in Gearbox Markets (not in P2P lending). They serve two purposes:

### Concentration Limits

A hard cap on how much total debt across the Pool can be backed by a specific collateral token. Example: even if there's \$100M in the Pool, at most \$20M of debt can be backed by CRV tokens.

This prevents a single volatile asset from dominating pool risk.

### Risk-Priced Interest

Each collateral token carries a **Quota Rate** — an additional interest rate charged to borrowers who use that token. Riskier tokens cost more:

| Collateral | Quota Rate | Meaning |
| --- | --- | --- |
| WETH | +0.5% | Low risk, low extra cost |
| wstETH | +1% | Liquid staking, moderate |
| CRV | +5% | Governance token, volatile |

```
Total Borrow APR = Base Rate + Quota Rate
```

The Base Rate is driven by Pool utilization (supply/demand). The Quota Rate is set by the Curator (or voted via Gauge/Tumbler) based on collateral risk.

## How It All Connects

```mermaid
flowchart LR
    Lender -->|"deposit USDC"| Pool
    Pool -->|"issue dUSDC"| Lender

    Pool -->|"lend to CM"| CM[Credit Manager]
    CM -->|"borrow for account"| CA[Credit Account]

    Borrower -->|"multicall"| Facade[Credit Facade]
    Facade -->|"route"| CM
    CM -->|"check solvency"| Oracle[Price Oracle]

    Curator -->|"set params"| Config[Credit Configurator]
    Config -->|"update"| CM
```

- **Lenders** interact with the Pool only
- **Borrowers** interact with the Credit Facade → Credit Manager → Credit Account
- **Curators** interact with the Credit Configurator → Credit Manager
- **Liquidators** interact with the Credit Facade to liquidate unhealthy accounts

## Learn More

- [**Credit Accounts**](https://docs.gearbox.finance/developers/gm-concept-accounts) — The Credit Suite architecture in detail
- [**Quotas & Interest Rates**](https://docs.gearbox.finance/developers/gm-markets-rates) — Querying rates programmatically
- [**Pool Operations**](https://docs.gearbox.finance/developers/gm-markets-pools) — Deposit/withdraw via SDK
- [**Gearbox Markets Overview**](https://docs.gearbox.finance/developers/gm-overview) — Including comparison with P2P lending
