bitnerve v2.0.0

@decoded-cipher/bitnerve · Private repository

Overview

BitNerve v2 is a ground-up rebuild. In v1 the bot called an LLM every five minutes. In v2, BitNerve is an MCP server exposing trading tools, and Claude Code connects to it as the client, so the model runs on a Claude Code subscription with no API credits.

The engine now owns risk and execution. The model owns judgement. Every rule the model trades by is tied to measured evidence from past sessions.

Trading is still simulated. Market data is live from CoinSwitch, but no order reaches the exchange.

Live dashboard → https://bitnerve.arjunkrishna.dev

What's new

MCP architecture

  • Five tools: create_position, adjust_position, close_position, record_analysis, record_lesson
  • A 15-minute cycle: bun run brief builds one complete prompt, and claude -p reasons over it and acts through the tools
  • Accounts keyed on (provider, model_name), so several models can run side by side on separate balances

A watcher that executes between cycles

  • Polls 1-minute candles every 60 seconds and fills stops, cuts, take-profit rungs, break-even moves and trailing stops
  • Logs every fill to a new exit_events table
  • Records feed failures as data gaps and reports them in the next brief

ATR-based exit ladder

  • Two take-profit rungs (a third each), a break-even move that covers the round-trip fee, and a ratcheting trail on the final third
  • A stop is the disaster level; a cut is the level that invalidates the thesis. Both rest with the watcher

Risk constraints enforced in code

  • Per-position risk cap, halved during drawdown
  • No new entries past a drawdown from the 12h equity peak
  • Gross exposure cap and a rolling taker-fee budget
  • Symbol cooldown after repeated losses, re-entry guards, a range floor and a minimum hold
  • A rejected call names the exact level or size that would pass
  • Every limit can be overridden with an environment variable

A richer brief

  • Indicators computed on candle closes: Wilder ATR, MACD histogram, close location value, trend slope, extension and open interest
  • The direction gate reads the 1-hour trend
  • Taker fees charged on both legs and shown per trade
  • Columns that tested no better than noise were removed

Prompts built on evidence

  • plan.md holds the standing rules, each tagged with the sample size behind it
  • lessons.md collects observations during a run
  • Each session's database is backed up, and a proposed rule is tested against those backups before it's adopted

Operations

  • run-all.sh supervises both loops, and launchd plists keep them running across logout
  • The cycle holds a PID lock and treats an empty model response as a failed cycle

Dashboard

  • Dark theme with a monochrome palette, plus better chart scaling

License change

From v2.0.0, BitNerve is no longer MIT. All rights are reserved.

  • The source is published for reading only.
  • You may not use, copy, modify or distribute it, in whole or in part, without the author's prior written permission.
  • Forking the repository on GitHub doesn't give you any of those rights.
  • This is deliberately not an open source licence. See LICENSE.

Versions published before v2.0.0, including v1.0.0, stay under the MIT License for anyone who got them under those terms.

What this build is not

  • Paper trading only. Fills occur at the last traded price with no slippage, and funding is synced but not yet charged. The results are not a live track record.
  • Not financial advice. Anyone who connects it to a real exchange or trades real money with it does so at their own risk.

Full changelog: v1.0.0...v2.0.0