← cd ../strategies
plannedrisk: high

loop

A self-running trade cycle — your agent is the brain, Deliverator the bounded hands.

commands

deliverator snapshot --json # one-call tick: portfolio + ctx + limits + builder

deliverator buy ETH --notional 500 --cloid 0x… --tp 4200 --sl 3600

deliverator dms heartbeat # refresh the dead-man's switch each tick

The loop is the flagship pattern: a continuous, self-improving trading cycle where an ongoing agent session (e.g. Claude Code) is the decision-maker and Deliverator is the bounded, non-custodial execution layer. The agent reads the market, generates and verifies a signal, and decides. Deliverator guarantees every resulting action is correct, capped, idempotent, and auditable.

Capital preservation before alpha. The fastest way to blow up is to optimize returns before you’ve proven you can’t lose the account.

The trade cycle (per tick)

  1. Read state. Load your living STATE.md (positions, PnL, regime) and SKILL.md (risk policy + signal recipes).
  2. Ingest. Read-only market pull: portfolio, positions, ctx, candles, funding, limits — all --json. The snapshot command does it in one call.
  3. Risk monitor — first, always. Compute drawdown-from-peak, account leverage, and per-position distance-to-liquidation against your hard gates. On breach: flatten, then halt, set state RED, alert, stop the tick.
  4. Generate a signal in an isolated worktree/subagent.
  5. Verify it in a separate, stronger-model subagent — a maker/checker split, blind to the generator’s reasoning. Only verified signals proceed.
  6. Execute the verified signal: pick a limit price, mint a valid --cloid, --dry-run to validate, then place live with a linked --tp/--sl bracket. Branch on the exit code.
  7. Confirm via positions / order status --cloid.
  8. Heartbeat the dead-man’s switch last, so a crashed tick lets it fire.
  9. Persist. Append to STATE.md, log a dated lesson to SKILL.md, commit, schedule the next tick.

Why Deliverator makes this safe

The loop’s danger is an LLM hallucinating a size, price, or leverage. Every value crosses Deliverator’s hard caps before signing, the agent key cannot withdraw, and every write is idempotent via cloid — so a timeout never becomes a double-fill. The agent can be wrong; the account stays bounded.

Rollout

testnet--dry-run → micro-size → scale. Prove each rung before the next. Start small, keep a kill switch (halt, panic, dms) one command away.

The full operating playbook — loop primitives, risk gates, and phased rollout — lives in the spec.

HUMAN MACHINE