🐳 dsh-quant — The Everything-Plugin Quant OS
dsh-quant open-source quant research hero
📣 Announcement archive: 2026-09-01 X open-source launch copy
🌐 Site: https://dsh-quant-site.pages.dev · ✅ Listed in awesome-dsh-plugin (one-click install via dsh-market)
AI-native & DSH-native quant toolkit for every quant aspect — 59 tools · 6 domains
(data / alpha / ML / risk / execution / ecosystem) · one end-to-end PDAT→PET
research pipeline. Methods open, secrets internal.
🧩 Core Philosophy: Everything is a Plugin (quant edition)
dsh's philosophy is everything is a plugin; dsh-quant brings it to quant —
open-sourcing the internal five-team paradigm (PDAT → PAAT → PCPT → PRT → PET)
as five pluggable modules:
data plugin dsh-data market data / sources / quality ← plug in Binance or your own data
alpha plugin dsh-alpha indicators / factors / eval ← write your own alpha (internal alpha stays private)
model plugin dsh-ml backtests / ML/DL/RL framework ← train your own models (internal research stays private)
risk plugin dsh-risk VaR / drawdown / options / bonds ← set your own risk limits
exec plugin dsh-execution sim execution / fund / report ← build your own trading system (paper or live)
- What's open is the paradigm: how modules compose, how contracts are defined
(null alignment / no look-ahead / hand-computed tests), how results are validated —
not the internal secrets
- You fill it in: product power = UI + strategies + data interfaces + DL/RL
models + trading-system building, all self-assembled, all pluginized
- Infinite self-evolution: fill the framework with your modules → run paper/live
→ feed the ecosystem back — that's dsh-quant
Plugin call for proposals: Issue #27 (five modules × many plugins) — PDAT plugins, PET plugins, anything you can imagine 🐋
🤖 AI-Native Is Deliberate (design statement)
dsh-quant's primary consumer is the agent (the model), not the human — a
deliberate choice from day one:
- Tool schemas are injected into the system prompt — every contract (args /
outputs / alignment rules) is written from the model's perspective
- Equal-length null alignment — outputs match input length; leading window
positions are
null, so the model aligns by index and never pads
- Canonical JSON + render separation — machines read structure, humans read prose
- All isConcurrencySafe — pure functions, no shared state; agents can call all
59 tools in parallel without interference
- Skill layer —
skill/quant-research lets the model load the workflow itself
Full statement: Issue #14 "AI-native is deliberate".
🐍 Why Almost No Python?
A common question: a quant project without .py files? Answer: 0 Python files,
21 TypeScript source files, zero runtime dependencies — deliberate:
- dsh-quant is a dsh plugin running inside the harness's Node runtime: same
process as the agent, composable by the Loader, reversible registration (HMR-safe)
— TypeScript is the only natural choice
- Where Python is needed (akshare / tushare / baostock), use the channel knowledge
base (
quant_data_guide, 15 channels): dsh ships shell / subprocess capabilities,
so the agent decides whether to spawn Python — dsh-quant carries no runtime
- All numerical methods (indicators / backtests / options / bonds) are pure
functions with hand-computed baselines: zero deps, offline-verifiable,
npm test green anywhere
One goal: build the most usable AI-native quant repo 🐋
59 quant_* tools · 6 domains · 215 unit tests · zero runtime deps. Full positioning: pinned Issue #9.
🤖 For visiting agents
Agents landing on this repo: start at AGENTS.md (root-level, auto-read
by Copilot / Claude Code / dsh), then the closed-loop example
plugin/CASE_STUDY.md or Discussion #38,
and the one-glance contract mcp/AGENT_GUIDE.md.
Quick Install (dsh users)
npm i dsh-quant
Add one line to your cordis.yml:
- name: 'dsh-quant'
59 tools auto-register — indicators / backtests / factors / risk / fund simulation /
ecosystem metrics out of the box. One quant_research_pipeline runs the whole
PDAT→PET chain. ML/DL knowledge: docs/ML_GUIDE.md;
executable demo: npx tsx demos/ml-workflow.ts.
🚀 Product Experience: Three Minutes to a Full Quant Pipeline
Right after install, experience the complete PDAT→PET flow (BTC public data +
simple strategy + backtest + paper trading):
data(quant_market_fetch) → quality(quant_data_quality) → factors(quant_factor_evaluate)
→ backtest(quant_backtest) → metrics(quant_metrics) → risk(quant_risk)
→ drawdown(quant_drawdown) → paper sim(quant_execute_sim) → fund sim(quant_fund)
→ report(quant_report)
One-liner: quant_research_pipeline(symbol=BTCUSDT, limit=120) returns everything
in one call.
Then plug your own plugins into each module (data sources / alpha / models /
risk / execution — everything is a plugin, proposals at Issue #27).
Five-step walkthrough with commentary: docs/ONBOARDING.md ·
Agent one-glance guide: mcp/AGENT_GUIDE.md
🖥️ UI Workbench (dsh-quant-ui)
dsh-quant UI
dsh-quant-ui: candlesticks + MA
overlays + trade markers, equity curves, fund NAV / management-fee / performance-fee
cards, metric selector — plus a swimming chibi whale 🐋 (click the title 3 times).
Live demo: https://dsh-quant-ui.pages.dev
⌨️ CLI (dsh-quant terminal)
Zero-dependency readable terminal (pure Node + ANSI, same philosophy as the
P-Research CLI). Browse the research columns and live market data without a
browser:
node cli/main.mjs repo # 59 tools · 6 domains
node cli/main.mjs history # 53 firm archives index
node cli/main.mjs history citadel # one firm's archive (rendered)
node cli/main.mjs history --reports # ANALYSIS / TIMELINE / LINEAGE / BANK_LINEAGE
node cli/main.mjs history --search 高频 # cross-archive search
node cli/main.mjs kline BTCUSDT --limit 20 # colored OHLC table + stats
node cli/main.mjs browse # interactive TUI: arrow-key firm browser
After npm install -g ., the commands shorten to dsh-quant repo,
dsh-quant history citadel, etc.
Tools
| Tool | Parameters | Canonical output | First valid index |
|---|
quant_data_compare | dataType (e.g. "financials"/"daily bars") | { dataType, channels: [{ name, cost, covers, bestFor }] } (covering first) | — |
quant_data_advice | dataType + budget (free/low/institutional) + purpose (research/backtest/official) | { recommendations: [{ rank, name, reason }] } (decision-tree ranked) | — |
quant_series_stats | values: number[] | { count, mean, std, min, max, median, skew, kurtosis, autocorr1, annualizedVol, totalReturnPct } | — (first step after fetching) |
quant_var_backtest | returns + varSeries + confidence=0.95 | { failures, expected, lrStat, pValue, passed, periods } (Kupiec POF test) | — (the ground truth for VaR models) |
quant_option | spot + strike + timeToMaturity + riskFreeRate + type + exactly one of volatility/price | { price, impliedVolatility, delta, gamma, vega, theta, rho, … } | — (Optiver-inspired: BS pricing + five greeks + IV solve) |
quant_volatility | close: number[] + annualization=252 | { annualized, perPeriod, n, logReturns(aligned) } | — (realized vol; the RV-vs-IV research entry) |
quant_bond | couponRate + periodsToMaturity + paymentsPerYear? + exactly one of ytm/price | { price, yieldToMaturity, macaulayDuration, modifiedDuration, convexity, dv01, … } | — (FICC link: pricing/duration/convexity/DV01, textbook discounting) |
quant_drawdown | equity: number[] | { underwater(aligned), maxDrawdownPct, currentDrawdownPct, periods(peak/trough/recovery/depth/duration), ongoing } |
Typical chain (model's view)
quant_market_fetch(symbol: BTCUSDT, interval: 1d, limit: 100)
→ take close → quant_sma / quant_ema / quant_rsi / quant_macd / … → quant_backtest
Verified live: real Binance daily bars → indicators → backtest (fast 5 / slow 20) end to end.
Backtest contract
- Dual-MA crossover: buy all-in when fast SMA crosses above slow SMA, liquidate when
it crosses below; signals confirm on bar
i and fill at bar i+1 close
(no look-ahead).
- Fees are charged on both sides of notional (
feeRate per side).
- Open tail position: the last trade's
exitIndex/exitPrice/returnPct are null.
position and equityCurve match input length; equity is normalized (starts at 1);
Sharpe is annualized assuming daily frequency (√365).
Alignment conventions
- All outputs are equal-length with inputs; leading unwindowed positions are
null — the model aligns by index, no padding needed.
- Empty series or
window > series length is a legal result (all null),
not an error.
- Non-finite numbers (NaN/Infinity) are rejected at the registry's lossless-JSON
argument snapshot layer (the model's JSON boundary) and never reach
execute.
- Constraints (window ≥ 1 integer, macd fast < slow, atr arrays equal length,
multiplier > 0) are hand-checked in
execute; thrown errors become isError
results via the registry.
Contract (defineTool)
- Arguments use the unified schema DSL, validated by
defineTool before execute
(types / required / integers).
execute returns only the canonical JSON value; output.render produces the
model-facing prose.
- Every tool is
isConcurrencySafe: true — pure functions, no shared state, no side
effects, parallel-schedulable.
- Registration is a reversible effect:
ctx.tools.register returns a disposer;
fiber disposal unregisters.
Model Experience
What the model sees
Each tool's name/description/JSON schema is injected into the system-prompt assembly
(ctx.systemPrompt.tools()). Descriptions state the alignment rules (which head
positions are null), so the model never guesses.
Token impact
Each tool costs one fixed schema block; call results are charged by rendered content.
The null-alignment design avoids repeated padding requests from the model.
KV cache impact
The schema prefix is stable (reused as long as the tool set and order are unchanged);
results append after the reusable prefix.
Release history (NEWS)
| Version | Date | Notes |
|---|
| 0.91.0 | 2026-09-11 | QRT Deep-mode full due diligence — nine-section rewrite (AUM chain to $50bn, 2025 flagship +30%, QFII+WFOE not QDLP, Dao 98% cumulative since 2022-11, Jaillon premise removed), 5 research dossiers |
| 0.90.0 | 2026-08-23 | HIGHFLYER_SPECIAL — dual-engine king (quant funds AGI, DeepSeek $45B, Wenfeng world AI-richest), 50 reports total |
| 0.89.0 | 2026-08-23 | UBIQUANT_SPECIAL — China AI-transform deep-dive (WorldQuant lineage, IQuest-Coder 40B open source, capsizing paradigm), 49 reports total |
| 0.88.0 | 2026-08-22 | quant_trading_cost + quant_rebalance_schedule — cost gate + drift/cost optimizer (59 tools, 215 unit) |
| 0.87.0 | 2026-08-22 | Validation tools ×4 — factor_correlation / deflated_sharpe / stress_test / parameter_sensitivity (57 tools, 210 unit) |
| 0.86.0 | 2026-08-22 | Bridges ×3 — quant_layered_backtest / quant_trade_quality / quant_attribution (53 tools, 200 unit) |
| 0.85.0 | 2026-08-22 | quant_ic_decay + quant_portfolio_optimize (50 tools, 193 unit) |
| 0.84.0 | 2026-08-22 | AI-infra data modules ×4 — quant_data_pit / quant_channel_guide / CLI quality / chain-loop (48 tools, 186 unit) |
| 0.83.0 | 2026-08-22 | quant_factor_neutralize repaired + 5 baselines (46 tools, 179 unit) |
| 0.82.0 | 2026-08-22 | TYO_QUANT — Tokyo yen-rates-center census (~9 firms, $30M talent war, Capula stronghold), 48 reports total |
| 0.81.0 | 2026-08-20 | CHI_QUANT — Chicago market-making city census (~14 firms, exchange-gene, UChicago pipeline, Citadel exit), 47 reports total |
| 0.80.0 | 2026-08-20 | QUANT_PEOPLE_CN + QUANT_PEOPLE_GLOBAL — 101st-release quant headcount estimates (CN ~30-50k, 4-city ~25-38k, global ~80-120k), 46 reports total |
| 0.79.0 | 2026-08-20 | QUANT_WORLD_MAP — 100th-release special: global quant world map (5-city axis, 9 paths, talent trees, 4-city census synthesis), 44 reports total |
| 0.78.0 | 2026-08-20 | NYC_FOREIGN_QUANT — New York hedge-fund-universe census (~28 firms, 12 HQs, CT suburb dark core, NY-LDN twin), 43 reports total |
| 0.77.0 | 2026-08-20 | LDN_FOREIGN_QUANT — London global-quant-hub census (~30 firms, 12 HQs, four-city comparison), 42 reports total |
Full records: NEWS.md and CHANGELOG.md.
Known limitations & roadmap
- Market coverage is crypto-first: Binance / OKX / Bybit public APIs (automatic
fallback), no credentials; A-shares go through the channel knowledge base (akshare
et al. as future providers).
- Backtests are a built-in strategy family: dual-MA / Bollinger breakout / RSI
reversion / portfolio rebalancing / grid search; custom strategy callbacks are the
future route.
- presentCall/presentResult not customized: indicator results have no file /
terminal / diff semantics; UI falls back to generic cards.
- Market tools need network: live cases live in verify.ts; offline indicator /
backtest cases are unaffected.
Domain layout (PDAT→PET pipeline mapping)
src/dsh-data/ data (PDAT): 3 exchanges, 15 channels, quality/annotation, resample
src/dsh-alpha/ alpha (PAAT): 12 indicators + factor eval/combine (alphalens methodology)
src/dsh-ml/ portfolio (PCPT): strategy backtests + portfolio + metric catalog
src/dsh-risk/ risk (PRT): VaR/CVaR/Beta/Alpha/IR + Kupiec test + options + bonds
src/dsh-execution/ delivery (PET): chart data plane, fund sim, research report (no live trading)
src/dsh-community/ ecosystem (unique to the open side): GitHub/npm data + influence pulse
The boundary: data and conclusions stay internal; tools and methods ship to
dsh-quant — no alpha, no production strategies, no live-trading engineering, but
frameworks, indicators, factor evaluation, UI and demos. See pinned Issue #9.
Quick start (after fork/pull)
npm ci && npm run build && npm test # offline full tests (215 unit + 4 Loader)
npm run test:verify # live market integration (needs network)
npm run gen:tools # regenerate mcp/tools.json
Build & use
# build lib/ (tsc, NodeNext ESM; ships .js + .d.ts)
cd quant-indicators && tsc -p tsconfig.json
# use in dsh: add one line to cordis.yml
# - name: 'dsh-quant'
# (the Loader resolves the package exports → lib/index.js from node_modules)
Verification
# pure-function numeric correctness + market parsing + backtests (215 cases, node:test, zero deps)
cd deepseek-harness && pnpm exec tsx --test ../quant-indicators/tests/*.spec.ts
# REAL-composition: cordis.yml booted through the real Loader (registration visible / pipeline / isError / HMR-safety)
cd deepseek-harness && pnpm exec tsx --test ../quant-indicators/tests/loader-composition.spec.ts
# harness integration (schemas → execution pipeline → isError → live fetch→indicators→backtest end-to-end)
cd deepseek-harness && pnpm exec tsx ../quant-indicators/verify.ts
# consumer simulation: built lib loaded through real node_modules resolution (simulates post-install)
cd deepseek-harness && pnpm exec tsx ../quant-indicators/consumer-test/boot.ts
⭐ Support
If dsh-quant helps your research, a ⭐ makes the project visible to more dsh users.
dsh whale trading on a holographic screen
This whale stands for DeepSeek Harness (dsh) — trading on its holographic screen 🐋
Issues / PRs / discussions welcome; share your domain perspective in
Discussion #10. 🐋
Ecosystem infrastructure: quant ecosystem directory ·
ecosystem playbook · ecosystem map Discussion #11
Research columns: quant-history (firm archives) · quant-repo (open-source special)
Plugin library (five slots × external repos & MCPs): plugin/
🤝 Contribute & maintain
- Want to add a plugin / data source / learning material? → Issue #109(插件征集) — data / risk / execution plugins, ML-DL & alpha learning resources all welcome
- Filing a bug / feature / help-wanted issue? → ISSUE_GUIDE.md (agent-friendly rules)
- Sending a PR? → CONTRIBUTING.md (dev loop + design contract)
- Maintainer view (how we review & merge): MAINTAINING.md
Every issue is a future PR; every contributor is a future maintainer. We review fast and merge small PRs quickly — credit goes into release notes + the author section. 🐳
👤 About the author
Pengyi Peng — AI-native builder with a mathematics & quant-research
background, building this project as an open research sandbox.
- WorldQuant MAPC 2024 · Global 11 / 850 · UK 1 — official Credly badge
- WorldQuant IQC 2024 · Global 232 / 34,142 · UK 5 (finalist)
- dsh-quant: 59 tools · 6 domains · 215 unit tests · 110+ automated releases
- Quant-industry research: 95 firm archives + 52 research reports (in
quant-history/)
- GitHub · LinkedIn
Methods open, secrets internal — the author's research is public, the strategies are not. 🐳