DocumentationOpen App

SDK Namespaces

The SDK vNext organizes its API into purpose-built namespaces. Each namespace groups related methods so you can discover, analyze, and execute without navigating raw contract state.

Namespace Reference

NamespacePurpose
sdk.chainsMulti-chain configuration — list supported chains, resolve RPC endpoints, check chain health
sdk.opportunitiesUnified discovery surface — search across all opportunity types (pools, strategies, markets) in one call
sdk.poolsPool-specific queries — list pools, get detail, check utilization, interest rates, and available liquidity
sdk.strategiesStrategy-specific queries — list strategies, get detail, inspect adapters and leverage ranges
sdk.marketsX-interface style markets — unified market view combining supply and borrow sides, useful for P2P and intent flows
sdk.tokensToken profiles and market data — prices, metadata, risk parameters, and enrichment info
sdk.curatorsCurator profiles and reputation — who manages which Credit Managers, track record, parameters
sdk.historyMetric history time series — APY over time, utilization, TVL, and other historical data points
sdk.eventsParameter changes and governance — feed of configuration updates, rate changes, and governance actions
sdk.positionsPosition lifecycle — deposit, open, adjust, close, and monitor Credit Account positions
sdk.tradesQuote and routing — get swap quotes, compare routes, preview trade outcomes
sdk.transactionsFinal execution — submit prepared transactions, track confirmation, handle MEV protection

Runtime Modes

The SDK operates in one of two runtime modes depending on backend availability:

Core-Only — works without a backend connection. Supports chain reads, transaction building, simulation, execution, and current position status. Limited for history, profiles, APY enrichment, and snapshots.

Enriched — available when the Gearbox backend is configured and healthy. Adds opportunity surfaces, historical data, curator/token profiles, points and APY enrichment, and fast bootstrap via startFromCache.

TypeScript
import { GearboxSDK } from "@gearbox-protocol/sdk/official"; // Enriched mode (default) — uses backend at api.gearbox.fi const sdk = new GearboxSDK(); // Core-only mode — no backend dependency const sdk = new GearboxSDK({ backend: false });

Loading Modes

Two loading strategies control how aggressively the SDK fetches state:

Lazy (default) — no heavy state load on startup. Each query fetches only what it needs. Best for frontend screens, agent queries, and partial usage.

Full-State — loads broad chain state upfront. Best for dense workflows, advanced analysis, and fast repeated navigation after the initial bootstrap.

TypeScript
// Lazy loading (default) await sdk.loadState({ mode: "lazy" }); // Full-state loading await sdk.loadState({ mode: "full-state" });

Both modes coexist — you can start lazy and switch to full-state later if your workflow demands it.

Learn More