Skip to content

JeffMboya/swarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swarm

AI-powered market sentiment simulator. Feed in a news headline or market event and watch 15 investor personas — hedge fund managers, day traders, value investors, quants, and more — each react independently and in parallel. Their aggregate response produces a directional signal, confidence score, and list of assets to watch.

Inspired by MiroFish — the multi-agent simulator built by Chinese quant student Guo Hanjiang that went viral with 13,000+ GitHub stars in early 2026.

$ swarm "Fed raises rates by 50bps unexpectedly"

Swarm Analysis
Event: Fed raises rates by 50bps unexpectedly
Running 10 agents...

  Retail Investor        ▼ bearish   [SELL]  This will crush my growth stocks.
  Day Trader             ▲ bullish   [BUY ]  Volatility spike — I'll scalp the move.
  Hedge Fund Manager     ▼ bearish   [SELL]  Repricing risk assets across the book.
  Value Investor         ◆ neutral   [HOLD]  Good companies still compound at any rate.
  Growth Investor        ▼ bearish   [SELL]  Higher rates crush DCF valuations hard.
  Bond Trader            ▲ bullish   [BUY ]  Short duration outperforms. Rotate now.
  Options Trader         ▲ bullish   [BUY ]  IV is exploding. Selling premium.
  Macro Analyst          ▼ bearish   [SELL]  Dollar strengthens, EM under pressure.
  Short Seller           ▼ bearish   [SELL]  Zombie companies die at these rates.
  Momentum Trader        ▼ bearish   [SELL]  Trend just flipped. Follow the tape.

──────────────────────────────────────────────────
  ████████░░░░░░░░████████████████████████████████
  ▲ bullish 30%   ◆ neutral 10%   ▼ bearish 60%

  Signal:     BEARISH  (moderate confidence, 6.4/10)
  Agents:     10 / 10 responded
  Watch:      SPY  TLT  QQQ  DXY  GLD  BTC
──────────────────────────────────────────────────

How it works

Each agent is given a detailed persona — their investment style, natural bias, and time horizon. When you submit an event, all agents are called simultaneously via the Claude API. They react independently without seeing each other's answers, mimicking how real market participants actually process news. The aggregate produces emergent behavior that no single model call could replicate.

Event ──▶ [Retail Investor]  ──▶ bearish / 7 / "sell growth"
      ├──▶ [Day Trader]       ──▶ bullish / 8 / "volatility play"
      ├──▶ [Hedge Fund]       ──▶ bearish / 6 / "repricing risk"
      ├──▶ [Value Investor]   ──▶ neutral / 4 / "hold forever"
      ├──▶ ...                ──▶ ...
      └──▶ [Quant]            ──▶ bearish / 7 / "regime shift"
                                        │
                                   [Aggregator]
                                        │
                              Signal + Confidence + Assets

Install

Option 1 — Download a binary (no Go required)

Go to the Releases page and download the binary for your platform:

Platform File
macOS (Apple Silicon) swarm-darwin-arm64
macOS (Intel) swarm-darwin-amd64
Linux x86_64 swarm-linux-amd64
Linux ARM64 swarm-linux-arm64
Windows x86_64 swarm-windows-amd64.exe
curl -L https://github.com/JeffMboya/swarm/releases/latest/download/swarm-linux-amd64 -o swarm
chmod +x swarm
sudo mv swarm /usr/local/bin/

Option 2 — Install with Go

go install github.com/JeffMboya/swarm@latest

Option 3 — Build from source

git clone https://github.com/JeffMboya/swarm
cd swarm
go build -o swarm .
mv swarm ~/.local/bin/

Requirements

Requirement Notes
ANTHROPIC_API_KEY Required. Get one at console.anthropic.com.
export ANTHROPIC_API_KEY=sk-ant-...
# Add to ~/.zshrc or ~/.bashrc to set permanently

Usage

swarm "market event or headline"
swarm --agents 15 "event"    # use more agents (max 15, default 10)
swarm -v "event"             # verbose: stream each agent's response as it arrives

Examples

swarm "Apple misses earnings by 15%, guidance cut"
swarm "US CPI comes in at 2.1%, below the 2.5% estimate"
swarm "China imposes new semiconductor export restrictions"
swarm "Bitcoin ETF approved by SEC"
swarm "OpenAI releases GPT-5, claims AGI threshold reached"
swarm --agents 15 -v "US enters recession, GDP contracts 2 quarters"

Flags

Flag Default Description
--agents N 10 Number of agents (1–15)
-v off Stream results as they arrive instead of waiting for all

The 15 agents

Agent Style
Retail Investor Emotional, headline-driven, holds index funds
Day Trader Pure technicals, momentum, uses leverage
Hedge Fund Manager Macro-aware, risk-adjusted, moves markets
Value Investor Buffett-style, intrinsic value, ignores noise
Growth Investor Tech-focused, high P/E tolerance, rate-sensitive
Bond Trader Yield curves, duration risk, inflation expectations
Options Trader Volatility and skew, IV spikes, gamma positioning
Macro Analyst Geopolitics, currency flows, commodity cycles
Short Seller Contrarian, looks for fraud and overvaluation
Momentum Trader Trend-following, systematic, fundamentals irrelevant
Quant Factor models, statistical arbitrage, signal detection
Risk Manager Tail risk, VaR, drawdown limits
Central Bank Watcher Fed policy, dot plots, monetary regime
Emerging Market Investor Dollar strength, EM flows, political risk
Crypto Native Risk-on/risk-off, liquidity cycles

Disclaimer

This tool is for educational and research purposes only. It does not constitute financial advice. The sentiment signals produced are simulated AI responses, not predictions of actual market behavior. Do not make investment decisions based on this tool's output.


License

MIT

About

Multi-agent market sentiment simulator - feed in a news event, watch 15 investor personas debate it, get a directional signal

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages