ERC-4626 vault monitor
Template: erc4626-vault-monitor ยท category: monitoring ยท risk: monitor_only
Watches a tokenized vault (ERC-4626) three ways: large Deposits, large
Withdraws, and a share-price floor. The share-price workflow polls
convertToAssets(1 share) โ the assets one share redeems for โ and fires once
when it drops below your floor. A share price that only ever rises is the
whole ERC-4626 invariant; a drop is a loss event or an exploit.
When to use it
- watch a yield vault for a share-price drop (bad debt, an exploit, a slashing)
- get paged on whale deposits/withdrawals that move the vault
- monitor a vault you allocate to without running its infra
Generate it
rflow new --template erc4626-vault-monitor
# or add the workflow to an existing project
rflow add workflow erc4626-vault-monitorNon-interactive (CI/agents):
rflow new --template erc4626-vault-monitor --yes --output ./vault \
--answer min_deposit=100000 --answer min_share_price=0.98Inputs
| key | type | default |
|---|---|---|
project_name | string | erc4626-vault-monitor |
network / chain_id / rpc_env / rpc_url | network / chain_id / env_var / string | ethereum / 1 / ETH_RPC / a public RPC |
vault_name / vault_address | contract / address | Vault / zero placeholder (replace!) |
share_decimals / asset_decimals | int | 18 / 6 |
min_deposit | token_amount | 100000 |
min_share_price | token_amount | 0.98 |
poll_every | duration | 1m |
channel | string | ops |
Required env vars
DATABASE_URL, the RPC env var (default ETH_RPC), TG_BOT_TOKEN,
TG_CHAT_ID โ all listed in the generated .env.example.
Safety notes
Monitor-only: no signer: and no relayers:, so the relayer engine never
boots. The share-price workflow is edge-triggered (one alert per de-peg, then
re-arms on recovery), and every workflow ends in on_failure: dead_letter.
Run it locally
docker compose up -d # postgres on localhost:5448
# fill .env, set vault_address and the share/asset decimals
rflow validate
rflow startCommon modifications
- tighten
min_share_pricefor a hair-trigger de-peg alarm - add a second
convertToAssetspoll at a large share count to watch rounding - drop the deposit/withdraw workflows if you only care about the share price