Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

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-monitor

Non-interactive (CI/agents):

rflow new --template erc4626-vault-monitor --yes --output ./vault \
  --answer min_deposit=100000 --answer min_share_price=0.98

Inputs

keytypedefault
project_namestringerc4626-vault-monitor
network / chain_id / rpc_env / rpc_urlnetwork / chain_id / env_var / stringethereum / 1 / ETH_RPC / a public RPC
vault_name / vault_addresscontract / addressVault / zero placeholder (replace!)
share_decimals / asset_decimalsint18 / 6
min_deposittoken_amount100000
min_share_pricetoken_amount0.98
poll_everyduration1m
channelstringops

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 start

Common modifications

  • tighten min_share_price for a hair-trigger de-peg alarm
  • add a second convertToAssets poll at a large share count to watch rounding
  • drop the deposit/withdraw workflows if you only care about the share price