@vizzor/cli 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,6 +91,7 @@ Beyond price targets, Vizzor provides:
91
91
  | **pnpm** | >= 8.0 | Recommended (npm/yarn also work) |
92
92
  | **Python** | 3.x | Required by `better-sqlite3` native build |
93
93
  | **C++ compiler** | GCC / Clang / MSVC | Required by `better-sqlite3` native build |
94
+ | **Docker** | >= 24 | Optional, for ML sidecar + PostgreSQL |
94
95
 
95
96
  Works on **macOS**, **Linux**, and **Windows**. No GPU required.
96
97
 
@@ -117,6 +118,13 @@ pnpm build
117
118
  pnpm link --global
118
119
  ```
119
120
 
121
+ ### Docker (Full Stack)
122
+
123
+ ```bash
124
+ cp .env.example .env # Configure API keys
125
+ docker compose up -d # Starts CLI + ML sidecar + PostgreSQL
126
+ ```
127
+
120
128
  ---
121
129
 
122
130
  ## Quick Start
@@ -204,6 +212,8 @@ vizzor ico list [options] # ICO/IDO tracker
204
212
  vizzor config init # Initialize config
205
213
  vizzor config set <key> <value> # Set config value
206
214
  vizzor config show # Show config
215
+ vizzor wallet create|import|list|delete # Wallet management
216
+ vizzor backtest [options] # Historical strategy backtest
207
217
  vizzor bot start [options] # Start Discord/Telegram bots
208
218
  vizzor bot validate # Check bot token configuration
209
219
  ```
@@ -231,6 +241,7 @@ vizzor bot validate # Check bot token configuration
231
241
  | `/agent status <name>` | View status + recent decisions |
232
242
  | `/agent delete <name>` | Delete an agent |
233
243
  | `/agent strategies` | List available strategies |
244
+ | `/backtest` | Run historical strategy backtest |
234
245
  | `/help` | Command reference |
235
246
  | `/clear` | Clear messages |
236
247
  | `/exit` | Quit |
@@ -306,6 +317,11 @@ Vizzor exposes **17+ tools** to the AI. During conversation, the AI autonomously
306
317
  | `create_agent` | Deploy autonomous prediction agent |
307
318
  | `list_agents` | List active agents |
308
319
  | `get_agent_status` | Agent status and decisions |
320
+ | `run_backtest` | Historical strategy backtesting |
321
+ | `get_ml_prediction` | ML model price prediction |
322
+ | `get_ml_regime` | Market regime classification |
323
+ | `get_ml_model_health` | ML sidecar health and model status |
324
+ | `classify_user_intent` | AI-powered query intent detection |
309
325
 
310
326
  ### AI Providers
311
327
 
@@ -337,7 +353,121 @@ For providers without tool support (Ollama), Vizzor pre-fetches all relevant dat
337
353
  | **Fear & Greed** | Crypto Fear & Greed Index | Public |
338
354
  | **Pump.fun** | Solana meme coin launches | Public |
339
355
 
340
- All responses cached in SQLite with configurable TTL (5 min for market data, 1 hour for token info, 24 hours for contract code).
356
+ All responses cached with configurable TTL (5 min for market data, 1 hour for token info, 24 hours for contract code).
357
+
358
+ ### Database Layer
359
+
360
+ Dual-backend storage with automatic migration:
361
+
362
+ | Backend | Use Case |
363
+ |---------|----------|
364
+ | **SQLite** | Default, zero-config local cache |
365
+ | **PostgreSQL** | Multi-instance deployments, Docker stack |
366
+
367
+ Data pipeline collectors run on configurable intervals, aggregating market snapshots, token metrics, and wallet activity into time-series tables for ML training and trend analysis.
368
+
369
+ ### ML Prediction Sidecar
370
+
371
+ A Python FastAPI sidecar enhances predictions with trained models:
372
+
373
+ | Model | Algorithm | Purpose |
374
+ |-------|-----------|---------|
375
+ | **Price Predictor** | LSTM | Short-term price direction |
376
+ | **Signal Classifier** | Random Forest | Buy/sell/hold signal quality |
377
+ | **Anomaly Detector** | Isolation Forest | Unusual market activity |
378
+ | **Rug Detector** | GBM | Scam token identification |
379
+ | **Wallet Classifier** | LSTM | Wallet behavior profiling |
380
+ | **Sentiment NLP** | DistilBERT | News headline sentiment |
381
+
382
+ Models fall back to heuristic scoring when the sidecar is unavailable. Start with Docker:
383
+
384
+ ```bash
385
+ docker compose up ml-sidecar
386
+ curl http://localhost:8000/health
387
+ ```
388
+
389
+ ### REST API
390
+
391
+ Authenticated REST API exposing all Vizzor capabilities programmatically:
392
+
393
+ ```bash
394
+ # Start the API server
395
+ vizzor api start --port 3100
396
+
397
+ # Create an API key
398
+ vizzor api key create "my-app"
399
+
400
+ # Endpoints
401
+ GET /health # Health check (public)
402
+ GET /docs # OpenAPI/Swagger UI (dev only)
403
+ POST /scan # Token security scan
404
+ POST /trends # Market trends
405
+ POST /track # Wallet forensics
406
+ POST /predict # AI prediction
407
+ POST /audit # Contract audit
408
+ POST /v1/backtest # Historical backtest
409
+ GET /v1/agents # List agents
410
+ POST /v1/agents # Create agent
411
+ POST /v1/agents/:name/start # Start agent
412
+ POST /v1/agents/:name/stop # Stop agent
413
+ GET /v1/portfolio/:id # Agent portfolio
414
+ ```
415
+
416
+ All endpoints require `X-API-Key` header. Rate limited to 100 req/min per key. Keys are hashed with scrypt and stored locally.
417
+
418
+ ### Autonomous Agents v2
419
+
420
+ Portfolio-aware trading agents with risk management:
421
+
422
+ - **Portfolio Manager** — tracks positions, calculates P&L, manages allocation limits
423
+ - **Risk System** — Kelly criterion position sizing, ATR-based stop losses, drawdown limits
424
+ - **ML-Adaptive Strategy** — combines RSI, MACD, EMA, Bollinger, funding rate with ML regime detection
425
+ - **Strategy Registry** — pluggable strategy system, easy to add custom strategies
426
+
427
+ ### Security & ZK
428
+
429
+ - **AES-256-GCM encryption** for sensitive data at rest
430
+ - **HMAC signatures** for API request integrity
431
+ - **Audit logging** for security-critical operations
432
+ - **ZK-proof chain adapters** for privacy-preserving verification
433
+ - **Input sanitization** across all user-facing surfaces
434
+
435
+ ### n8n Workflow Automation
436
+
437
+ 14 pre-built n8n workflows for automated operations:
438
+
439
+ | Workflow | Function |
440
+ |----------|----------|
441
+ | Data Collection | Scheduled market data ingestion |
442
+ | Alert Pipeline | Real-time anomaly alerts |
443
+ | ML Retraining | Periodic model retraining |
444
+ | Agent Monitor | Agent health and decision tracking |
445
+ | Daily Report | Automated portfolio summaries |
446
+ | Anomaly Analysis | Deep-dive unusual activity |
447
+ | Narrative Generator | Market narrative detection |
448
+ | Portfolio Rebalancer | Automated rebalancing signals |
449
+ | Strategy Tournament | Strategy backtesting comparison |
450
+ | Arbitrage Scanner | Cross-DEX price divergence |
451
+
452
+ ```bash
453
+ docker compose up -d # Starts Vizzor + ML sidecar + PostgreSQL + n8n + Web Dashboard
454
+ ```
455
+
456
+ ### Extended ML Models
457
+
458
+ v0.10 adds 7 new Python models to the sidecar:
459
+
460
+ | Model | Algorithm | Purpose |
461
+ |-------|-----------|---------|
462
+ | **Trend Scorer** | XGBoost | Market trend strength scoring |
463
+ | **TA Interpreter** | Random Forest | Technical analysis signal weighting |
464
+ | **Strategy Bandit** | Contextual Bandit | Adaptive strategy selection |
465
+ | **Regime Detector** | HMM | Market regime classification |
466
+ | **Project Risk** | GBM | Comprehensive project risk scoring |
467
+ | **Portfolio Optimizer** | Mean-Variance | Dynamic position sizing |
468
+ | **Intent Classifier** | DistilBERT | User query intent detection |
469
+
470
+ All 13 models integrated across 14 TypeScript modules with graceful fallback to heuristics. v0.11 adds model training pipeline (`POST /train`, `POST /evaluate`) and wires remaining ML modules.
341
471
 
342
472
  ---
343
473
 
@@ -357,8 +487,70 @@ Autonomous prediction agents that run a continuous **think -> analyze -> decide
357
487
  |----------|---------|-------|------|
358
488
  | **Momentum** | RSI + MACD + Bollinger + Funding | RSI crosses above 30 + bullish MACD | RSI > 70 + bearish divergence |
359
489
  | **Trend-Following** | EMA Crossover + OBV + Fear & Greed | Golden cross + rising volume | Death cross |
490
+ | **ML-Adaptive** | All TA + Funding + Fear & Greed + Regime | ML composite score > threshold | ML signal reversal + stop loss |
491
+
492
+ > Agents can run in **alert-only mode** or with **live trade execution** via DEX integration.
493
+
494
+ ### Trade Execution (v0.11)
495
+
496
+ On-chain trade execution with safety controls:
497
+
498
+ - **Wallet Manager** — encrypted private key storage (AES-256-GCM + scrypt) at `~/.vizzor/wallets/`
499
+ - **DEX Router** — Uniswap V3 SwapRouter02 integration for token swaps
500
+ - **Slippage Protection** — configurable max slippage (default 0.5%)
501
+ - **Dry-Run Mode** — simulate trades without executing (default: on)
502
+ - **Gas Estimation** — automatic gas estimation with configurable multiplier
503
+
504
+ ```bash
505
+ vizzor wallet create # Create encrypted wallet
506
+ vizzor wallet import # Import existing private key
507
+ vizzor wallet list # List managed wallets
508
+ ```
509
+
510
+ ### Backtesting Engine (v0.11)
511
+
512
+ Historical strategy simulation with walk-forward analysis:
513
+
514
+ ```bash
515
+ vizzor backtest --strategy momentum --pair BTCUSDT --from 2024-01-01 --to 2024-12-31
516
+ ```
517
+
518
+ - Run any strategy against historical kline data
519
+ - Metrics: total return, win rate, profit factor, Sharpe ratio, max drawdown
520
+ - Equity curve and drawdown visualization
521
+ - Walk-forward analysis with rolling train/test windows
522
+ - Available via CLI, TUI (`/backtest`), AI tool, and REST API (`POST /v1/backtest`)
523
+
524
+ ### Real-time WebSocket Feeds (v0.11)
525
+
526
+ Live market data via Binance WebSocket streams:
527
+
528
+ - Trade, kline, and ticker streams with auto-reconnect
529
+ - Connection pooling (up to 5 connections, 1024 streams each)
530
+ - In-memory price cache for instant access
531
+ - Agent engine prefers WebSocket data over REST polling
532
+
533
+ ### Web Dashboard (v0.11)
534
+
535
+ Next.js 15 web dashboard at `http://localhost:3001`:
536
+
537
+ - **Dashboard** — market overview, ML status, agent summary
538
+ - **Predictions** — candlestick charts with price predictions
539
+ - **Agents** — create, start/stop, and monitor agents
540
+ - **Portfolio** — positions, trade history, performance metrics
541
+ - **Settings** — API configuration
542
+
543
+ ```bash
544
+ docker compose up web # Start dashboard on port 3001
545
+ ```
546
+
547
+ ### Training Pipeline (v0.11)
548
+
549
+ Model training and evaluation via the ML sidecar:
360
550
 
361
- > v0.3.0: Agents operate in **alert-only mode** -- they log decisions and emit signals but do not execute on-chain transactions.
551
+ - `POST /train` train rug detector, trend scorer, regime classifier, sentiment models
552
+ - `POST /evaluate` — evaluate model accuracy on held-out test sets
553
+ - Data loaders for PostgreSQL-backed labeled datasets
362
554
 
363
555
  ---
364
556
 
@@ -373,7 +565,10 @@ Autonomous prediction agents that run a continuous **think -> analyze -> decide
373
565
  | Base | Live | GoPlus |
374
566
  | BSC | Live | GoPlus |
375
567
  | Avalanche | Live | GoPlus |
376
- | Solana | Live (DEX + GoPlus) | GoPlus |
568
+ | Solana | Live | GoPlus |
569
+ | Sui | Live | GoPlus |
570
+ | Aptos | Live | GoPlus |
571
+ | TON | Live | GoPlus |
377
572
 
378
573
  New chains are added by implementing the `ChainAdapter` interface.
379
574
 
@@ -444,7 +639,7 @@ pnpm dev # Dev mode (tsx)
444
639
  pnpm build # Build (tsup)
445
640
  pnpm lint # ESLint
446
641
  pnpm typecheck # TypeScript strict
447
- pnpm test # Vitest (164 tests, 19 suites)
642
+ pnpm test # Vitest
448
643
  pnpm test:coverage # With coverage
449
644
  ```
450
645
 
@@ -456,8 +651,11 @@ pnpm test:coverage # With coverage
456
651
  | CLI | Commander.js |
457
652
  | TUI | Ink (React for terminals) |
458
653
  | AI | Anthropic SDK, OpenAI SDK, Google GenAI, Ollama |
459
- | Blockchain | viem (EVM), plugin adapter system |
460
- | Database | better-sqlite3 with TTL cache |
654
+ | Blockchain | viem (EVM), Solana, Sui, Aptos, TON adapters |
655
+ | Dashboard | Next.js 15, React 19, Tailwind CSS 4 |
656
+ | Database | better-sqlite3 + PostgreSQL (pg) |
657
+ | ML Sidecar | Python FastAPI, scikit-learn, PyTorch |
658
+ | API | Fastify + Swagger/OpenAPI |
461
659
  | Bots | discord.js, grammY |
462
660
  | Build | tsup |
463
661
  | Test | Vitest |