When to Use This Pattern
Use this pattern when unexpected inflows can distort protocol accounting, prices, or risk controls. It applies to lending vault donations, AMM reserve stuffing, bridged-asset accounting, staking receipt-token systems, and other protocols where excessive token inflow over a short window is suspicious. This is a V2 Reshiram circuit-breaker pattern. The trigger/precompile machinery collects token inflow into one bucket per block and evaluates those per-block buckets over the rolling window. The assertion does not need its own storage for this accounting.What This Pattern Checks
Registers a percentage-based cumulative inflow limit:registerAssertionSpec(AssertionSpec.Reshiram): Registers the assertion as a Reshiram assertion.watchCumulativeInflow(token, thresholdBps, windowDuration, assertFn): Collects ERC20 inflow into one bucket per block and watches the buckets over a rolling window.ph.inflowContext(): Reads the token context inside the triggered assertion.- Reverts when cumulative inflow breaches the configured threshold.
Assertion Pattern
Full examples and mock protocol code are available in credible-std.

