DocumentationOpen App

Use Cases

The SDK guide shows you how to use individual methods. This section shows you how to combine them to build real applications.

Choose Your Path

If you're building...Start hereYou'll learn
Web dashboard, portfolio UIFrontend ApplicationsData fetching patterns, display mapping, real-time updates
Indexer, analytics, data pipelineBackend ServicesHistorical snapshots, event indexing, state tracking
Liquidation botLiquidation BotsAccount monitoring, health factor filtering, execution patterns
Health monitoringHealth Factor MonitoringTrack HF over time, alerts, risk analysis

Quick Decision Guide

Need to display data to users in real-time? Start with Frontend Applications. You'll use marketRegister for cached data and compressors for fresh queries.

Need to collect and analyze historical data? Start with Backend Services. You'll index events and snapshot state at specific blocks.

Need to monitor accounts and execute on-chain actions? Start with Liquidation Bots. You'll filter accounts by health factor and use the Router for execution.

Need to track account health and alert on risk? Start with Health Factor Monitoring. You'll poll compressors, classify risk levels, and build alerting.

Prerequisites

Before diving into use-case guides, complete:

  1. Setup - Install the SDK and initialize GearboxSDK
  2. Reading Data - Understand marketRegister and basic queries

Common Foundation: Compressors

All use cases rely on compressors for efficient data fetching. Compressors aggregate on-chain data into single calls, reducing RPC overhead.

CompressorUse Case
MarketCompressorPool state, credit manager config, token data
CreditAccountCompressorAccount queries with filtering and pagination
PriceFeedCompressorOracle status and update requirements

See Compressors Reference for the complete API.

SDK Guide
├── setup.md              # Installation and initialization
├── reading-data.md       # Basic queries
├── credit-accounts.md    # Account operations
├── multicalls.md         # Operation overview
├── multicalls/           # Individual operation docs
│   └── [10 operation pages]
└── use-cases/            # <-- You are here
    ├── frontend-applications.md
    ├── backend-services.md
    ├── liquidation-bots.md
    └── health-factor-monitoring.md

The multicalls/ directory documents individual operations (add collateral, manage debt, etc.). The use-cases/ directory shows how to combine those operations with data fetching to build complete applications.