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.
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
MarketDataThe MarketData struct is the comprehensive state object for a Gearbox market. Below is a breakdown of its fields and what they represent:
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
Navigation Directory
Use the links below to explore the technical implementation and configuration parameters of each component found in the MarketData struct.
1. Core Liquidity
Pool V3 Deep Dive: Liquidity tracking,
dieselRate(RAY) calculations, and theunderlyingasset logic.Interest Rate Mechanics: Understanding slope parameters and utilization curves.
2. Risk & Quotas
Quota Keeper Logic: How the protocol limits exposure to volatile assets and controls collateral-specific rates.
3. Credit
Credit Suite: Understanding the relationship between Managers, Facades, Configurators.
Asset Valuation (Oracles): Recursive price feed trees and staleness checks.
4. Governance & Security
The Permissionless Framework: How Risk Curators deploy and upgrade market components.
ACL & Roles: Detailed mapping of administrative permissions.
Last updated
