Risk and safety
Allowlists, size limits, the drawdown breaker, pause, and the oracle.
Safety limits are enforced in the vault, not in the app. A Lead cannot route around them by calling the adapter directly. UniswapV4SwapAdapter.swap accepts only a factory vault or the treasury.
Allowlists
- Adapters:
VaultFactory.setAdapter, owner only. A trade checksisAdapter. - Tokens:
VaultFactory.setTokenAllowed, owner only. The Lead can only enable a token that is already on this list.
Size, idle, and slippage
| Limit | Vault field | Protocol cap |
|---|---|---|
| One position | maxPositionBps | 50% (5,000 bps) |
| One trade | maxTradeBps | 50% (5,000 bps), and not zero |
| Idle asset floor | minIdleBps | 2% to 50% (200 to 5,000 bps) |
| Open position tokens | positionTokens.length | 16 |
| Slippage | minAmountOut | Trade reverts if the output increase is smaller |
Drawdown breaker
The vault stores peakPps, the highest per-share price after fees. Trading pauses when the current price is below that peak by more than maxDrawdownBps.
pps * 10_000 / peakPps < 10_000 - maxDrawdownBpsmaxDrawdownBps must sit between 500 and 5,000 (5% to 50%). On a breach the vault sets tradingPaused and emits CircuitBreakerTripped. New trades revert. Deposits are not paused by the breaker. Claims are not paused by the breaker.
Pause semantics
| Flag | Who sets it | What keeps working |
|---|---|---|
| tradingPaused | Breaker, or a stale oracle during crystallize | Deposits, unless also paused or stale. Claims. |
| depositsPaused | Factory owner or guardian, via the factory | Trades, if the breaker is clear. Claims. |
clearCircuit(vault, false) may be called by the factory owner or the guardian, and only if prices are fresh and the vault is no longer breached. clearCircuit(vault, true) is owner-only. Force also sets peakPps to the current price.
Oracle
The factory starts oracleStaleness at 1 day. The owner can set it from 10 minutes to 7 days. Price is asset raw units per 1e18 raw token units. The asset itself is not quoted. Its balance is counted raw.
A stale price reverts deposits and trades. During crystallize it pauses trading, emits OracleStale, and skips the fee mint for that call. totalAssets still adds the last non-zero quote and reports the book as stale to the checks above.