Skip to content

MARUCIE/08-quantum-trading

Repository files navigation

Quantum X

AI-native quantitative trading system for crypto, stocks, and futures.

Features

  • Data Pipeline: Real-time market data via Binance REST/WebSocket
  • Feature Store: 8 technical indicators with versioning and drift detection
  • Strategy Engine: Momentum and Mean Reversion strategies with backtesting
  • Risk Management: 4-layer risk control (Account/Strategy/Trade/System)
  • Paper Trading: Simulated execution with slippage and commission modeling
  • Web Dashboard: Next.js 15 with TradingView charts and real-time updates

Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • npm >= 10.0.0

Backend

cd backend
npm install
cp .env.example .env.local
# Edit .env.local (keep API_STATIC_KEY and NEXT_PUBLIC_API_KEY aligned for local auth)
npm run dev

Backend runs on http://localhost:3001 (direct dev).
Docker Compose dev maps host ports to http://localhost:4008 (API) and ws://localhost:4009 (WS) via HOST_BACKEND_PORT / HOST_WS_PORT.

Frontend

cd frontend
npm install
npm run dev

Frontend runs on http://localhost:3000 (direct dev).
Docker Compose dev maps host port to http://localhost:3008 via HOST_FRONTEND_PORT.

Project Structure

quantum-x/
├── backend/                # TypeScript backend
│   └── src/
│       ├── api/           # REST API server (15 endpoints)
│       ├── data/          # Binance client, pipeline, storage
│       ├── execution/     # Order manager, paper trading
│       ├── features/      # Technical indicators, feature store
│       ├── research/      # Backtesting, model registry
│       ├── risk/          # Risk checker, monitor, audit
│       ├── strategy/      # Strategy implementations
│       └── types/         # TypeScript type definitions
│
├── frontend/              # Next.js 15 frontend
│   └── src/
│       ├── app/          # 8 pages (Overview, Strategies, Trading, etc.)
│       ├── components/   # UI components (shadcn/ui)
│       └── lib/          # API client, hooks, stores
│
└── doc/                   # Project documentation
    └── 00_project/initiative_quantum_x/
        ├── PRD.md                    # Product requirements
        ├── SYSTEM_ARCHITECTURE.md    # Architecture design
        ├── task_plan.md              # Task tracking
        └── MVP_VERIFICATION_REPORT.md # Verification results

API Endpoints

The canonical REST route list lives in backend/src/api/routes.ts. For a functional map of frontend routes and entrypoints, see doc/00_project/initiative_quantum_x/SYSTEM_ARCHITECTURE.md.

Technology Stack

Backend

  • TypeScript 5.x
  • Node.js built-in HTTP server
  • Binance REST & WebSocket API
  • Event-driven architecture

Frontend

  • Next.js 15 (App Router)
  • React 19
  • TanStack Query v5
  • Zustand v5
  • TradingView Lightweight Charts v5
  • shadcn/ui + Tailwind CSS 4

Risk Management

Four-layer risk control system:

  1. Account Level: Max drawdown, daily/weekly loss limits, margin call
  2. Strategy Level: Capital allocation, correlation limits, consecutive loss limits
  3. Trade Level: Position sizing, stop-loss, slippage limits
  4. System Level: Kill switches, circuit breakers

Development

# Type check
cd backend && npm run typecheck
cd frontend && npx tsc --noEmit

# Build frontend
cd frontend && npm run build

# Run tests (when available)
cd backend && npm test

Documentation

License

Private - All rights reserved.

Disclaimer

This software is for educational and research purposes only. Not financial advice. Trading cryptocurrencies and other financial instruments involves substantial risk of loss. Past performance does not guarantee future results.

About

Quantum X Trading System - Advanced crypto trading platform with AI-powered analysis

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages