Skip to main content

Overview

The ITumblerV3 interface provides functionality for managing quota interest rates for multiple tokens. It serves as a rate keeper that can update rates periodically based on epochs and communicates with the pool quota keeper to apply these rates.

View Functions

underlying

function underlying() external view returns (address)
Returns the address of the underlying asset.
address
address
The underlying token address

poolQuotaKeeper

function poolQuotaKeeper() external view returns (address)
Returns the address of the associated pool quota keeper.
address
address
The pool quota keeper contract address

epochLength

function epochLength() external view returns (uint256)
Returns the length of each epoch in seconds.
length
uint256
The epoch length in seconds
Epochs are used to determine when rate updates should occur.

getTokens

function getTokens() external view returns (address[] memory)
Returns an array of all tokens managed by this tumbler.
tokens
address[]
Array of token addresses

getRates

function getRates(address[] calldata tokens) external view returns (uint16[] memory)
Returns the quota interest rates for multiple tokens.
tokens
address[]
required
Array of token addresses to query
rates
uint16[]
Array of quota interest rates in basis points per year, corresponding to the input tokens

State-Changing Functions

setRate

function setRate(address token, uint16 rate) external
Sets a new quota interest rate for a specific token.
token
address
required
The address of the token
rate
uint16
required
The new quota interest rate in basis points per year
This function is typically restricted to authorized administrators.

updateRates

function updateRates() external
Updates quota rates in the pool quota keeper for all managed tokens.
This function is typically called periodically at the end of each epoch to synchronize rates with the pool quota keeper.

Events

AddToken

event AddToken(address indexed token)
Emitted when a new token is added to the tumbler.
token
address
The address of the newly added token

SetRate

event SetRate(address indexed token, uint16 rate)
Emitted when a new quota rate is set for a token.
token
address
The address of the token
rate
uint16
The new quota interest rate in basis points per year

Inherited Interfaces

IRateKeeper

The tumbler implements the IRateKeeper interface, which provides the core rate management functionality.

IACLTrait

The tumbler implements the IACLTrait interface for access control, ensuring only authorized addresses can modify rates and configuration.

Usage Example

The tumbler is typically used in the following workflow:
  1. Administrator sets quota rates for tokens using setRate
  2. At the end of each epoch, updateRates is called to synchronize rates with the pool quota keeper
  3. The pool quota keeper applies these rates when calculating quota interest for credit accounts
Rates are expressed in basis points per year. For example, a rate of 500 represents 5% annual interest.

Build docs developers (and LLMs) love