Documentation

merrymen is a self-hosted band of autonomous trading agents for Robinhood Chain. Everything runs on your machine; your keys never leave it. This guide takes you from install to a named agent you chat with on Telegram.

Install

Requires Node 22.12+. No Node yet? The one-line installer sets it up and puts merrymen on your PATH.

# Windows (PowerShell)
irm https://raw.githubusercontent.com/millw14/merrymen/main/install.ps1 | iex

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/millw14/merrymen/main/install.sh | bash

Already have Node?

npm install -g merrymen
merrymen setup      # checks node / npm / PATH, prints exact fixes
merrymen start      # dashboard at localhost:3100 + the worker
“merrymen: command not found”? npm's global-bin folder isn't on your PATH. Use npx merrymen start, or run merrymen setup for the exact one-time fix for your OS.

All your data lives in ~/.merrymen (settings, grant, ledger, your strategies, your agent's soul). The install is disposable — upgrades never touch your data. The dashboard binds to localhost only; to reach it from your phone on a trusted network, start with MERRYMEN_HOST=0.0.0.0 merrymen start.

Create & fund a wallet

Open localhost:3100/grant. There is nothing to connect — merrymen generates a fresh account, shows you the owner key to back up, and lets you fund it. Pick your ground:

chainwhat it is
testnet · 46630The sandbox (default). Free gas from the faucet, the full pipeline end to end. The trading venues aren't deployed there, so swaps simulate and no-route by design — ideal for learning the flow.
mainnet · 4663Real funds. Real USDG, real Stock Tokens, real execution. Keys are stored in plain text on your machine, so treat the account like a hot wallet — your caps are the seatbelt, start small. No faucet: send ETH (gas) + USDG (capital) from your own wallet or an exchange.
Back up the owner key. It controls the account and every dollar in it. Lose it and the funds are gone — there is no recovery service.

The caps you set — per-trade, daily, ops/day, drawdown breaker, key expiry — are enforced by the account contract on every operation. The worker can tighten within them but never widen them without a new signed grant.

Bundler gotcha: a 4337 bundler URL (Pimlico/Alchemy) embeds its chain id (…/v2/4663/…). It must match your wallet's chain or every op fails — the worker warns you at arm time. Without a bundler URL, the agent runs policy + simulation but never signs.

Run it

merrymen start      # dashboard (localhost:3100) + the 24/7 worker
merrymen doctor     # node / keys / RPC / bundler / grant / db checks
merrymen status     # heartbeat, grant, trades, equity
merrymen selftest   # one policy-legal no-op through the full pipeline
merrymen kill       # kill switch — destroys the grant

Each tick the worker runs: grant sync → market safety → strategy proposes → policy check → quote simulation → execute → record. It re-reads your settings every tick, so dashboard changes apply within one tick — no restart.

Set up Telegram

  1. Message @BotFather/newbot → copy the token.
  2. Dashboard → Settings → Telegram → paste the token, hit test connection (it shows your @botname), enable.
  3. Message your bot /link <code> — the one-time code is shown in settings. You become the owner; only allowlisted chats are obeyed.

There's a Chat on Telegram button on the dashboard too. Commands work bare; with an Anthropic key set, plain English works — “how are we doing?”, “pause everything”, “why did you buy that?”.

Commands

/status /positions /pnl /tradesread the live book
/report · /brag · /whydaily report · shareable scorecard · explain the last trade
/buy <SYM> <usdg> · /sell …trade (passes the policy wall)
/transfer <0x…> <usdg>send USDG out — always asks to /confirm
/alert <SYM> > <price>one-shot price alerts · /alerts · /unalert
/pause /resume · /strategy · /capsteer the worker (cap only tightens)
/name · /soul · /remembername it, see who it is, teach it about you
/killdestroy the grant, stand the band down

It speaks first too (toggle in settings): a ping the moment a trade lands or the wall turns one back, warnings for grant expiry / drawdown / low gas, your price alerts, and a daily campfire report at the hour you pick.

Transfers

Sending USDG out of the account is triple-guarded:

  • Off by default — enable “allow transfers” in settings.
  • Amount-capped on-chain — the grant's call policy caps the per-transfer amount.
  • Always confirmed — every transfer echoes the full recipient address and waits for an explicit /confirm (90s), plus a daily transfer budget.

A prompt-injected “send everything to 0xevil” can at worst produce a confirmation card you will see and /cancel. Transfers need a wallet created with the transfer permission; a pre-transfer grant gets a “re-create your wallet” reply instead.

PC remote control

Enable the remote control section in settings and your merryman can act on the machine it runs on, from Telegram. It is a hot wallet for your desktop, so the whole design is safety-first:

📸 screen · 👁️ vision/shot; “what am I looking at? / read this error”
🚀 apps & web/open spotify, /open github.com
⚙️ system/sys, volume, media, /notify, /lock, sleep/shutdown
📂 files · 📋 clipboard/ls, /get inside one folder you pick; clipboard
🖥️ shell · ⌨️ keyboard/run allowlisted commands; /type, /key ctrl+s
👀 watchers/remind 20m …, /watch cpu>80, watch a file or process
  • Off by default, then one capability at a time. /pc shows what's on; the master switch off kills all of it.
  • Allowlists for the sharp edges: shell runs only your exact pre-approved commands (chaining/redirects refused); files are confined to one root (no .. escape); apps to a name list.
  • Confirm gate: shell, keyboard, file-send, and power never fire until you /confirm the exact action echoed back.
Windows is fully supported; macOS/Linux use the standard tools and say so where one isn't present.

Voice & vision

Send a Telegram voice note and it's transcribed and run as a command (needs an OpenAI-compatible transcription key, set in the dashboard). Vision (“what am I looking at?”) screenshots your screen and answers with Claude — powered by your own Anthropic key.

The soul

Every merryman is an individual. Its soul lives as plain markdown in ~/.merrymen/soul/:

IDENTITY.mdwho it is — its name (/name Will Scarlet), born date
OWNER.mdwhat it's learned about you, one dated line at a time
JOURNAL.mda first-person entry it writes at campfire time

The bond deepens over time — new companion → trusted companion (a week) → old friend (a month) → sworn brother-in-arms (100 days), with milestone messages and a tone that warms to match. Memory is context, never capability: soul files flavor chat only, and the sanitizer refuses anything address-, key-, or code-shaped.

Strategies

Pick one in settings (or /strategy <name> from Telegram):

steady-basketDCA a weighted stock basket per tick; idle cash sweeps to the Morpho vault (default).
weekend-gapEnter each leg when its Chainlink feed goes stale (market close), exit when it refreshes (open).
llm-strategistClaude proposes typed buy/sell/hold; deterministic code disposes. Needs an Anthropic key.

Write your own bot

Your strategies live in ~/.merrymen/strategies/ — hot-reloaded, crash-isolated, and unable to exceed the caps you signed.

merrymen strategy new my-bot   # commented template
# edit it, select "my-bot" in settings — done

Default-export { name, tick(snapshot, ctx) }. ctx injects the verified registry (ctx.tokenBySymbol.QQQ, ctx.usdg(10)). Every intent still passes shape validation → the policy wall → quote simulation → the on-chain session key.

Safety model

One rule: the model proposes, deterministic code disposes. No strategist, Telegram message, or voice note ever constructs calldata, moves funds, or touches your PC without passing a closed, typed command set and — for money — the on-chain policy wall.

  • Trades pass caps enforced by the account contract; every swap is simulated first.
  • Transfers are amount-capped on-chain, off by default, and confirm-gated.
  • PC actions are off by default, per-capability, allowlisted, and the sharp ones are confirmed.
  • Secrets live only in ~/.merrymen and are masked before they ever reach the browser.
  • The kill switch destroys the grant; hard on-chain key expiry is the backstop.
Keys are stored in plain text locally today (production TEE custody is on the roadmap). Treat the account like a hot wallet — small amounts, back up the owner key.

Configuration

The dashboard Settings is the source of truth — Essentials up front, everything else under Advanced. Saved to ~/.merrymen/settings.json; secrets are masked and never echo back. Precedence: settings file → env var → default. Env vars are the headless fallback (MERRYMEN_BUNDLER_URL, ANTHROPIC_API_KEY, MERRYMEN_TELEGRAM_BOT_TOKEN, MERRYMEN_HOST, …). See the README for the full table.

Troubleshooting

The dashboard won't open

Run merrymen doctor. The prebuilt dashboard ships with the package, so a missing build usually means an interrupted install — reinstall with npm i -g merrymen@latest.

Trades never land

You need a bundler URL whose chain id matches your wallet, plus gas in the account. Without a bundler URL the agent simulates but never signs. On testnet, stock-token venues aren't deployed, so swaps no-route by design — that's expected.

Telegram says “not authorized”

Only allowlisted chats are obeyed. Send /link <code> with the code from settings to claim ownership.

A PC command is refused

Enable remote control and the specific capability in settings. Shell/apps also need the exact command/app on their allowlist; /pc shows what's on.

Still stuck? Open an issue on GitHub.