A disciplined, emotionless, paper-first AI/agent crypto trading bot. Built in one night, vibe-coded together with Claude Code.
A real, working algorithmic trading bot that:
- Pulls live market data from Binance (CCXT, public REST).
- Generates trading signals with EMA crossover + ATR stops (the boring baseline).
- Filters signals through Claude as an LLM evaluator (S-33 hybrid pattern).
- Sizes positions with fixed-% risk + hard caps (kill switch, daily DD halt).
- Executes paper orders with realistic commission + slippage modeling.
- Logs every decision to an append-only SQLite audit trail.
- Surfaces it all in a dark-themed dashboard you start/stop from the browser.
Mantra (from memory-bank/@design-doc.md): "Boring + alive > clever + dead."
Paper trading by default. Real money uses Kraken with several interlocks (LIVE_TRADING, session gate, kill switch). See the operator checklist: docs/GO_LIVE.md β from Kraken KYC to dry-run, calibration (first 30 fills), and TRADERBOT_TRADE_MODE=live promotion after the dashboard button. At the end of that doc, Code vs operator β what's left spells out what the repo already covers vs what only you can do (KYC, keys, money, live validation).
External research (not dependencies): comparable AI-trading projects are listed in knowledge.md Β§9.5 and in the dashboard sidebar Referens-repos (AI-trading).
One command:
./dev-start.shOpens http://localhost:8501. Click Start loop in the sidebar. Done β bot is running.
For the full setup (uv, Python 3.12+, optional Telegram alerts), see below.
Binance API ββΊ data/binance.py ββΊ Parquet βββ
βββΊ features ββΊ strategies ββΊ signals
News (TBD) ββΊ β¦ βββββββ β
βΌ
risk caps βββββββΊ Executor βββββββΊ PaperBroker
β
βΌ
decision_log (SQLite, append-only)
β
βββββββββββββββββββββΌββββββββββββββββββββ
βΌ βΌ βΌ
dashboard text report Telegram alerts
Five separate concerns. The decision log is the source of truth. The dashboard reads it. The live loop writes to it via the executor.
traderbot/
βββ data/binance.py OHLCV fetcher (CCXT)
βββ data/backfill.py Paginated historical pulls
βββ data/store.py Parquet save/load
βββ features/compute.py EMA / RSI / ATR / vol regime β all causal
βββ strategies/
β βββ baseline_ema_cross.py Trivial EMA crossover (the floor)
β βββ mean_reversion_rsi.py RSI mean-reversion baseline
β βββ conviction_filtered.py Deterministic convβ₯threshold filter (backtest stand-in for LLM filter)
β βββ llm_filtered.py Wraps any strategy with an LLM evaluator (S-33)
βββ agents/llm_evaluator.py Claude evaluator + RuleBased mock
βββ signals/types.py Signal dataclass (validates: buy β stop required)
βββ risk/
β βββ sizing.py Fixed-% risk, hard cap 1%
β βββ caps.py Kill switch + DD halts + max positions/notional
βββ execution/
β βββ broker.py Order/Fill/Position + Broker Protocol
β βββ ccxt_paper.py PaperBroker (sim fills + slippage + fee)
β βββ ccxt_kraken.py Kraken (optional; dry-run + userref idempotency)
β βββ reconcile.py Broker vs log on startup
β βββ runner.py Executor β bar-driven, single-position
βββ backtest/
β βββ engine.py Walk-forward, cost-aware
β βββ metrics.py Sharpe / Sortino / max DD / BE_WR
β βββ compare.py Multi-symbol side-by-side + `STRATEGIES` registry
βββ docs/
β βββ GO_LIVE.md Operator checklist (Kraken, soak, promotion)
βββ memory/decision_log.py SQLite append-only (UPDATE/DELETE blocked by triggers)
βββ workers/live_loop.py Polls Binance β writes new bars β calls Executor
βββ tools/notifier.py Telegram + NoOp
βββ tools/loop_control.py Start/stop/status the loop subprocess
βββ tools/env_config.py .env reader/writer (preserves other lines)
βββ ui/views.py Pure summary functions (testable, no Streamlit)
βββ ui/dashboard.py Streamlit page
βββ ui/report.py Text-mode CLI summary
Read CLAUDE.md for operating rules, memory-bank/@architecture.md for invariants, memory-bank/@design-doc.md for what + why.
| Action | Where |
|---|---|
| Start / stop the bot | Sidebar β LIVE LOOP |
| Pause without stopping | Sidebar β Kill switch |
| P&L, positions, equity, trade history (25 rows) | DESK tab |
| TAPE β full decision log in a dense, filterable data grid (Excel-lik) | TAPE tab |
| MAP β ASCII + mermaid system map of the whole stack | MAP tab |
| Multi-symbol backtest + strategy compare (EMA, mean-reversion, + conviction-filter variants) | COMPARE tab |
| Soak health | Top of DESK (green / yellow / red banner) |
| Go live (dry-run β real) + calibration / promote | Sidebar expanders (see docs/GO_LIVE.md) |
| Telegram, Kraken keys, LLM filter, launchd | Matching sidebar expanders |
| Research links (Vibe, TradingAgents, β¦) | Sidebar β Referens-repos (AI-trading) |
| Loop stdout | DESK β Activity β LOOP STDOUT |
| Reset for a clean soak | Sidebar β RESET FOR FRESH SOAK |
| Doc | Use |
|---|---|
CLAUDE.md |
How we work β rules, test policy, file map |
knowledge.md |
Domain + Β§9 cross-repo patterns + Β§9.5 curated links |
experiences.md |
Pitfalls (P-) and success factors (S-) |
docs/GO_LIVE.md |
Step-by-step from KYC to first real order |
memory-bank/@architecture.md |
Invariants and layout |
JOURNEY.md |
Build diary |
git clone https://github.com/dotsystemsdevs/wolf-of-vibe-street.git
cd wolf-of-vibe-street
uv sync
cp .env.example .env # fill in TELEGRAM_BOT_TOKEN if you want alerts
uv run pytest
./dev-start.shTo run the same steps as GitHub Actions (ruff, format check, pytest with coverage): ./scripts/check-ci.sh.
Open http://localhost:8501.
| Var | Default | Purpose |
|---|---|---|
TRADERBOT_SYMBOL |
BTC/USDT |
What to trade |
TRADERBOT_STRATEGY |
baseline_ema_cross |
Strategy id (see backtest/compare.py STRATEGIES) |
TRADERBOT_TIMEFRAME |
1h |
Bar size |
TRADERBOT_INITIAL_CASH |
10000 |
USD |
TRADERBOT_RISK_PCT |
0.005 |
0.5 % per trade (cap 1 %) |
TRADERBOT_POLL_INTERVAL_S |
30 |
Binance polling cadence |
TRADERBOT_BROKER |
paper |
paper or kraken (needs LIVE_TRADING=true) |
TRADERBOT_TRADE_MODE |
β | On Kraken: unset = calibration caps; live = full caps after promotion |
KRAKEN_DRY_RUN |
true |
With Kraken: synthetic fills until you disable |
TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID |
β | Both required for Telegram alerts |
ANTHROPIC_API_KEY |
β | For Claude LLM evaluator + optional TRADERBOT_USE_LLM_FILTER |
Copy .env.example to .env and extend as needed. Full go-live env story: docs/GO_LIVE.md.
touch data/state/KILL_SWITCH # bot pauses (doesn't exit)
rm data/state/KILL_SWITCH # bot resumesOr use the sidebar toggle.
- Python 3.12+ with
uvfor package management - CCXT for exchange APIs (Binance OHLCV; Kraken when
TRADERBOT_BROKER=kraken) - pandas + pyarrow for data + Parquet
- SQLite for the decision log (append-only via triggers)
- Streamlit + Plotly for the dashboard
- Anthropic SDK for the Claude evaluator
- pytest + ruff + GitHub Actions CI
This bot was built in one night, ~26 sessions, from an empty folder to a running paper-trading system. See JOURNEY.md for the day-by-day diary.
MIT β do whatever you want, but don't blame me if the bot loses (paper) money.
It is not financial advice. It is paper trading. Caution > cleverness.
