Skip to Content
CLIGroups

Groups

A group of contracts: the rules that fill it, its name pattern, its table’s columns, its monitors and its members. See Groups.

Requires contract-dev login. groups is accepted as well as group.

group show <group>

Rules, table columns, monitors, and members with each column’s value. group <group> reads the same.

contract-dev group show Vaults
Vaults · 2 contracts Name pattern: {asset().symbol()} vault Rules (1) Kind Chain Address Reads Last sync Filled factory Arbitrum 0x02ca7772ff14a9f6c1a08af385aa96bb1b34175a 0x4f1a…2f1e · topic 1 2026-10-28 09:26 UTC complete Columns (1) Key Label Read Unit Decimals assets Assets totalAssets() usd from asset().decimals() Monitors (1) Name Column When Contracts States Vault draining assets below 1.00M (warn 10% before) 2 healthy 1 · warning 1 Members (2) Chain Name Address assets Arbitrum USDC vault 0x9a3f5c27d1e04b6a8f2c7e1d3b5a9c8e7f6d12cd $4.21M Arbitrum WETH vault 0x7c1e9b3d5f2a4c6e8b0d1f3a5c7e9b2d4f6a8c0e $1.08M

group add <group> <address|name>…

Put watched contracts in a group. The group is made if it is new. A contract can be in several groups: the protocol’s and one per chain.

contract-dev group add <group> <address|name>… [--chain <id|name>] contract-dev group add "DZap Arbitrum" "DZap Router Arbitrum" "DZap Zap Arbitrum"
Added 2 to DZap Arbitrum · already in 0 · 2 members DZap Router Arbitrum · Arbitrum · 0xce25…6ba4 DZap Zap Arbitrum · Arbitrum · 0x3d2f…91a0

Every contract is matched before anything changes.

group remove <group> <address|name>…

Take contracts out of a group. They stay watched, and lose what the group gave them: its columns’ readings and its monitors on them. unwatch removes them from the workspace. A contract a rule keeps in the group comes back on the rule’s next pass.

contract-dev group remove DZap 0xce2541ce645a1b232ff2fead53dcd9f369e86ba4 --chain arbitrum

group rule add <group>

Keep a group filled: every contract a factory deploys, or every contract a registry lists.

contract-dev group rule add <group> --factory <address> --event <Name> --field <arg> [--chain <id|name>] [--name-pattern "…"] [--recent] [--about "<role>" | --no-about] contract-dev group rule add <group> --registry <address> --function "getAllMarkets()" [--chain <id|name>] [--name-pattern "…"] [--about "<role>" | --no-about]
FlagDescription
--factory <address>Every contract the factory has ever deployed joins the group, in the background, then each new one. Thousands take a while; group show says how far it has got.
--event <Name>With --factory: the event that announces a new contract. Required.
--field <arg>With --factory: the event’s address argument that is the new contract. Required.
--recentWith --factory: only the last few weeks, and what comes next.
--registry <address>Every contract the registry lists joins the group.
--function "<view()>"With --registry: the view that lists the contracts. Required.
--chain <id|name>Needed for a factory or registry the workspace does not watch, or watches on several chains.
--name-pattern "…"Name the members as they join. See group name-pattern.
--about "<role>", --no-aboutA line on the group’s role for the workspace’s brief, as for watch. A coding agent gives one or the other.

--event and --field are both required: nothing is picked from names. contract-dev describe <factory> lists its events. A factory that deploys more than 25 contracts a week makes the protocol’s product rather than its own contracts, and a rule on it is refused; keep its children in a state table instead.

contract-dev group rule add pools --factory 0x1F98431c8aD98523631AE4a59f267346ea31F984 --event PoolCreated --field pool

group name-pattern <group> "<pattern>"

Name every member from its own reads. --clear lets members keep their own names again.

contract-dev group name-pattern pools "{token0().symbol()}/{token1().symbol()} pool" contract-dev group name-pattern pools --clear

group column add <group>

A column on the group’s table, one value per member, refreshed every minute: what group show lists and a group monitor judges. A column is tracked with history once a group monitor reads it.

A number across the group, kept over time, is a state metric: metric define "<name>" --on tag:<group> --call "<read>" reads every member and adds them up.

A read: one view on every member.

contract-dev group column add <group> --label "…" --read "totalAssets()" [--args a,b] [--word <n>] [--decimals <n>] [--decimals-from "decimals()"] [--token <token> [--show usd]] [--unit int|pct|duration|rate|raw] [--attribute] [--type address|uint|bool|string] [--key <key>]

A formula: calls resolved on every member and an expression over them and the group’s other columns.

contract-dev group column add <group> --label "…" [--call "<name>=<call> [on <target>] [with <args>] [decimals <n>]"]… --formula "<expr>" [--type bool] [--token <token> [--show usd]] [--unit …] [--key <key>]
FlagDescription
--label "…"The column’s label. Required.
--read "<view()>"The view read on every member.
--args a,bThe read’s argument values in order, comma-separated.
--word <n>Which return value to keep when the view returns several.
--call "<name>=<call>"A formula’s call: a view, balance(self), or slot(self, <key>). Repeat for more.
--formula "<expr>"The expression over the calls and the group’s other columns by label: {Held} - {Required}. A comparison makes a yes/no column.
--token <token>The reading is an amount of this token: its 0x address, self for each member itself, or a view each member answers with the token’s address, like asset(). Its decimals then scale it.
--show usdWith --token: show it in dollars.
--decimals <n>Without a token: scale the raw number.
--decimals-from "<view()>"Without a token: a view on each member that answers its own scale.
--unitint, pct, duration, rate or raw.
--attributeRead a non-numeric value once.
--typeaddress, uint, bool or string. --type bool on a formula makes it yes/no.
--key <key>The column’s key, used by --column elsewhere.

Nothing is assumed about what a reading is. Without --token it is the plain number.

contract-dev group column add vaults --label "Assets" --read "totalAssets()" --token "asset()" --show usd contract-dev group column add vaults --label "Headroom" --call "held=totalAssets()" --call "required=coverageLiquidity()" \ --formula "held - required" --token "asset()" --show usd contract-dev group column add vaults --label "Breached" --formula "{Held} < {Required}"

group monitor add <group>

One monitor on every member, judged on a column of the group’s table.

contract-dev group monitor add <group> --name "…" --column <key|label> --when "<formula>" [--warn "<formula>"]
FlagDescription
--name "…"The monitor’s name. Required.
--column <key|label>The column it judges. Required.
--when "<formula>"When it alerts. The column’s reading is value: value < 1000000, value > 95 (in the column’s display unit, 95 for 95% on a pct column), or value > {Cap} against another column of the same table. Required.
--warn "<formula>"A warning tier: the same comparison nearer the healthy side. --warn "value < 1100000" beside --when "value < 1000000"; --warn "value > {Cap} * 0.9" beside --when "value > {Cap}".
contract-dev group monitor add vaults --name "Vault draining" --column assets --when "value < 1000000" --warn "value < 1100000" contract-dev group monitor add vaults --name "Over cap" --column util --when "value > {Cap}"

See Condition alerts.

group monitor delete <group> <id|name>…

Remove a group monitor and the monitor it put on every member. Every name is matched before anything is deleted.

contract-dev group monitor delete vaults "Vault draining"
Deleted group monitor "Vault draining" (cmh7gmon0001xk3p2q8r5t7vz) and the 2 monitors it put on Vaults's members.
Last updated on