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.
function updateQuota( address creditAccount, address token, int96 quotaChange, uint96 minQuota ) external returns (uint256 tokensToEnable, uint256 tokensToDisable);
| Parameter | Type | Description |
|---|---|---|
creditAccount | address | Credit Account to update |
token | address | Token whose quota is being changed |
quotaChange | int96 | Amount to increase (positive) or decrease (negative) |
minQuota | uint96 | Minimum 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.
function setTokenLimit(address token, uint96 limit) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Collateral token |
limit | uint96 | Maximum total quota allowed |
Access: Configurator only. Prevents over-exposure to any single asset.
setTokenQuotaIncreaseFee
Sets the fee charged when a quota is increased.
function setTokenQuotaIncreaseFee(address token, uint16 fee) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Collateral token |
fee | uint16 | Fee in basis points |
Access: Configurator only.
addQuotaToken
Registers a new token for quota tracking.
function addQuotaToken(address token) external;
| Parameter | Type | Description |
|---|---|---|
token | address | Token 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.
function updateRates() external;
Access: Rate keeper (Gauge or Tumbler) only.
View Methods
getTokenQuotaParams
Returns the global quota parameters for a token.
function getTokenQuotaParams(address token) external view returns ( uint16 rate, uint192 cumulativeIndex, uint16 quotaIncreaseFee, uint96 totalQuoted, uint96 limit, bool isActive );
| Return Value | Type | Description |
|---|---|---|
rate | uint16 | Annual interest rate in basis points |
cumulativeIndex | uint192 | Cumulative index for interest calculation |
quotaIncreaseFee | uint16 | Fee charged on quota increases (bps) |
totalQuoted | uint96 | Total quota across all Credit Accounts |
limit | uint96 | Maximum allowed total quota |
isActive | bool | Whether the token is currently active |
getQuotaAndOutstandingInterest
Returns the quota and accrued interest for a specific Credit Account and token.
function getQuotaAndOutstandingInterest( address creditAccount, address token ) external view returns (uint96 quoted, uint128 outstandingInterest);
| Return Value | Type | Description |
|---|---|---|
quoted | uint96 | Amount of quota held by the account |
outstandingInterest | uint128 | Accrued interest not yet added to debt |
quotedTokens
Returns the list of all tokens registered for quota tracking.
function quotedTokens() external view returns (address[] memory);
pool
Returns the associated pool address.
function pool() external view returns (address);
gauge
Returns the rate keeper (Gauge or Tumbler) address.
function gauge() external view returns (address);
Events
UpdateQuota
event UpdateQuota( address indexed creditAccount, address indexed token, int96 quotaChange );
Emitted when a Credit Account's quota is changed.
SetTokenLimit
event SetTokenLimit(address indexed token, uint96 limit);
Emitted when a token's quota limit is updated.
SetTokenQuotaIncreaseFee
event SetTokenQuotaIncreaseFee(address indexed token, uint16 fee);
Emitted when a quota increase fee is set.
AddQuotaToken
event AddQuotaToken(address indexed token);
Emitted when a new token is registered for quota tracking.
UpdateRates
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:
| Model | Description |
|---|---|
| GaugeV3 | Decentralized voting model where GEAR stakers vote to set rates between minRate and maxRate |
| TumblerV3 | Curator-controlled model with direct rate setting via setRate(token, rate) and epoch-based updates |
Related Pages
- Pool (PoolV3) -- The vault that QuotaKeeper is associated with
- Credit Manager -- Calls
updateQuotaduring multicall execution - Credit Configurator -- Manages quota parameters through the configurator role
- Smart Contracts Overview -- Full contract architecture