DocumentationOpen App

Compressors

Compressor contracts are read-only data aggregation contracts. Instead of dozens of individual calls, a single compressor call returns complete protocol state. The SDK uses compressors internally.

Discovering Compressor Addresses

Use AddressProvider to find compressor addresses:

Solidity
address compressor = addressProvider.getLatestAddressByContractType( AP_MARKET_COMPRESSOR, VERSION_RANGE_310 );
TypeScript
const [compressor] = sdk.addressProvider.mustGetLatest( AP_MARKET_COMPRESSOR, VERSION_RANGE_310 );

MarketCompressor

Aggregates complete market state including pools, credit managers, and price oracles.

View Methods

getMarkets

Returns market data for all markets matching the filter.

Solidity
function getMarkets(MarketFilter memory filter) external view returns (MarketData[] memory);
ParameterTypeDescription
filterMarketFilterFilter criteria (see below)

Returns: Array of MarketData structs.


getMarketData

Returns complete data for a single market identified by its pool address.

Solidity
function getMarketData(address pool) external view returns (MarketData memory);
ParameterTypeDescription
pooladdressPool address identifying the market

getPoolState

Returns the pool state for a given pool.

Solidity
function getPoolState(address pool) external view returns (PoolState memory);
ParameterTypeDescription
pooladdressPool address

Data Structures

MarketFilter

Solidity
struct MarketFilter { address[] configurators; // Filter by Risk Curator addresses address[] pools; // Filter by specific pool addresses address underlying; // Filter by underlying token (e.g., USDC) }

Pass empty arrays and address(0) for no filtering.

MarketData

Solidity
struct MarketData { PoolState pool; QuotaKeeperState quotaKeeper; CreditSuiteData[] creditManagers; PriceOracleState priceOracle; TokenData[] tokens; }

PoolState (key fields)

FieldTypeDescription
baseParams.addraddressPool contract address
availableLiquidityuint256Borrowable liquidity
dieselRateuint256Share price (RAY)
supplyRateuint256Lender APY (RAY)
baseInterestRateuint256Borrower APR (RAY)
totalAssetsuint256Total pool value

CreditSuiteData (key fields)

FieldTypeDescription
creditManageraddressCredit Manager address
creditFacadeaddressCredit Facade address
creditConfiguratoraddressConfigurator address
debtLimitsDebtLimitsMin/max debt per account
collateralTokensCollateralToken[]Allowed tokens + LTs

CreditAccountCompressor

Fetches credit account data with filtering and pagination.

View Methods

getCreditAccounts

Returns credit accounts matching the filter with pagination support.

Solidity
function getCreditAccounts( address creditManager, CreditAccountFilter memory filter, uint256 offset ) external view returns (CreditAccountData[] memory accounts, uint256 total);
ParameterTypeDescription
creditManageraddressCredit Manager to query
filterCreditAccountFilterFilter criteria (see below)
offsetuint256Pagination offset

Returns: Matching accounts and total count.


countCreditAccounts

Returns the count of credit accounts matching the filter.

Solidity
function countCreditAccounts( address creditManager, CreditAccountFilter memory filter ) external view returns (uint256);

getCreditAccountData

Returns complete data for a single credit account.

Solidity
function getCreditAccountData( address creditManager, address creditAccount ) external view returns (CreditAccountData memory);
ParameterTypeDescription
creditManageraddressParent Credit Manager
creditAccountaddressAccount to query

Data Structures

CreditAccountFilter

Solidity
struct CreditAccountFilter { address owner; // Filter by owner (address(0) = any) uint256 minHealthFactor; // Minimum HF (0 = no min) uint256 maxHealthFactor; // Maximum HF (type(uint256).max = no max) bool includeZeroDebt; // Include accounts with no debt bool reverting; // Include reverting accounts }

CreditAccountData (key fields)

FieldTypeDescription
addraddressCredit Account address
owneraddressAccount owner
creditManageraddressParent Credit Manager
debtuint256Total debt (principal + interest)
enabledTokensMaskuint256Bitmask of enabled tokens
healthFactoruint256Current HF (10000 = 1.0)
tokensTokenInfo[]Token balances and values
isLiquidatableboolWhether account can be liquidated

PriceFeedCompressor

Aggregates price feed state for oracle monitoring and updates.

View Methods

getUpdatablePriceFeeds

Returns all price feeds that may need updating for a given price oracle.

Solidity
function getUpdatablePriceFeeds(address priceOracle) external view returns (PriceFeedData[] memory);
ParameterTypeDescription
priceOracleaddressPriceOracle contract to query

Returns: Array of price feed data including staleness information.


loadPriceFeedTree

Returns the full price feed dependency tree for a specific token.

Solidity
function loadPriceFeedTree(address priceOracle, address token) external view returns (PriceFeedTreeNode memory);
ParameterTypeDescription
priceOracleaddressPriceOracle contract
tokenaddressToken to query

When to Use Compressors vs SDK

ScenarioApproach
General market dataSDK marketRegister
Credit account queriesSDK services
Custom filtering logicDirect compressor calls
Liquidation botsDirect compressor (gas-optimized)
On-chain integrationDirect compressor (no SDK in contracts)
Real-time monitoringDirect compressor with specific filters