- Resolves the Zuno wallet (from your CLI session at
~/.zuno/session.jsonorZUNO_AGENT_WALLET_ADDRESS). - Lists Uniswap v4 positions held by that wallet.
- Builds a snapshot for each position and runs
isRiskyPosition. - For new risk conditions, writes a
PositionAlertto~/.zuno/alerts.jsonand (optionally) pings Telegram. - Repeats every
ZUNO_MONITOR_INTERVAL_MS(default 60s, floor 5s).
packages/strategy/src/monitor/.
Risk thresholds
| condition | severity | kind |
|---|---|---|
| out of range | critical | out_of_range |
| in range, utilization < 15% or > 85% | warning | near_boundary |
| in range, utilization 15-85% | - | not risky |
isRiskyPosition and riskReason live in @zuno/chain/uniswap; both monitor
and the agent debate consult them so the language stays consistent.
Dedup
Each tick checks the latest unacknowledged alert for the position. A new alert only fires when:- there is no prior alert for the position, or
- the prior alert was acknowledged, or
- the
kindorreasonchanged.
Telegram delivery
Telegram is optional. When unset, the monitor still runs and writes alerts locally; only the push channel is disabled.Setup
- Message @BotFather,
/newbot, save the token. - Send your new bot one message from the chat where you want alerts (DM or group; for groups, add the bot first).
- Hit
https://api.telegram.org/bot<TOKEN>/getUpdates, copyresult[0].message.chat.id. - Set both env vars and run
pnpm monitor.
What gets sent
The monitor calls the bot’ssendMessage endpoint with HTML-formatted text:
CLI commands
Insidezuno:
show alerts reads from the same ~/.zuno/alerts.json the monitor writes to,
so the shell sees alerts the moment the worker writes them.
Required environment
recommend rebalance → approve it → apply it.