| 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:
-
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)
-
Query vault state using cast call:
cast call $VAULT "totalAssets()(uint256)" --rpc-url $RPC
cast call $VAULT "getPositionState()((uint256,int24,int24,uint128,uint256,uint128,uint256,uint256))" --rpc-url $RPC
cast call $VAULT "getCurrentDelta()(int256)" --rpc-url $RPC
cast call $VAULT "getTotalValueUSD()(uint256)" --rpc-url $RPC
cast call $VAULT "riskParams()((uint256,uint256,uint256,uint256,uint256))" --rpc-url $RPC
cast call $VAULT "getNAVSnapshot()((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,int256,uint256,int256,uint256))" --rpc-url $RPC
- Present a health report: TVL, delta, drift estimate, leverage, LP position details, hedge position details, and any warnings.