Market

In Gearbox V3, a "Market" is a cohesive ecosystem centered around a single Lending Pool. Each market is governed by a Market Configurator and includes a suite of risk management, pricing, and credit components.

spinner

How to Retrieve Market State

To get a complete snapshot of a market without making dozens of individual RPC calls, you should use the MarketCompressor. This utility contract aggregates the state of all components into a single structured response.

Calling the Market Compressor

You can query a specific pool or filter through multiple markets using the IMarketCompressor interface.

Methods:

  • getMarketData(address pool): Fetches data for a specific pool.

  • getMarkets(MarketFilter filter): Fetches data for multiple pools based on underlying assets or configurators.

Example (ethers.js/viem):

const marketData = await marketCompressor.getMarketData(POOL_ADDRESS);
console.log(`Market for ${marketData.pool.name} is managed by ${marketData.configurator}`);

Understanding MarketData

The MarketData struct is the comprehensive state object for a Gearbox market. Below is a breakdown of its fields and what they represent:

Field
Description
Deep Dive

acl

The Access Control List contract managing roles for this specific market.

Permissions & ACL Guide

contractsRegister

Registry of all active Pools and Credit Managers within this market instance.

System Registries

treasury

The address (often a TreasurySplitter) where protocol fees are collected and distributed.

Fee & Treasury Model

pool

The core lending contract.

Pool V3 Documentation

quotaKeeper

Manages borrowing limits (quotas) for specific tokens within the pool.

Quota Management

interestRateModel

The mathematical model determining supply/borrow rates.

Interest Rate Models

rateKeeper

Determines the interest rates for individual collaterals.

Gauges & Rate Keeping

priceOracle

The routing hub for asset valuation, managing primary and reserve feeds.

Oracle V3 Architecture

lossPolicy

Safety logic determining how liquidations with bad debt are handled.

Risk & Loss Policies

tokens

A list of TokenData for all collateral tokens supported by this market.

Supported Assets

creditManagers

An array of all CreditSuiteData (Credit Managers + Facades) connected to this pool.

Credit Suite Exploration

configurator

The MarketConfigurator contract that has administrative rights over this market.

Risk Curation

pausableAdmins

List of addresses authorized to pause protocol components in emergencies.

Emergency Procedures

unpausableAdmins

High-level admins authorized to resume operations.

Governance Roles

emergencyLiquidators

Authorized bots or addresses allowed to liquidate during extreme volatility.

Liquidation Bot Guide


Use the links below to explore the technical implementation and configuration parameters of each component found in the MarketData struct.

1. Core Liquidity

2. Risk & Quotas

  • Quota Keeper Logic: How the protocol limits exposure to volatile assets and controls collateral-specific rates.

3. Credit

4. Governance & Security

chevron-rightSourceshashtag

Last updated