dsh-paper-trade
DiscoveredZero-dependency paper-trading CLI for the DeepSeek Harness ecosystem: virtual 100k, hash-chained tamper-evident trade ledger — paper only, never a real brokerage.
dsh-paper-trade
痛点:想练交易的人直接上真钱,亏掉的是学费。 解法:10 万美元虚拟盘 + 哈希链防篡改账本 + 机器强制纪律(无报价拒单、现金不足拒单),只练一条——下单前写理由、成交后留证据。 证据:14 个测试全绿,CI 绿,awesome-dsh 已收录,零第三方依赖。
A zero-dependency paper-trading CLI for the DeepSeek Harness ecosystem: a virtual $100,000 account, real daily stock quotes, and every trade recorded in a hash-chained, tamper-evident ledger. It exists to train one discipline — write the reason before the order, leave the evidence after the fill — without ever touching real money.
MIT · pure Python standard library · by Taiji Whale (太极鲸)
Why it exists
The DSH ecosystem has almost no financial tooling. Most people jump straight to a real brokerage and burn real money. This tool turns "evidence-based trading discipline" into the smallest runnable system:
- Paper only — no brokerage integration, no real funds. The red line is baked into the design.
- Hash-chained ledger — every trade record carries the hash of the previous record; one command verifies nothing was altered.
- Machine-enforced discipline — reject on insufficient cash, reject on insufficient position, reject when no quote exists, $1 virtual commission per trade, $20 minimum notional.
- Zero dependencies — free Yahoo daily bars with a local CSV cache fallback. No third-party libraries.
Install
git clone https://github.com/yangfei222666-9/dsh-paper-trade.git
cd dsh-paper-trade
python3 paper_trade.py status
Requires Python 3.9+. No pip install step: the entire codebase uses only the standard library.
Usage
python3 paper_trade.py quote AAPL # latest close (Yahoo; cached fallback)
python3 paper_trade.py buy AAPL 10 "reason" # buy: cash check + commission
python3 paper_trade.py sell AAPL 5 "reason" # sell: position check
python3 paper_trade.py status # positions + unrealized P/L
python3 paper_trade.py report # JSON snapshot (weekly review)
python3 paper_trade.py chain-check # verify ledger integrity
| Command | Purpose |
|---|---|
quote SYM | Latest close for a ticker |
buy SYM <shares> <reason> | Buy (cash validation + $1 fee) |
sell SYM <shares> <reason> | Sell (position validation + $1 fee) |
status | Cash, positions, unrealized P/L, total assets |
report | Timestamped JSON snapshot under snapshots/ |
chain-check | Hash-chain integrity verification |
The reason argument is not optional decoration — the ledger records it with the trade. If you cannot state a reason, the trade should not happen.
The hash-chained ledger
Every trade appends one line to trades.jsonl:
{"ts": "2026-08-20 09:15:00", "action": "buy", "ticker": "AAPL", "shares": 10,
"price": 100.0, "px_date": "2026-08-19", "fee": 1.0, "reason": "…",
"prev": "<first 16 hex of previous hash>", "hash": "<sha1[:16] of this record>"}
- Each record's
hashissha1over its own canonical body (sorted keys, excludinghash). - Each record's
prevlinks to the previous record's hash; the head hash is stored inportfolio.jsonaschain. chain-checkrecomputes every hash from the file and reports the first break point.
Ledger rules: append-only; never rewritten; tampering is detectable, not preventable — the goal is evidence, and the evidence must survive a casual edit.
Design red lines (never change)
- Paper only. Never connect a real brokerage, never place a real order.
- No return promises. This is a discipline trainer, not an advisor.
- No data, no trade. A missing quote rejects the order instead of guessing a price.
- The ledger is append-only. Established records are never rewritten.
Tests
Stdlib-only unit tests (hash-chain integrity, tamper detection, trade accounting):
python3 -m unittest discover -s tests -v
CI runs the same suite on Python 3.9–3.13 (see .github/workflows/ci.yml).
Files
prices.py— quote engine (Yahoo daily bars + CSV cache)paper_trade.py— trading CLI + hash-chained ledgerpaper_data.py— dashboard data generatorwatchlist.json— example watchlisttests/— stdlib unit tests
Relationship to DeepSeek Harness
The tool runs independently of DSH (any Python 3.9+ environment works). It originated as the investing lane of the "Taiji Whale" butler system inside the DSH ecosystem, and was split out to fill the financial-tooling gap. Roadmap: a DSH plugin panel and a strategy backtest layer.
License
MIT © Taiji Whale (太极鲸)
Comments
Loading…
Similar plugins
by GongYuanCaiJi
DeepSeek Harness 插件:零依赖的 HTML 幻灯片技能包——动画丰富的演示文稿与 PPT 转换(移植自 frontend-slides)
★ 0
MIT
JavaScript
Aug 15, 2026
dsh plugin --profile web add dsh-frontend-slidesby shinjiyu
Zero-config web_search for DeepSeek Harness when you are not on the official DeepSeek API.
★ 4
MIT
TypeScript
Aug 15, 2026
dsh plugin --profile web add dsh-plugin-searchby Arun1016
Account balance and per-session cost pill for DeepSeek Harness (dsh) web GUI: official peak/off-peak pricing, per-model breakdown, no credentials stored.
★ 0
MIT
TypeScript
Oct 9, 2026
dsh plugin --profile web add dsh-costby gst20060726
Zero-token on-demand translation for the DeepSeek Harness Web GUI — hover a block or drag-select text to translate in place; nothing auto-translates, no LLM calls, text never leaves your machine. | 零 token 按需翻译:悬停或框选才翻,绝不自动翻页,文本不出本机。
★ 0
MIT
JavaScript
Oct 1, 2026
dsh plugin --profile web add dsh-auto-translateby skillre
Zero-core-change vision capability for DeepSeek Harness: the describe_image tool + profile bundle, installable via 'dsh plugin add'
★ 0
MIT
TypeScript
Aug 15, 2026
dsh plugin --profile web add dsh-bundle-visionby tianyagk
DeepSeek Harness (DSH) web plugin: 盯盘 market-dashboard sidebar tab — three quote strips with hover intraday charts, watchlist with industry alpha, ledger-driven portfolio P&L, A-share boards & detail drawer, host-side Eastmoney relay + read-only agent tools.
★ 3
MIT
TypeScript
Oct 11, 2026
dsh plugin --profile web add dsh-tradewatcher