AI Fin Hub

Generator

Trading System Blueprinter

The default stack (broker alpaca, data alpaca, model claude-opus-5-5, fractional-kelly risk, duckdb storage, launchd schedule) comes out as a Mermaid diagram and a 22-line starter repository tree.

On the documented defaults, computed by this tool's engine · the same answer as JSON

Pick your data source, LLM, broker, storage, risk engine, logger. Get a Mermaid architecture diagram + a copyable starter file tree.

01Generator

Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

1. Pick your stack

Data source

Where your bars / quotes / book events come from.

Broker

Who your orders route through.

LLM layer

Research + decision-support model. BYO keys.

Storage

How you persist bars, trades, decisions, dossiers.

Risk engine

What stops you from blowing up.

Logging + observability

How you see what the agent actually did.

Scheduler

How cadence is enforced.

Stack signature

Alpaca → Claude Opus 5.5 → Alpaca

7 / 7 layers chosen, risk: Fractional Kelly sizer (quarter Kelly cap)

Schedule: launchd (macOS-native). Storage: DuckDB + Parquet. Logging: Heartbeat JSON + Telegram alerts

2. Architecture (Mermaid)

flowchart LR
  SCHED["launchd"] -->|tick| DATA["alpaca"]
  DATA -->|bars / book events| NORM[Normalize + persist]
  NORM --> STORE["duckdb"]
  STORE --> RESEARCH["claude-opus-5-5 · price-blind research"]
  RESEARCH -->|proposal + confidence| RISK["fractional-kelly"]
  RISK -->|sized order| EXEC["alpaca"]
  EXEC -->|fills + errors| LOG["heartbeat-json"]
  LOG --> STORE
  LOG -.-> ALERT[Telegram / email]

Paste into any Mermaid-compatible renderer (Notion, Obsidian, GitHub, VS Code preview).

3. Starter repo scaffold

trading-system/
├── README.md                    # start here
├── .env.example                 # API keys (never commit real values)
├── scripts/
│   ├── fetch-bars.py            # data source → local duckdb
│   ├── research.py              # LLM call (price-blind context builder)
│   ├── decide.py                # risk sizing + decision logger
│   ├── execute.py               # broker call (idempotent)
│   └── heartbeat.py             # health probe + alert
├── data/
│   ├── heartbeat.json           # last-heartbeat timestamp (watchdog reads)
│   ├── circuit.json             # {"paused": false, "reason": ...}
│   └── tickers/                 # per-ticker markdown dossiers
├── memory/
│   └── decisions.jsonl          # append-only decision log
├── plists/
│   └── com.you.trader-*.plist   # launchd schedules
├── tests/
│   ├── test_research_no_price_leak.py
│   ├── test_sizing_caps.py
│   └── test_idempotent_orders.py
└── pyproject.toml

Minimal, opinionated layout. Everything non-runtime lives outsidescripts/. Add pyproject / requirements to taste.

Why this shape

  • Schedule → data → research → risk → execute → log enforces the ordering that keeps your LLM out of the price decision loop.
  • Heartbeat + circuit breaker are first-class so you can spot dead pipelines in under one cycle.
  • Append-only decisions.jsonl makes post-mortems possible; any LLM-driven system is unauditable without it.
  • Tests cover the three most dangerous failure modes: price leakage, sizing blow-up, duplicate orders.

02Receipt

What the answer above ran on, how it is computed, where the data comes from, and a link that reopens it.

Inputs

  • brokeralpaca
  • dataalpaca
  • llmclaude-opus-5-5
  • loggingheartbeat-json
  • riskfractional-kelly
  • schedulelaunchd
  • storageduckdb

The documented defaults. Change any input above and the tool recomputes.

Method

How the hub's tools are built and checked

Engine /engines/trading-system-blueprinter.js, sha256 fce9da3928a9. The page, the API and MCP run the same file.

Source

Model list prices (aidevhub.io catalog)

Checked .

Permalink

aifinhub.io/trading-system-blueprinter/

The link carries the inputs you set, so it reopens this result.

03For agents

Any agent can run this calculator by URL or MCP and get the same answer as JSON: the inputs that used defaults, the result and a line to cite. The call below follows the inputs you set above. In code, import the same engine; it runs where you import it, with no request or key.

Requestthe documented defaults
GET https://aifinhub.io/api/run/trading-system-blueprinter
Response200 application/json · 4.4 KB
{
  "calculator": "trading-system-blueprinter",
  "title": "Trading System Blueprinter",
  "site": "AI Fin Hub",
  "input": {},
  "defaults_used": {
    "broker": "alpaca",
    "data": "alpaca",
    "llm": "claude-opus-5-5",
    "logging": "heartbeat-json",
    "risk": "fractional-kelly",
    "schedule": "launchd",
    "storage": "duckdb"
  },
  "result": {
    "selections": [
      {
        "category": "data",
        "label": "Data source",
        "optionId": "alpaca",
        "optionName": "Alpaca (free IEX or paid SIP)",
        "notes": "Best if you also trade on Alpaca."
      },
      {
        "category": "broker",
        "label": "Broker",
        "optionId": "alpaca",
        "optionName": "Alpaca",
        "notes": "Broker + data in one."
      },
      {
        "category": "llm",
        "label": "LLM layer",
        "optionId": "claude-opus-5-5",
        "optionName": "Claude Opus 5.5",
        "notes": "Frontier Anthropic model; $4 / $20 per 1M tokens, 1M context."
      },
      {
        "category": "storage",
        "label": "Storage",
        "optionId": "duckdb",
        "optionName": "DuckDB + Parquet",
        "notes": "Columnar, zero-setup, fast."
      },
      {
        "category": "risk",
        "label": "Risk engine",
        "optionId": "fractional-kelly",
        "optionName": "Fractional Kelly sizer (quarter Kelly cap)",
        "notes": "Sound default for calibrated models."
      },
      {
        "category": "logging",
        "label": "Logging + observability",
        "optionId": "heartbeat-json",
        "optionName": "Heartbeat JSON + Telegram alerts",
        "notes": "launchd-native, $0/mo, vacation-safe."
      },
      {
        "category": "schedule",
        "label": "Scheduler",
        "optionId": "launchd",
        "optionName": "launchd (macOS-native)",
        "notes": "Preferred on Mac. Zero external deps."
      }
    ],
    "mermaid": "flowchart LR\n  SCHED[\"launchd\"] -->|tick| DATA[\"alpaca\"]\n  DATA -->|bars / book events| NORM[Normalize + persist]\n  NORM --> STORE[\"duckdb\"]\n  STORE --> RESEARCH[\"claude-opus-5-5 · price-blind research\"]\n  RESEARCH -->|proposal + confidence| RISK[\"fractional-kelly\"]\n  RISK -->|sized order| EXEC[\"alpaca\"]\n  EXEC -->|fills + errors| LOG[\"heartbeat-json\"]\n  LOG --> STORE\n  LOG -.-> ALERT[Telegram / email]",
    "fileTree": "trading-system/\n├── README.md                    # start here\n├── .env.example                 # API keys (never commit real values)\n├── scripts/\n│   ├── fetch-bars.py            # data source → local duckdb\n│   ├── research.py              # LLM call (price-blind context builder)\n│   ├── decide.py                # risk sizing + decision logger\n│   ├── execute.py               # broker call (idempotent)\n│   └── heartbeat.py             # health probe + alert\n├── data/\n│   ├── heartbeat.json           # last-heartbeat timestamp (watchdog reads)\n│   ├── circuit.json             # {\"paused\": false, \"reason\": ...}\n│   └── tickers/                 # per-ticker markdown dossiers\n├── memory/\n│   └── decisions.jsonl          # append-only decision log\n├── plists/\n│   └── com.you.trader-*.plist   # launchd schedules\n├── tests/\n│   ├── test_research_no_price_leak.py\n│   ├── test_sizing_caps.py\n│   └── test_idempotent_orders.py\n└── pyproject.toml",
    "unknownCategories": [],
    "unknownOptions": []
  },
  "provenance": {
    "run": "https://aifinhub.io/api/run/trading-system-blueprinter",
    "page": "https://aifinhub.io/trading-system-blueprinter/",
    "methodology": "https://aifinhub.io/trading-system-blueprinter/",
    "contract": "https://aifinhub.io/contracts/trading-system-blueprinter.json",
    "engine": "https://aifinhub.io/engines/trading-system-blueprinter.js",
    "engine_sha256": "fce9da3928a91d26167660ca5df6d2755eaaee7f895f9a943954ff882e7c5433",
    "build": "1a772910d31ef1740892ed0e3a065ed71e8c7406",
    "prices_verified": "2026-11-14",
    "prices_source": "https://aidevhub.io/api/models.json"
  },
  "disclaimer": "Planning estimates only — not financial, tax, or investment advice.",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "cite": "AI Fin Hub, Trading System Blueprinter (engine fce9da3928a9), https://aifinhub.io/api/run/trading-system-blueprinter"
}
The response for the defaults, as the run URL returns it. Provenance carries the engine hash and build.

How to use it

  1. Pick your data source (Databento, Alpaca, Massive (formerly Polygon), or Tiingo). This sets the ingestion layer in the diagram.
  2. Choose the LLM for signal generation and the broker for execution (Alpaca, IBKR, Tradier, or paper trading).
  3. Select the storage backend, risk engine (fractional Kelly, vol-target, max-drawdown kill, or no risk layer), logger, and scheduler.
  4. Read the Mermaid architecture diagram — it reflects your seven selections and shows how each layer connects.
  5. Copy the starter file tree to your clipboard. It's a scaffold — wire your own tests, secrets management, and observability before pointing it at real capital. There is no ZIP download and no compliance section.

Questions people ask

What does the blueprint output look like?

A Mermaid architecture diagram that reflects your seven picks (data source, LLM, broker, storage, risk engine, logger, scheduler) and a copyable starter file tree for the repo. It's a shape-and-scaffold tool: the diagram is the discussion artefact, the file tree is the folder skeleton — not a per-component spec or a generated codebase.

Is this for institutional or retail?

There is no scope selector. The seven dropdowns target small-team, single-strategy production — a useful starting point for any automated strategy. Choosing the paper broker gives a research-only scaffold; a live broker adds an execution layer to the diagram. Scale the file tree to your actual needs by hand.

What does it recommend for execution infrastructure?

For retail automated strategies the execution layer is a broker API (IBKR, Alpaca, Tradier, or paper), and the tool reflects your broker choice in the diagram. Colocation and direct-exchange-connectivity tradeoffs are outside what the tool models, and the blueprint does not generate them.

Does it cover compliance and audit logging?

It picks a logger for the diagram (heartbeat JSON, Loki/Grafana, Sentry, or stdout), but it does not generate a compliance section, trade-blotter spec, or FINRA-recordkeeping checklist. Regulatory recordkeeping is your responsibility, not something the tool outputs.

Are there template configs I can copy?

The output is a copyable file tree — a folder-and-file skeleton you paste into a new repo — plus the Mermaid diagram. There are no downloadable docker-compose files, Terraform templates, monitoring dashboards, or links to template repositories; you wire the real implementation yourself.

Related pages

  • Directories Finance MCP Directory

    Security-graded catalog of finance MCP servers from Alpaca, Massive, IBKR, Tradier, TradeStation, Robinhood and tastytrade: scope, auth, idempotency.

  • Comparators Market Data API Cost Calculator

    Compute annual cost of market data across Databento, Massive (formerly Polygon), Alpaca, Tiingo, FMP, and Alpha Vantage for your exact universe, bar resolution, and real-time needs.

  • Playgrounds Price-Blind Research Auditor

    Paste a research prompt or agent context bundle. The auditor flags price numbers, directional words, and outcome-leaking phrases that cause LLMs to retroactively rationalize positions. Builds a price-blind research boundary.

All articles