Circuit Breaker
Circuit Breaker
Section titled “Circuit Breaker”Purpose
Section titled “Purpose”The circuit breaker is a velocity control on outflows. It limits how fast capital can leave through wrapper withdraw paths, protecting against flash-driven extraction.
The circuit breaker does not permanently lock user exits. Once capacity replenishes, withdrawals resume at normal pace.
Dual-Buffer Model
Section titled “Dual-Buffer Model”The CircuitBreaker.sol contract uses a dual-buffer rate limiter:
Caps total outflow within a configurable time window.
Tracks recent inflows and allows proportional additional outflow capacity.
Both buffers are checked via checkAndRecordOutflow on wrapper withdraw calls. If limits are exceeded, the withdrawal reverts.
Replenishes over time at a fixed rate
Proportional to recent deposit volume
Within limits, withdrawal succeeds
Exceeds capacity, transaction reverts
Configuration
Section titled “Configuration”- Protected-contract registry controls which contracts are subject to rate limits
- Owner-configurable time windows and maximum draw rates
- Parameters are set per circuit breaker instance
Interaction with exits
Section titled “Interaction with exits”Exits via redeem (divest) and via withdraw (withdrawFT) both flow through the wrapper and are subject to circuit breaker checks. If limits are exceeded, the call reverts; retry as capacity replenishes.
Pausing
Section titled “Pausing”Admin can pause deposits. Exits remain available even when paused, see Roles and Permissions for details.
Pausing is a defensive measure for scenarios like:
- Suspected exploit in progress
- Oracle instability
- Strategy-layer concerns requiring investigation
Liquidity Stress Scenarios
Section titled “Liquidity Stress Scenarios”Partial upstream liquidity
Section titled “Partial upstream liquidity”Scenario: strategy cannot provide full requested liquidity immediately (e.g., high Aave utilization).
Expected behavior:
- Availability checks reflect constrained withdrawal capacity
- Calls may partially succeed at lower layers or revert in exact-amount flows
- Users can retry as liquidity conditions improve
The capital still exists, lent out and recoverable as upstream liquidity normalizes.
Mass redemption under circuit breaker
Section titled “Mass redemption under circuit breaker”Scenario: a large share of investors attempt exits simultaneously, triggering the circuit breaker.
Expected behavior:
- Early exits within the buffer limits succeed immediately
- Once limits are reached, subsequent exits revert until capacity replenishes
- Processing stretches over time as the buffer refills
- Deterministic conversion rules ensure all investors receive the same rate regardless of exit order
Circuit breaker + strategy liquidity combined
Section titled “Circuit breaker + strategy liquidity combined”When both circuit breaker limits and strategy liquidity are constrained:
- Circuit breaker limits dominate when they are tighter than available liquidity
- Yield strategy liquidity limits dominate when available liquidity is less than circuit breaker capacity
- The effective withdrawal rate is the minimum of the two constraints
- Both constraints are temporary and resolve independently