# Markets

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

Canonical page: https://docs.gearbox.finance/developers/gm-markets
Source file: content/developers/gm-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 the fundamental unit of the protocol: a lending pool paired with one or more credit managers, a quota system, and an insurance buffer. This section covers how to query and interact with markets using the TypeScript SDK.

## What is a Market?

Each market revolves around a single underlying asset (e.g. USDC, WETH). It contains:

| Component | Purpose |
|---|---|
| **Pool** | ERC-4626 vault that holds liquidity and issues diesel (share) tokens |
| **Credit Managers** | Define borrowing parameters, allowed collateral, and adapters |
| **Quota Keeper** | Tracks per-token borrowing limits and quota interest rates |
| **Interest Rate Model** | Computes base borrow rates from pool utilization |
| **Treasury Splitter** | Retains fee revenue as an insurance buffer before distributing surplus |

## Accessing Markets

```typescript
import { GearboxSDK } from "@gearbox-protocol/sdk";

const sdk = await GearboxSDK.attach({ client, marketConfigurators: [] });

// Iterate all markets
for (const market of sdk.marketRegister.markets) {
  console.log(`${market.pool.underlying.symbol} — ${market.creditManagers.length} CM(s)`);
}
```

## Section Overview

| Page | Description |
|---|---|
| [Markets Data](https://docs.gearbox.finance/developers/gm-markets-data) | Query pools, credit managers, collateral tokens, and rates |
| [Pool Operations](https://docs.gearbox.finance/developers/gm-markets-pools) | Deposit, withdraw, and manage LP positions via ERC-4626 |
| [Interest Rates & Quotas](https://docs.gearbox.finance/developers/gm-markets-rates) | Interest rate model parameters, quota rates, and quota limits |
| [Insurance Mechanism](https://docs.gearbox.finance/developers/gm-markets-insurance) | TreasurySplitter, revenue retention, and bad debt coverage |

## Next Steps

Start with [Markets Data](https://docs.gearbox.finance/developers/gm-markets-data) to learn how to read pool state and credit manager configuration, or jump to [Pool Operations](https://docs.gearbox.finance/developers/gm-markets-pools) if you want to deposit liquidity right away.
