spectra_stress_test_vault
Simulate a large redemption on a MetaVault to evaluate withdrawal liquidity. Computes maximum safe redemption size with minimal loss to remaining depositors.
Instructions
Simulate a large redemption on a MetaVault to assess withdrawal liquidity.
Builds a liquidity waterfall — sources of cash ordered by cost: Tier 1: Unallocated Cash (undeployed, no external — instant, no cost) Tier 1b: Avant Redemption Queue (avUSDx → avUSD burn, ~1 week cooldown per Avant docs, no price impact — emitted only when avant external positions exist; EXCLUDED from within-epoch max-safe calculation due to the delay, INCLUDED in the separate within-1-week metric) Tier 2: Naturally maturing Spectra LP positions (no cost, time-dependent) Tier 3: LP removal from Curve/Pendle pools (low-medium impact) Tier 4: PT sale on Curve pool (higher impact)
Note: "Unallocated" replaces the old "Idle" label. External positions (avant burn, pendle LP) are NOT counted in Tier 1 — they surface as Tier 1b (avant) or are excluded from all tiers (pendle external, conservative error mode).
Computes total coverage, cost to remaining depositors, and maximum safe redemption size (< 1% loss to remaining holders).
ERC-7540 constraint: once redemption is requested, the vault MUST fulfill it. There is no cancelRequest. This makes withdrawal liquidity critical.
Use spectra_get_curator_dashboard for operational overview before stress testing. Use spectra_get_pool_capacity to assess individual pool depth. Use morpho_monitor_risk for Morpho position risk.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | The blockchain network where the MetaVault lives. | |
| metavault_address | Yes | The MetaVault contract address. Use spectra_list_metavaults to discover addresses. | |
| redemption_pct | No | % of TVL redeemed in one epoch (default 30) | |
| market_stress | No | If true, assume 2x normal price impact on LP exits (correlated sell pressure) | |
| verify_onchain | No | Replace the API-derived `idleCapitalUsd` (Tier 1 unallocated cash) with a chain-truth equivalent computed from the Safe + infraVault state. Off by default — chain reads add latency and RPC pressure. When true, reads via the same engine that powers spectra_get_curator_dashboard (5-min cache shared with the dashboard, so a curator who just rendered the dashboard hits cache for free). The chain-truth formula is `safe.assetBalance + max(0, infraVault.totalAssets - sum(positions) - sum(external))`. The API derivation MISSES `safe.assetBalance` (curator-transit cash held DIRECTLY at the Safe, NOT counted in infraVault.totalAssets), which can be material when the curator is staging cross-chain inflows. Failures (RPC, timeout, missing bytecode) degrade to the API path. When `mv.underlying.price.usd === 0` the USD chain-truth is unverified; the output surfaces underlying-denominated chain-truth and falls back to API USD math for the waterfall. Dissolution: if telemetry shows zero verify_onchain=true invocations within 60 days of ship, the flag is fossil — consolidate by making chain-truth always-on for the cash derivation. |