Beyond Chatbot Quants: Inside the Architecture of Vibe Trading

Beyond Chatbot Quants: Inside the Architecture of Vibe Trading

By Reggi, 07 Jul 2026

Most LLM trading experiments fail at the boundary between unstructured text and deterministic execution. A prompt can effortlessly invent an indicator or draft a trading thesis, but the actual mechanics of ingestion, point-in-time cross-market backtesting, and automated broker routing usually break down into an unmaintainable mess of fragile API glue.

Enter Vibe Trading, an open-source research workspace engineered to bridge the gap between high-level natural language intent and low-level financial execution. Operating entirely from a terminal interface, it packages market data loaders, strategy generators, an analytical backtest engine, behavioral auditing, and persistent research memory into a single deterministic execution loop.

Crucially, it is completely non-custodial. It grants researchers a local-first workbench for simulation and analysis, with an optional, killable path to broker execution bounded by explicit guardrails.

       +--------------------------------------------------------+
       |                  VIBE TRADING RUNTIME                  |
       +--------------------------------------------------------+
                                   |
                                   v
+------------------+     +------------------+     +------------------+
|      PLAN        | --> |      GROUND      | --> |     EXECUTE      |
| Skill selection  |     | Data routing via |     | Tool invocation, |
| Swarm presets    |     | 18 sources + web |     | Strategy code gen|
+------------------+     +------------------+     +------------------+
                                                           |
                                                           v
                         +------------------+     +------------------+
                         |     DELIVER      | <-- |     VALIDATE     |
                         | Reports, code    |     | Walk-Forward, MC |
                         | exports & IM bus |     | Run card audit   |
                         +------------------+     +------------------+

The Deterministic Research Loop

The system operates across a five-layer execution pipeline designed to eliminate hallucinations and preserve analytical fidelity:

LayerSystem Function
PlanThe core runtime determines optimal financial skills, tool sets, data providers, and multi-agent presets for the prompt context.
GroundLoads explicit context across A-shares, HK/US equities, crypto, futures, and forex using intelligent multi-provider routing.
ExecuteSynthesizes executable strategy code, triggers internal tools, and runs backtesting or analytical workflows.
ValidateSubject runs to rigorous statistical verification: benchmark overlays, Monte Carlo simulations, Bootstrap tests, Walk-Forward matrix analysis, and run card generation.
DeliverExports finalized artifacts, tool call traces, and strategy translations targeted for TradingView, TDX, MetaTrader 5, and MCP runtimes.

Data Resiliency: Autonomous Fallback Across 18 Sources

Data pipelines in algorithmic systems often suffer from vendor lock-in or fragile scraping targets vulnerable to IP rate limits. Vibe Trading resolves this through a unified abstraction: a single get_market_data call with intelligent routing.

bash
# Automated cross-market resolution via single unified interface vibe-trading run -p "Fetch daily bars for 600519.SH and AAPL.US from 2023 to 2024 using optimal routing"

Setting source: "auto" activates dynamic traversal across a ranked fallback chain that prioritizes low-ban-risk connections before touching sensitive APIs.

                        get_market_data(source="auto")
                                      |
                                      v
                 +------------------------------------------+
                 |       Per-Market Provider Fallback       |
                 +------------------------------------------+
                   /                   |                  \
                  v                    v                   v
            [ A-Shares ]          [ US / HK ]          [ Crypto ]
                 |                     |                   |
          1. tencent/mootdx       1. eastmoney         1. okx
             (TCP, zero-ban)      2. yahoo/sina        2. ccxt (100+ ex)
                 |                3. finnhub/tiingo        |
          2. eastmoney                 |              3. Local Cache
                 |                4. Local Cache
          3. baostock/tushare
                 |
          4. Local Cache
SourceTarget Asset / MarketAuth RequirementsInfrastructure Role
tencent, mootdxA-shareNoneZero IP-ban risk; direct 通达信 TCP protocol access.
eastmoneyA-share, US, HKNoneHigh-density OHLCV, market microstructure flows, fundamentals.
baostock, akshareA-share, US, HK, Futures, ForexNoneRedundant free-tier fallback fabric.
tushareA-share, Futures, Macro, FundsTokenHigh-precision historical reference data.
yahoo, sina, stooq, yfinanceUS, HKNoneLive charts, quotes, and options chains.
finnhub, alphavantage, tiingo, fmpUSAPI KeyInstitutional data ingestion layer.
okx, ccxtCryptoNone / KeysSpot and derivatives feeds spanning 100+ exchanges.
futuHK, A-shareOpenDLocal FutuOpenD gateway integration.
localAgnosticNoneHigh-throughput local CSV, Parquet, and DuckDB datasets.

Complementing price action data, 18 read-only inspection tools harvest structural alpha variables: northbound/southbound capital flows, dragon-tiger listings, margin trading exposures, block trades, options order chains, and SEC EDGAR filings.

Modular Skill Architecture

The platform's cognitive runtime decouples reasoning from capability via 79 specialized financial skills grouped into eight core functional domains.

+-----------------------------------------------------------------------+
|                    FINANCIAL SKILL DOMAINS (79 TOTAL)                 |
+-----------------------------------------------------------------------+
| Strategy (17)   : strategy-generate, cross-market, ichimoku, multi-factor |
| Analysis (17)   : factor-research, valuation-model, earnings-forecast     |
| Tooling (11)    : backtest-diagnose, pine-script, vnpy-export, alpha-zoo  |
| Asset Class (9) : options-strategy, convertible-bond, sector-rotation     |
| Data Source (9) : data-routing, tushare, okx-market, mootdx, sec-edgar    |
| Crypto (7)      : perp-funding-basis, liquidation-heatmap, defi-yield     |
| Flow (7)        : hk-connect-flow, us-etf-flow, financial-statement       |
| Risk (1)        : ashare-pre-st-filter                                    |
+-----------------------------------------------------------------------+

When stock modules fall short, engineers can register custom OHLCV loaders directly into the runtime framework.

Swarm Consensus: 29 Multi-Agent Topologies

Real-world investment teams do not rely on isolated analysts. Complex investment decisions require adversarial stress testing. Vibe Trading mirrors this operational reality through 29 pre-configured swarm topologies.

            +-----------------------------------------------+
            |    SWARM TOPOLOGY: investment_committee       |
            +-----------------------------------------------+
               /                                         \
              v                                           v
     +-----------------+                         +-----------------+
     |   Bull Desk     |                         |    Bear Desk    |
     | Long thesis gen |                         | Tail risk audit |
     +-----------------+                         +-----------------+
              \                                           /
               v                                         v
            +-----------------------------------------------+
            |               Risk Review Board               |
            |     Drawdown limits, factor stress-testing    |
            +-----------------------------------------------+
                                   |
                                   v
            +-----------------------------------------------+
            |               Portfolio Manager               |
            |          Final capital allocation sign-off    |
            +-----------------------------------------------+

Specialized environments include:

  • investment_committee: Orchestrates structured debate between adversarial bull and bear sub-agents, running conclusions through risk review to an executive PM agent.
  • global_equities_desk: Coordinates parallel regional specialists across A-share, HK/US, and digital asset markets directly into a global macro strategist.
  • crypto_trading_desk: Ingests perp funding basis, liquidation heatmaps, and on-chain flow to trigger risk-managed sizing.
  • quant_strategy_desk: Automates factor screening, quantitative formulation, backtesting, and automated risk scoring.
  • technical_analysis_panel: Derives algorithmic consensus by running classic patterns alongside Ichimoku, harmonic structures, Elliott Wave, and Smart Money Concepts (SMC).

Alpha Zoo: Institutional Factor Libraries

Instead of reinventing base alpha formulations, Vibe Trading embeds Alpha Zoo, a warehouse of 456 quantitative alphas spanning classical and modern quantitative literature:

ALPHA ZOO WAREHOUSE (456 ALPHAS)
├── qlib158   (154 alphas) : Microsoft Qlib baseline factors
├── alpha101  (101 alphas) : Z. Kakushadze (2015) 101 Formulaic Alphas
├── gtja191   (191 alphas) : Guotai Junan (2014) short-period factors
└── academic  (10 alphas)  : Academic benchmarks (Fama-French 5, Carhart)

The runtime executes real-time factor evaluation, automatically classifying formulations into active, reversed, or degraded factors while computing rigorous Information Coefficient (IC) and Information Ratio (IR) metrics.

The Shadow Account: Behavioral Forensics

A major barrier to trading profitability is not strategy logic, but human execution bias. The Shadow Account acts as an algorithmic mirror, reverse-engineering raw broker outputs to identify psychological and structural leakage.

+--------------------+      +--------------------+      +--------------------+
|  1. Parse Records  | ---> |  2. Profile Biases | ---> |  3. Synthesize     |
| Broker logs from   |      | Holding periods,   |      | Extract underlying |
| 富途, 同花顺, etc. |      | disposition effect |      | programmatic rules |
+--------------------+      +--------------------+      +--------------------+
                                                                  |
                                                                  v
+--------------------+      +--------------------+      +--------------------+
|  5. Audit Delivery | <--- |  4. Run Shadow Sim | <--- | Backtest rules     |
| Export inspectable |      | Flag deviations,   |      | alongside baseline |
| HTML / PDF reports |      | early exits        |      | historical trades  |
+--------------------+      +--------------------+      +--------------------+

Run behavioral diagnostics directly through the CLI:

bash
# Ingest raw transaction export vibe-trading --upload trades_export.csv # Execute cognitive diagnostics and synthetic backtest vibe-trading run -p "Analyze my trading behavior, extract my shadow strategy, and compare it with my actual trades"

The system maps out the trader's disposition effect, tendencies toward momentum chasing, loss-anchoring, and revenge trading. It then builds a synthetic algorithmic twin of those extracted trading rules, running it directly alongside the trader's real historical performance to quantify the cost of emotional execution deviations.

Protocol Extensibility: Model Context Protocol (MCP)

Vibe Trading functions natively inside contemporary agentic environments by integrating the Model Context Protocol (MCP).

                           +------------------------+
                           |  External MCP Clients  |
                           |  (Claude Desktop,      |
                           |   Cursor, OpenClaw)    |
                           +------------------------+
                                       |  (Calls 54 Tools)
                                       v
                     +====================================+
                     |        VIBE TRADING RUNTIME        |
                     +====================================+
                                       |  (Consumes Tools)
                                       v
                           +------------------------+
                           |  External MCP Servers  |
                           |  (e.g., IBKR Gateway,  |
                           |   Custom Data Feeds)   |
                           +------------------------+
  1. Vibe Trading as MCP Plugin: Exposes 54 specialized financial tools to upstream MCP hosts like Claude Desktop, Cursor, ClawHub, and OpenSpace.
  2. Vibe Trading as MCP Client: The internal engine can connect to third-party MCP servers, granting its agents direct, read-only hooks into execution engines like Interactive Brokers (IBKR) via local TWS/IB Gateway setups.

Infrastructure, Messaging, and the Fast Track

Beyond local interactive CLI execution, the platform embeds a modular FastAPI application layer paired with an instant messaging runtime engine. A centralized daemon communicates across 16 messaging protocols: WebSocket, Telegram, Slack, Discord, Matrix, WhatsApp, Signal, QQ/NapCat, WeChat/WeCom, Feishu/Lark, DingTalk, Teams, Email, and Mochat.

The underlying execution routes protect internal calls with an explicit API_AUTH_KEY for non-localhost environments, shielding multi-agent loops and automated research schedulers.

Recent Releases and Architecture Updates

  • IRR-AGL Governance Framework: Shipped validation harnesses featuring full schema fixtures, agent evaluation pipelines, and rigorous regression tracking.
  • Research Autopilot Phase 3: Closed the automated research cycle, letting agents iterate across hypothesis formulation -> signal-engine compilation -> backtest validation without manual prompts.
  • Expanded Connectivity: Native broker adapters now total 10 connectors, spanning Trading 212 (read-only), Dhan, Shoonya, Tiger, Longbridge, Alpaca, OKX, Binance, and Futu.
  • Windows Subsystem Adjustments: Hardened loader cache isolation paths and process execution flags across Windows environments.

Getting Started

Deploy the workspace via PyPI:

bash
pip install vibe-trading-ai

Initialize your workspace and fire an end-to-end backtest against live crypto markets:

bash
# Bootstrap local directory configuration vibe-trading init # Execute strategy backtest directly via CLI vibe-trading run -p "Backtest a BTC-USDT 20/50 moving-average strategy for 2024 and summarize return and drawdown"

The runtime connects out-of-the-box with a wide spectrum of LLM providers: OpenRouter, OpenAI, DeepSeek, Gemini, Groq, DashScope/Qwen, Zhipu, Moonshot/Kimi, MiniMax, Xiaomi MIMO, Z.ai, or locally hosted Ollama instances. Given the system's reliance on complex, multi-stage skill chains, selecting models with proven tool-calling performance ensures maximum stability.

The project source code and development tracks can be found on GitHub at https://github.com/HKUDS/Vibe-Trading.


Popular Reads