Skip to content

Latest commit

Β 

History

68 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐺 Wolf Of Vibe Street

Wolf Of Vibe Street

A disciplined, emotionless, paper-first AI/agent crypto trading bot. Built in one night, vibe-coded together with Claude Code.

CI tests python


What this is

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).


Quick start

One command:

./dev-start.sh

Opens 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.


Architecture

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.


Layout

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.


What you can do β€” entirely from the browser

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

Documentation

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

Setup (first time)

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.sh

To run the same steps as GitHub Actions (ruff, format check, pytest with coverage): ./scripts/check-ci.sh.

Open http://localhost:8501.

Optional config (env vars)

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.

Pause / kill switch

touch data/state/KILL_SWITCH       # bot pauses (doesn't exit)
rm   data/state/KILL_SWITCH        # bot resumes

Or use the sidebar toggle.


Tech stack

  • Python 3.12+ with uv for 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

The journey

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.


License

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.

About

🐺 Wolf Of Vibe Street β€” paper-first AI/agent crypto trading bot, vibe-coded in one night with Claude Code. Python + Streamlit dashboard + LLM evaluator. Boring + alive > clever + dead.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages