v4 Keeper

How v4 Keeper works

v4 Keeper is a job board with an escrow. You describe a call and a trigger, put up the reward, and any bonded keeper can run it once the trigger holds. The contracts enforce every rule on this page.

Jobs

A job has a target contract and calldata, a reward per run in USDG, a number of runs, an optional start time and expiry, a minimum interval between runs, and an optional price condition on a Uniswap v4 pool. Posting escrows rewardPerRun × runs. Anyone can add runs with topUp. The poster can cancelJob at any time, including while the registry is paused, and gets the unspent escrow back.

Triggers

checkJob returns whether a job can run and why not. Price conditions read the pool's sqrtPriceX96 from the PoolManager with extsload at execution time. No external oracle is involved. Use "at or above" for take-profit and limit sells, "at or below" for stop-losses.

The runner

Job calls are made by the JobRunner, a contract that only the registry can call and that never holds funds. If your target needs to allow keepers, allow the runner address. If the call reverts, the whole run reverts. The registry counts no run and pays nobody. Calls straight at the registry, the runner, USDG or the bond token are rejected when the job is posted.

Keepers and bonds

A keeper bonds the current bond token (native ETH today). The admin can switch the bond token, for example to $V4KEEP, without a redeploy. Keepers bonded in an old token stop being active and withdraw it the usual way. Unbonding starts a delay at least as long as the dispute window, and the bond stays slashable until it is withdrawn.

Fees

Each run pays the keeper the reward minus the protocol fee, which goes to the treasury. The contract caps the fee at 10%. The values below are the current settings on the registry.

Disputes and slashing

Within the dispute window after a run, the poster can openDispute with evidence. An arbiter resolves it. If upheld, up to the keeper's full bond is sent to the poster. Arbiters can also slash directly for misconduct across jobs. Every slash is an onchain event.

Contracts

Contracts are verified on robin.etherscan.io. The keeper bot and the indexer are in the repository.