From 0851055979fa583fbc59c9ff8192e42d86e0435c Mon Sep 17 00:00:00 2001 From: Reuven Date: Thu, 22 Jan 2026 00:33:12 -0500 Subject: [PATCH] docs(readme): add Neural Trader AI trading system section - 4 core AI/ML engines: Kelly, LSTM-Transformer, DRL Portfolio, Sentiment - Research-backed algorithms table - Quick start with code examples - Use cases: stocks, sports betting, crypto, news trading - 20+ package ecosystem table - CLI interface examples - Exotic examples: swarm, GNN, quantum, hyperbolic - Performance benchmarks table Co-Authored-By: Claude Opus 4.5 --- README.md | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) diff --git a/README.md b/README.md index 452957e9a..9a9c1d41f 100644 --- a/README.md +++ b/README.md @@ -1590,6 +1590,142 @@ npm install @ruvector/agentic-synth-examples +
+πŸ“ˆ Neural Trader - AI Trading System + +[![npm](https://img.shields.io/npm/v/neural-trader.svg)](https://www.npmjs.com/package/neural-trader) +[![downloads](https://img.shields.io/npm/dt/neural-trader.svg)](https://www.npmjs.com/package/neural-trader) + +**Production-ready neural trading system** combining state-of-the-art ML for automated trading, sports betting, and portfolio management. Zero external ML dependencies, sub-millisecond latency. + +### Core AI/ML Engines + +| Engine | Description | Performance | +|--------|-------------|-------------| +| **Fractional Kelly** | Optimal position sizing with risk-adjusted bet scaling | 588,885 ops/s | +| **LSTM-Transformer** | Deep learning price prediction (temporal + attention) | 1,468 seq/s | +| **DRL Portfolio** | Reinforcement learning ensemble (PPO/SAC/A2C) | 17,043 steps/s | +| **Sentiment Alpha** | Real-time sentiment analysis for alpha generation | 3,764 pipeline/s | + +### Why Neural Trader? + +| Traditional ML | Neural Trader | +|----------------|---------------| +| TensorFlow/PyTorch required | **Zero dependencies** | +| 1.2MB+ bundle size | **45KB** bundle | +| 2.1ms LSTM inference | **0.68ms** inference | +| Complex deployment | **Works in browser & Node.js** | + +### Research-Backed Algorithms + +| Algorithm | Research Finding | +|-----------|------------------| +| **Kelly Criterion** | 1/5th fractional achieves 98% ROI with 85% less risk of ruin | +| **LSTM-Transformer** | Temporal + attention fusion outperforms single architectures | +| **DRL Ensemble** | PPO/SAC/A2C voting reduces variance vs single agent | +| **Sentiment Alpha** | 3% annual excess returns documented in academia | + +### Quick Start + +```javascript +import { KellyCriterion, HybridLSTMTransformer, DRLPortfolioManager } from 'neural-trader'; + +// Kelly position sizing +const kelly = new KellyCriterion(); +const stake = kelly.calculateStake(9000, 0.55, 2.0, 0.2); // 1/5th Kelly +// β†’ $180 recommended stake (2% of bankroll) + +// LSTM-Transformer prediction +const model = new HybridLSTMTransformer({ + lstm: { hiddenSize: 64, layers: 2 }, + transformer: { heads: 4, layers: 2 } +}); +const prediction = model.predict(candles); +// β†’ { signal: 'BUY', confidence: 0.73, direction: 'bullish' } + +// DRL portfolio allocation +const manager = new DRLPortfolioManager({ numAssets: 10 }); +await manager.train(marketData, { episodes: 100 }); +const allocation = manager.getAction(currentState); +// β†’ [0.15, 0.12, 0.08, ...] optimal weights +``` + +### Use Cases + +| Use Case | Example | +|----------|---------| +| **Stock Trading** | DAG-based pipeline with parallel execution | +| **Sports Betting** | Kelly sizing with ML calibration | +| **Crypto Trading** | DRL portfolio for 20+ assets | +| **News Trading** | Real-time sentiment stream processing | +| **Portfolio Rebalancing** | Reinforcement learning allocation | + +### Package Ecosystem (20+) + +| Package | Description | +|---------|-------------| +| `neural-trader` | Core engine with native HNSW, SIMD | +| `@neural-trader/core` | Ultra-low latency Rust + Node.js bindings | +| `@neural-trader/strategies` | Strategy management and backtesting | +| `@neural-trader/execution` | Trade execution and order management | +| `@neural-trader/mcp` | MCP server with 87+ trading tools | +| `@neural-trader/risk` | VaR, stress testing, risk metrics | +| `@neural-trader/portfolio` | Markowitz, Risk Parity optimization | +| `@neural-trader/neural` | Neural network training | +| `@neural-trader/brokers` | Alpaca, Interactive Brokers | +| `@neural-trader/sports-betting` | Arbitrage, Kelly, odds analysis | + +### CLI Interface + +```bash +# Real-time trading +node cli.js run --strategy=hybrid --symbol=AAPL --capital=100000 + +# Backtest historical performance +node cli.js backtest --days=252 --capital=50000 --strategy=drl + +# Paper trading simulation +node cli.js paper --capital=100000 --strategy=sentiment + +# Performance benchmarks +node cli.js benchmark --iterations=100 +``` + +### Exotic Examples + +| Example | Description | +|---------|-------------| +| **Multi-Agent Swarm** | Distributed trading intelligence with consensus | +| **GNN Correlation Network** | Graph neural network correlation analysis | +| **Attention Regime Detection** | Transformer-based market regime classification | +| **Quantum Portfolio** | QAOA & quantum annealing optimization | +| **Hyperbolic Embeddings** | PoincarΓ© disk market embeddings | +| **Atomic Arbitrage** | Cross-exchange with MEV protection | + +### Performance + +| Module | Latency | Throughput | Status | +|--------|---------|------------|--------| +| Kelly Engine | 0.014ms | 71,295/s | βœ“ Ready | +| LSTM-Transformer | 0.681ms | 1,468/s | βœ“ Ready | +| DRL Portfolio | 0.059ms | 17,043/s | βœ“ Ready | +| Sentiment Alpha | 0.266ms | 3,764/s | βœ“ Ready | +| Full Pipeline | 4.68ms | 214/s | βœ“ Ready | + +### Installation + +```bash +# npm +npm install neural-trader + +# Full ecosystem +npm install @neural-trader/core @neural-trader/strategies @neural-trader/mcp +``` + +> **Full Documentation**: [neural-trader README](./examples/neural-trader/README.md) + +
+
🐘 PostgreSQL Extension