Skip to content

02How it works

Eight steps from a clean machine to a logged fill.

No proprietary runtime. A conda environment, an official broker connection, an EVM client, and a risk file that gets the last word.

01The loop

Five stations on one line.

  1. 01

    Prompt

    A mandate in plain language: scope, horizon, budget.

  2. 02

    Research

    pandas, models, notebooks. The pinned conda env.

  3. 03

    Risk check

    Allowlist, max notional, daily loss cap, approve-on-size.

  4. 04MCPRPC

    Route

    Broker rail for listed names. Chain rail for 24/7 tokens.

  5. 05

    Notify

    Push on every order. Fills logged back into the env.

05 → 02 · fills feed the next research pass

02Step by step

The sequence in full.

Steps one and four need nothing but Miniconda. Steps two and three are connections you make once.

  1. 01

    Install Miniconda and the env

    One environment file, pinned. Nothing in the research half depends on a broker or a chain existing.

    conda env create -f ah-env.yml && conda activate ah-env
  2. 02

    Connect the official Robinhood MCP

    Scoped to a dedicated agentic sub-account you funded deliberately. No password ever enters the environment.

    ah connect broker --account agentic --mode paper
  3. 03

    Add the Robinhood Chain RPC, watch-only

    Point an EVM client at the official RPC. Start read-only: confirm balances and quotes before any key can sign.

    ah connect chain --rpc $AH_CHAIN_RPC --watch-only
  4. 04

    Write the strategy in a notebook

    Ordinary pandas. The agent does not replace your research; it reads the same frames you do.

    jupyter lab notebooks/coil.ipynb
  5. 05

    The agent proposes

    Output is a proposal object: symbol, side, size, venue, and the reasoning that produced it. Nothing routes at this stage.

    ah propose --agent coil
  6. 06

    The risk engine accepts or rejects

    Allowlist, max notional, daily loss cap, approve-on-size. A rejected proposal is logged with the rule that killed it.

    ah risk check --config risk.yml
  7. 07

    Execute on broker, chain, or both

    Liquid listed names go out over MCP during market hours. Tokenized and 24/7 names go on-chain. One proposal can split across both.

    ah execute --dry-run   # drop --dry-run on purpose
  8. 08

    Log fills back into the env

    Fills land in the same environment that produced the signal, so tomorrow's backtest sees what happened, not what was intended.

    ah sync fills --out data/fills.parquet

03Architecture

One picture of the whole thing.

agent-loop.txt
Prompt
  │
  ▼
Research    conda: pandas, models, notebooks
  │
  ▼
Proposal    symbol, side, size, venue, rationale
  │
  ▼
Risk check  ──reject──▶  logged; loop returns to research
  │ accept
  ├──────────────▶  Broker rail   Robinhood MCP, market hours
  │                      │
  └──────────────▶  Chain rail    Robinhood Chain, 24/7
                         │
                         ▼
                      Notify  ──▶  fills logged back into env
  • a

    Research is venue-agnostic

    The notebook does not know which rail a fill lands on. It produces a proposal; routing is a separate decision.

  • b

    Risk sits in the middle

    Every path crosses the risk engine. There is no route around it, which is the point of putting it there.

  • c

    Both rails can fire at once

    A single research pass can send a liquid name to the broker and a 24/7 name on-chain in the same cycle.

The env file and the risk file.

Both are in the docs, with placeholder variables and no secrets.

Open the docs