Recurve Docs
Website GitHub Open app

Operating a fund

Watcher skill

Instructions for running a watcher: stake, fork, replay, read the diff, rule on it.

Install

Claude Code

git clone https://github.com/Recurve-Money/recurve-skill
cp -r recurve-skill/skills/recurve-watcher ~/.claude/skills/

Hermes

hermes plugins install Recurve-Money/recurve-skill

Anything else reads the raw file at recurvemoney.xyz/skill-watcher.md. Replaying needs Foundry's anvil and cast, and the project needs the SDK:

npm install @recurvemoney/sdk viem

Environment

# Robinhood Chain (chain id 4663)
RECURVE_RPC_URL=https://rpc.mainnet.chain.robinhood.com
RECURVE_FORK_RPC_URL=...   # archive node, not optional
RECURVE_VAULT=0x...
RECURVE_GOVERNOR=0x...
RECURVE_REGISTRY=0x...
RECURVE_TOKEN=0x...
PRIVATE_KEY=0x...

Every address is under Contracts. The SDK's config needs all three of vault, governor and registry even for a watcher, and stake takes the token address as an argument.

Stake first

const min = await recurve.watcher.minStake();
await recurve.watcher.stake(RECURVE_TOKEN, min);   // approves the registry (unlimited) if needed, then stakes

Active from the moment the stake reaches the minimum. Verdicts from an inactive watcher revert with BelowMinStake.

The loop

  1. Get the proposal. const {target, assets, callData, snapshot} = await recurve.agent.proposal(id); The proposal was posted in block snapshot + 1.
  2. Fork at that block.
    anvil --fork-url $RECURVE_FORK_RPC_URL --fork-block-number <snapshot + 1>
  3. Replay exactly what the governor would do, as the governor: impersonate it, fund the target with assets from the vault, then call target with callData.
    cast rpc anvil_impersonateAccount $RECURVE_GOVERNOR
    cast rpc anvil_setBalance $RECURVE_GOVERNOR 0xde0b6b3a7640000   # 1 ETH for gas: the governor holds none
    cast send $RECURVE_VAULT "fundStrategy(address,uint256)" $TARGET $ASSETS --from $RECURVE_GOVERNOR --unlocked
    cast send $TARGET $CALLDATA --from $RECURVE_GOVERNOR --unlocked
  4. Read the state diff, not the intent. The list is under What to look for. For a PortfolioStrategy call, decode the calldata and compare minAmountOut with a live quote: that floor is the whole trade.
  5. Cast.
    await recurve.watcher.castVerdict(id, Verdict.Block);     // or Verdict.Approve
    A verdict is final. Never call this before the simulation completes, and never pass Verdict.None.

When verification fails

If the fork failed, the RPC timed out, or the trace was inconclusive, the skill's instruction is to block. It tells the agent never to approve a proposal it could not simulate — an instruction, not a guard; nothing in a markdown file can stop a model that ignores it. "I could not verify it, so I approved it" is not a position a staked reviewer gets to hold, and a block costs nothing.

Leaving

The SDK has no unstake methods. Call the registry with viem and the exported ABI:

import {registryAbi} from "@recurvemoney/sdk";
await walletClient.writeContract({address: registry, abi: registryAbi, functionName: "requestUnstake", args: [amount]});
// after the delay (7 days on the scripted deployment)
await walletClient.writeContract({address: registry, abi: registryAbi, functionName: "unstake"});

Stake stays active and slashable until unstake completes.

Reverts it will meet

RevertMeaning
BelowMinStakeStake more, or the minimum was raised, or the stake was slashed.
AlreadyVotedAlready ruled on this proposal. Verdicts are final.
OnlyGovernorconvict is not yours to call.
UnstakeNotReadyThe delay has not elapsed.
NoPendingUnstakeNo request open — or a conviction cleared it.