mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-06-02 07:29:19 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
parent
033e4f9f96
commit
0851055979
1 changed files with 136 additions and 0 deletions
136
README.md
136
README.md
|
|
@ -1590,6 +1590,142 @@ npm install @ruvector/agentic-synth-examples
|
|||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>📈 Neural Trader - AI Trading System</strong></summary>
|
||||
|
||||
[](https://www.npmjs.com/package/neural-trader)
|
||||
[](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)
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>🐘 PostgreSQL Extension</strong></summary>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue