Skip to main content
Each reserve can configure two independent caps that throttle activity over a sliding interval. Caps are useful for newly-listed assets, regulated tokens, and any reserve where you want to limit how much can flow in or out per day without imposing a hard depositLimit/borrowLimit ceiling.

The two caps

Each reserve has two WithdrawalCaps structs:
Both are denominated in token base units of the reserve’s mint.

Field semantics

When the interval elapses (i.e., now > lastIntervalStartTimestamp + configIntervalLengthSeconds), currentTotal resets to zero on the next operation.

Setting configCapacity to disable

configCapacity = 0 disables the cap (the program treats 0 as no limit). To enable a cap, set a positive value. To temporarily lock down a reserve, set configCapacity to a small positive value during a config update — the next operation that would push net flow above the cap will revert. Avoid 0, which disables the cap entirely.

Worked example

A new reserve for a long-tail asset listed with depositLimit = 10M tokens. The curator wants to limit per-day inflows to 1M tokens during the first month to keep TVL growth proportionate to the asset’s available on-chain liquidity.
Day 1: the reserve fills up to 1M tokens, then further deposits revert until the interval resets. Day 2: the cap resets, another 1M tokens are accepted. After 30 days: increase configCapacity to scale with comfort.

Common configurations

Updating caps

Edit the reserve config, run update-reserve-config:
Updates take effect immediately. The currentTotal and lastIntervalStartTimestamp are not reset by a config update — the interval continues running with the new capacity.

Caps vs. utilization-based blocking

Two related fields throttle different things: Use caps when you want predictable per-day flow limits (e.g., asset-issuer agreements). Use the utilization limit when you care about preventing leverage at high utilization levels. The two work together: caps throttle volume, the utilization limit shapes the curve.

Reading current cap state

download-reserve-config returns currentTotal and lastIntervalStartTimestamp along with the configured fields. Use it to inspect how much of the current interval’s capacity has been consumed.

Reference