# Overview

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

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

The Gearbox SDK provides typed access to protocol state and operations. It wraps contract calls, handles encoding, and provides cached market data through a clean TypeScript interface.

## Prerequisites

- Node.js 18+
- Basic familiarity with [viem](https://viem.sh/)
- Understanding of async/await patterns

## What the SDK Provides

| Component | Purpose |
| --- | --- |
| `GearboxSDK` | Main entry point with `attach()` initialization |
| `marketRegister` | Cached market data access |
| `addressProvider` | Contract discovery wrapper |
| Plugins | Extended functionality (AccountsPlugin, AdaptersPlugin) |
| Services | Credit account operations and multicall helpers |

## Guide Structure

1. [**Setup**](https://docs.gearbox.finance/developers/sdk-setup) — Installation, SDK initialization, basic configuration
2. [**Reading Data**](https://docs.gearbox.finance/developers/reading-data) — Market queries, account state, pool data
3. [**Credit Accounts**](https://docs.gearbox.finance/developers/credit-accounts) — Account operations via services
4. [**Multicalls**](https://docs.gearbox.finance/developers/multicalls) — Building and executing multicalls

## When to Use the SDK

| Use Case | Recommended |
| --- | --- |
| Frontend applications | Yes |
| Analytics dashboards | Yes |
| Liquidation bots | Yes (or direct compressor calls) |
| Backend services | Yes |
| On-chain contracts | No (use Solidity Guide) |

The SDK handles ABI management, type conversions, and caching internally. For on-chain integrations or gas-optimized bot implementations, consider the [Solidity Guide](https://docs.gearbox.finance/developers/overview-2).

## Architecture Understanding

For conceptual background on how Gearbox works:

- [Credit Suite Architecture](https://docs.gearbox.finance/developers/credit-suite) — How Credit Managers, Facades, and Configurators work together
- [Pool Architecture](https://docs.gearbox.finance/developers/pools) — Lending pools and ERC-4626 compliance
- [Multicall System](https://docs.gearbox.finance/developers/multicall-system) — How multicalls execute and validate

---

## Detailed Guides

### Multicall Operations

Complete reference for each multicall operation with TypeScript examples:

| Operation | Description |
| --- | --- |
| [Adding Collateral](https://docs.gearbox.finance/developers/adding-collateral) | Transfer tokens to credit account |
| [Debt Management](https://docs.gearbox.finance/developers/debt-management) | Borrow and repay |
| [Updating Quotas](https://docs.gearbox.finance/developers/updating-quotas) | Manage collateral quotas |
| [Withdrawing Collateral](https://docs.gearbox.finance/developers/withdrawing-collateral) | Remove tokens from account |
| [Controlling Slippage](https://docs.gearbox.finance/developers/controlling-slippage) | Protect against price movement |
| [Making External Calls](https://docs.gearbox.finance/developers/making-external-calls) | Interact with DeFi protocols |
| [Enabling/Disabling Tokens](https://docs.gearbox.finance/developers/enabling-disabling-tokens) | Manage active collateral |
| [Updating Price Feeds](https://docs.gearbox.finance/developers/updating-price-feeds) | On-demand oracle updates |
| [Collateral Check Params](https://docs.gearbox.finance/developers/collateral-check-params) | Optimize health checks |
| [Revoke Allowances](https://docs.gearbox.finance/developers/revoke-allowances) | Security cleanup |

See [Multicalls Overview](https://docs.gearbox.finance/developers/multicalls) for building and executing multicalls.

### Use Case Guides

Application-specific guides for common development scenarios:

| Building | Guide | Focus |
| --- | --- | --- |
| Web UI / Dashboard | [Frontend Applications](https://docs.gearbox.finance/developers/frontend-applications) | Data display, real-time updates |
| Analytics / Indexer | [Backend Services](https://docs.gearbox.finance/developers/backend-services) | Historical data, event indexing |
| Liquidation Bot | [Liquidation Bots](https://docs.gearbox.finance/developers/liquidation-bots) | Monitoring, Router execution |
