explaingit

veridex-protocol/trading-fabric

0TypeScriptAudience · developerComplexity · 4/5ActiveLicenseSetup · moderate

TLDR

TypeScript rewrite of the TradingAgents multi-agent stock-decision pipeline, with typed events, replayable runs, policy files, spend caps, and a human approval queue.

Mindmap

mindmap
  root((trading-fabric))
    Inputs
      Ticker symbol
      Policy file
      LLM provider
    Outputs
      Trade decisions
      Run replay file
      Paper or testnet orders
    Use Cases
      Backtest agent debates
      Approve trades via CLI
      Embed in custom UI
    Tech Stack
      TypeScript
      Ink
      Docker
      LLM APIs

Things people build with this

USE CASE 1

Run a multi-agent debate over a ticker symbol and date with reproducible event logs.

USE CASE 2

Wire human approval into AI trading decisions using a file-based queue and per-trade spend caps.

USE CASE 3

Swap LLM providers (OpenAI, Anthropic, Ollama, etc.) via environment variables without changing agent code.

USE CASE 4

Send approved trades to the Veridex testnet using session keys with budgets.

Tech stack

TypeScriptNodeInkDocker

Getting it running

Difficulty · moderate Time to first run · 1h+

Needs an LLM provider API key plus environment configuration; Docker Compose helps but a config object and policy file must be set before any run.

MIT license. You can use, modify, and redistribute the code for almost any purpose as long as you keep the copyright notice.

In plain English

This repo is a TypeScript rewrite of an earlier Python project called TradingAgents, where a group of AI agents pretend to be different members of an investment team and argue over what to do with a stock. There are agents that look at the market, social chatter, news, and company fundamentals, then a bull and a bear debate the findings, a trader proposes an action, a risk team challenges it, and a portfolio manager makes the final call. The authors say they kept that team structure but rebuilt the plumbing so the runs are reproducible. Every step of the conversation produces a typed event, the whole run can be saved as a file and replayed later, and the rules about what trades are allowed are written in a separate policy file rather than hidden inside the agent code. Decisions that exceed a daily spend cap or a per-trade position size are escalated to a human approval queue, which is just files in a folder that you accept or reject from the command line. The project ships a command line tool. You can run it on a ticker symbol with a date, replay a saved run, approve or deny a pending decision, inspect the agents memory for a ticker, validate a policy file, or run an evaluation suite. There is also an Ink based terminal UI for watching a run live and a programmatic API for embedding it in other code. By default, trades are written to a paper ledger, but it can be switched to send orders to the Veridex testnet using session keys with budgets. Configuration is done through environment variables and a config object that pick the language model provider (the README lists many options, including OpenAI, Anthropic, Google, xAI, DeepSeek, Qwen, GLM, MiniMax, OpenRouter, Ollama, and Azure), set spend caps, choose a data directory, and toggle real execution. There is a Docker Compose setup, docs for architecture, threat model, and policy recipes, and an MIT license. The repo has 0 stars.

Copy-paste prompts

Prompt 1
Set up Veridex trading-fabric with Docker Compose and run a debate on AAPL using Anthropic as the LLM provider.
Prompt 2
Write a policy file for trading-fabric that caps daily spend at $1000 and rejects any short position larger than 5% of portfolio.
Prompt 3
Replay a saved trading-fabric run and explain why the bear agent's argument was rejected by the portfolio manager.
Prompt 4
Embed trading-fabric's programmatic API in a Next.js dashboard that streams the agent debate live.
Prompt 5
Switch trading-fabric from the paper ledger to the Veridex testnet and explain the session key budget flow.
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.