DocumentationOpen App

Quota Keeper

The PoolQuotaKeeperV3 regulates how much pool capital can be exposed to specific collateral types and at what cost. It tracks per-token quota limits, interest rates, and cumulative indices. Unlike the base debt which compounds, quota interest is additive (linear).


Write Methods

updateQuota

Updates the quota for a specific token on a Credit Account. Called by the Credit Manager during multicall execution.

Solidity
function updateQuota( address creditAccount, address token, int96 quotaChange, uint96 minQuota ) external returns (uint256 tokensToEnable, uint256 tokensToDisable);
ParameterTypeDescription
creditAccountaddressCredit Account to update
tokenaddressToken whose quota is being changed
quotaChangeint96Amount to increase (positive) or decrease (negative)
minQuotauint96Minimum quota to maintain (reverts if result is below this and non-zero)

Returns: Token masks to enable/disable based on quota state.

Access: Credit Manager only. Reverts with QuotaIsOutOfBoundsException if totalQuoted would exceed the token's limit.


setTokenLimit

Sets the maximum aggregate quota for a specific token across all Credit Accounts.

Solidity
function setTokenLimit(address token, uint96 limit) external;
ParameterTypeDescription
tokenaddressCollateral token
limituint96Maximum total quota allowed

Access: Configurator only. Prevents over-exposure to any single asset.


setTokenQuotaIncreaseFee

Sets the fee charged when a quota is increased.

Solidity
function setTokenQuotaIncreaseFee(address token, uint16 fee) external;
ParameterTypeDescription
tokenaddressCollateral token
feeuint16Fee in basis points

Access: Configurator only.


addQuotaToken

Registers a new token for quota tracking.

Solidity
function addQuotaToken(address token) external;
ParameterTypeDescription
tokenaddressToken to register

Access: Configurator only.


updateRates

Syncs quota interest rates from the Gauge/Tumbler (rate keeper). Must be called for rate changes to take effect.

Solidity
function updateRates() external;

Access: Rate keeper (Gauge or Tumbler) only.


View Methods

getTokenQuotaParams

Returns the global quota parameters for a token.

Solidity
function getTokenQuotaParams(address token) external view returns ( uint16 rate, uint192 cumulativeIndex, uint16 quotaIncreaseFee, uint96 totalQuoted, uint96 limit, bool isActive );
Return ValueTypeDescription
rateuint16Annual interest rate in basis points
cumulativeIndexuint192Cumulative index for interest calculation
quotaIncreaseFeeuint16Fee charged on quota increases (bps)
totalQuoteduint96Total quota across all Credit Accounts
limituint96Maximum allowed total quota
isActiveboolWhether the token is currently active

getQuotaAndOutstandingInterest

Returns the quota and accrued interest for a specific Credit Account and token.

Solidity
function getQuotaAndOutstandingInterest( address creditAccount, address token ) external view returns (uint96 quoted, uint128 outstandingInterest);
Return ValueTypeDescription
quoteduint96Amount of quota held by the account
outstandingInterestuint128Accrued interest not yet added to debt

quotedTokens

Returns the list of all tokens registered for quota tracking.

Solidity
function quotedTokens() external view returns (address[] memory);

pool

Returns the associated pool address.

Solidity
function pool() external view returns (address);

gauge

Returns the rate keeper (Gauge or Tumbler) address.

Solidity
function gauge() external view returns (address);

Events

UpdateQuota

Solidity
event UpdateQuota( address indexed creditAccount, address indexed token, int96 quotaChange );

Emitted when a Credit Account's quota is changed.

SetTokenLimit

Solidity
event SetTokenLimit(address indexed token, uint96 limit);

Emitted when a token's quota limit is updated.

SetTokenQuotaIncreaseFee

Solidity
event SetTokenQuotaIncreaseFee(address indexed token, uint16 fee);

Emitted when a quota increase fee is set.

AddQuotaToken

Solidity
event AddQuotaToken(address indexed token);

Emitted when a new token is registered for quota tracking.

UpdateRates

Solidity
event UpdateRates();

Emitted when quota rates are synced from the rate keeper.


Rate Keeper Models

The QuotaKeeper relies on an external rate keeper to provide interest rates:

ModelDescription
GaugeV3Decentralized voting model where GEAR stakers vote to set rates between minRate and maxRate
TumblerV3Curator-controlled model with direct rate setting via setRate(token, rate) and epoch-based updates