---
name: check-vault-health
description: Check the health and state of a deployed SmartVault by querying on-chain data
disable-model-invocation: true
argument-hint: "[vault-address]"
---

Check the health of a deployed SmartVault.

Steps:
1. Determine RPC URL and vault address:
   - If `$ARGUMENTS` provides a vault address, use it
   - Otherwise, read from `config/vaults.production.json` or `.env`
   - Get RPC_URL from `.env` (default: http://127.0.0.1:8545)

2. Query vault state using `cast call`:

```bash
# Total assets (USDC)
cast call $VAULT "totalAssets()(uint256)" --rpc-url $RPC

# Position state
cast call $VAULT "getPositionState()((uint256,int24,int24,uint128,uint256,uint128,uint256,uint256))" --rpc-url $RPC

# Current delta (net ETH exposure, signed)
cast call $VAULT "getCurrentDelta()(int256)" --rpc-url $RPC

# Total value USD (18 decimals)
cast call $VAULT "getTotalValueUSD()(uint256)" --rpc-url $RPC

# Risk params
cast call $VAULT "riskParams()((uint256,uint256,uint256,uint256,uint256))" --rpc-url $RPC

# NAV snapshot (full breakdown)
cast call $VAULT "getNAVSnapshot()((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,int256,uint256,int256,uint256))" --rpc-url $RPC
```

3. Present a health report: TVL, delta, drift estimate, leverage, LP position details, hedge position details, and any warnings.
