# Vaultfire V3 — Monitoring Runbook

Owner: Vaultfire protocol ops (ghostkey316 + designated on-call, once appointed)
Scope: V3 pilot on Base only. V2 monitoring stays as-is.

## 1. Signals to monitor

### 1.1 On-chain per V3 contract
- `owner()` — must equal `MultisigGovernanceV3`. Alarm on any change.
- `paused()` — track edge, alert on flip.
- Balance drift vs invariant #1 (assets ≥ liabilities). Sampled every block on safe tag; page on `deltaWei < 0`.
- Event flow rate — alert on sudden drop (indexer regressed) or spike (>10× 30-day baseline).
- ForceExit(bondId) frequency — alert if >5/day.
- SlashV3(validator,…) — page immediately.

### 1.2 x402 API surface
- `/api/v3/protocol/solvency` returns 503 for >2 consecutive polls → page.
- `/api/v3/protocol/status.v3.pausedContracts.length > 0` → alert.
- 402 response rate on priced routes < 20% → alert (bypass suspected).
- 402→200 conversion rate below 95% baseline → alert (facilitator degradation).

### 1.3 SDK + facilitator
- `X402ClientV3` retry rate > 10% → alert.
- `PaymentCreditedV3` count without matching `PaymentWithdrawnV3` within 24h → info.

### 1.4 Off-chain
- Alchemy/Base RPC error rate > 2% → page.
- Vercel deploy fails → alert.
- Indexer lag > 2 min behind Base finalized → alert.
- Sentry error rate > 1/min sustained 5 min → page.

## 2. Alert routing
- Page = PagerDuty (or equivalent) → on-call rotation. Currently: ghostkey316 (solo). Do NOT enable pilot until at least one additional on-call exists.
- Alert = Slack + email digest.
- Info = daily digest only.

## 3. Dashboards
- Grafana or equivalent dashboards published from `pr7/generated`:
  1. Solvency by contract, live.
  2. Bond state transition histogram (created → active → challenged → settled → terminal).
  3. Reward liabilities vs commitments (invariant #6).
  4. x402 payment funnel.
  5. Mandate registry health (issuance, revocation, expiration).

## 4. Weekly review
- Reconcile solvency snapshots with on-chain `getStakedAmount` totals for every bond.
- Confirm `MultisigGovernanceV3.proposalCount()` equals off-chain governance record.
- Rotate hot guardian key on any suspected exposure.
- Verify audit-in-progress or completed status before allowing cap increases.

## 5. Contact tree (must be filled before pilot enable)
- Primary on-call: ghostkey316
- Secondary on-call: (unassigned — pilot blocker)
- Auditor point of contact: (unassigned — pilot blocker)
- Insurance / mutual aid signer set: (unassigned — pilot blocker)
