Qollab.xyz Ready Project Blueprint • Macsta AiTrader

AiTrader Quantum: Combinatorial Regime & Correlation Engine

Structured in the exact repeatable qollab.xyz project specification format so our use case can migrate directly onto Qollab when ready.

Summary

AiTrader Quantum is a hybrid classical–quantum market regime and portfolio correlation engine designed for live cryptocurrency execution across N = 30 to 100 perpetual futures pairs. While our production classical stack (LightGBM + LSTM + technical indicators on trader / sqlca01) excels at scoring single-asset momentum, classical computers hit an exponential combinatorial wall (230 ≈ 1.07 billion joint states) when Flash-Crash contagion locks formerly uncorrelated coins into simultaneous drawdowns.

Instead of feeding noisy raw OHLCV ticks into a quantum processor, AiTrader uses classical ML to compute marginal conviction scores and maps only the combinatorial correlation tensor, lead-lag phase shifts, and tail-risk Monte Carlo sampling onto all-to-all connected quantum circuits (LR-QAOA, DQAOA-GPT 3rd-order HUBO, and QFT).

230 (1.07B) Simultaneous 30-asset correlation subsets evaluated via quantum superposition
All-to-All (KN) Zero-SWAP cross-sector entanglement on Trapped-Ion QPU topologies
28s vs 684s 24× faster sub-graph circuit generation via DQAOA-GPT vs variational QAOA

A Quantum-Assisted Crypto Regime & Correlation Engine

In calm markets, Bitcoin (BTC), Layer-1 smart-contract tokens (SOL, ETH, SUI), AI tokens (FET, RENDER), and meme assets trade in semi-independent clusters. A classical covariance matrix (Markowitz mean-variance) assumes pairwise correlations are linear and stationary.

In crypto, correlations are non-linear, higher-order, and regime-dependent: when a funding-rate cascade or macro shock hits, 3-way and 4-way contagion loops snap correlations toward 1.0 within minutes. AiTrader Quantum treats the market not as 30 isolated chart patterns, but as a coupled quantum spin glass (Ising / HUBO Hamiltonian) whose lowest-energy states reveal the safest, maximally diversified basket and warn when the entire market is collapsing into a single correlated bet.

How It Works

  1. Classical Feature & Drift Ingestion (Every 15m / 1h Bar): The classical AiTrader pipeline computes expected return drift μi, funding-rate skewness, order-book imbalance, Pairwise Mutual Information Jij, and 3-way co-crash tensors Wijk across the top N=30–100 liquid coins.
  2. Hamiltonian Encoding: Each asset is mapped to a qubit spin Zi ∈ {+1, -1}. Single-qubit biases encode expected return (hi), 2-body couplings encode pairwise contagion (Jij Zi Zj), and 3-body couplings encode triad liquidation cascades (Wijk Zi Zj Zk).
  3. Zero-Optimization Circuit Execution: To avoid noisy variational loops and Barren Plateaus during live market windows, we execute deterministic Linear-Ramp QAOA (LR-QAOA, arXiv:2405.09169) for N ≤ 30 or decompose N=100 universes into n=12 sub-graphs solved in a single forward pass via DQAOA-GPT (arXiv:2607.20225).
  4. Portfolio Basket & Contagion Readout: Measuring 1,000–4,000 shots collapses the superposition into candidate portfolio bitstrings ranked by true joint risk-adjusted energy, feeding directly into the classical position-sizing risk gate.

The Observation Mechanic

In quantum mechanics, a system exists in a coherent superposition of all 2N asset combinations until measured. In AiTrader Quantum, measurement (observation) is not just a single yes/no trade signal—the probability distribution of collapsed bitstrings IS the market regime indicator:

  • Fragmented / Multi-Modal Collapse (Healthy Diversified Market): When the measured bitstrings cluster around specific decoupled subsets with a sharp energy gap, independent alpha opportunities exist across sectors.
  • Ferromagnetic Phase Transition (Flash-Crash Contagion Alert): When the coupling strengths Jij and Wijk surge past the critical threshold, the Ising state undergoes a phase transition—collapsing toward an all-aligned ("cat-like") state. AiTrader detects this entropy collapse before classical rolling windows catch up, automatically throttling leverage.

Quantum Circuits

Our quantum pipeline uses three complementary circuit families tailored to all-to-all connectivity:

1. Linear-Ramp QAOA (LR-QAOA) + 3rd-Order HUBO Circuit

Instead of wasting thousands of QPU shots on a classical optimizer, our circuit uses the universal linear ramp schedule (LR-QAOA Dyslexic Reader · arXiv:2405.09169, arXiv) combined with 3-body Zi Zj Zk HUBO phase gadgets (DQAOA-GPT Dyslexic Reader · arXiv:2607.20225, arXiv):

q[0] (BTC) : ──[H]──[Rz(2γ h_0)]──•────────────────•──────────────────•──────────────[Rx(2β)]──[M]
                                  │                │                  │
q[1] (SOL) : ──[H]──[Rz(2γ h_1)]──ZZ(2γ J_01)──────┼──────────────────┼───•──────────[Rx(2β)]──[M]
                                                   │                  │   │
q[2] (FET) : ──[H]──[Rz(2γ h_2)]───────────────────ZZ(2γ J_02)────────ZZZ(2γ W_012)──[Rx(2β)]──[M]

Schedule across p layers (No Variational Loop!):
  β_l = (1 - l/p) Δβ     (Linearly ramps down quantum mixing)
  γ_l = ((l + 1)/p) Δγ   (Linearly ramps up market correlation penalties)
            

2. Quantum Fourier Transform (QFT) Lead-Lag Cross-Spectrum

Applies an inverse Quantum Fourier Transform (QFT†) across amplitude-encoded multi-timeframe return windows to detect hidden periodic lead-lag phase shifts (e.g., BTC funding spikes leading altcoin liquidity sweeps by Δt bars).

3. QC-AFQMC Tail-Risk Monte Carlo

Uses QC-AFQMC (arXiv:2506.22408) with Matchgate Classical Shadows to prepare a guiding state for classical GPU Monte Carlo walkers simulating fat-tailed, non-Gaussian portfolio crash scenarios.

Visual Design

The operator interface is built for rapid pattern recognition without cognitive overload (including full OpenDyslexic single-column accessibility):

  • 3D Correlation Hypergraph: Nodes represent coins sized by classical ML conviction (hi); glowing edges represent active 2-body (Jij) and 3-body (Wijk) quantum entanglement channels.
  • Energy Landscape Histogram: Live readout of sampled bitstrings from the QPU/simulator showing the ground-state optimal portfolio basket vs. classical Markowitz allocation.
  • Regime Thermometer: Tracks the Ising order parameter and entanglement entropy to flag market-wide contagion before drawdowns cascade.

Architecture

┌─────────────────────────────────────────────────────────────────────────────┐
│ 1. Classical Data & ML Tier (trader VM + sqlca01: ai-trader-db)             │
│    • Ingests live OHLCV, Order Book & Funding Rates for 30–100 coins        │
│    • LightGBM / LSTM computes expected return vector h_i                    │
│    • Builds Pairwise Coupling Matrix J_ij & 3-Body Contagion Tensor W_ijk   │
└──────────────────────────────────────┬──────────────────────────────────────┘
                                       │ Graph Embedding (FEATHER) + HUBO Tokenization
                                       ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 2. Hybrid Quantum-HPC Orchestrator (CUDA-Q on local GPU / Cloud QPU API)    │
│    • Sub-problem Decomposition (n=12 to 30 qubits)                          │
│    • Circuit Synthesis: LR-QAOA Deterministic Ramp OR DQAOA-GPT Forward Pass│
│    • Target Hardware: All-to-All Trapped-Ion QPU (IonQ Forte) / CUDA-Q Sim  │
└──────────────────────────────────────┬──────────────────────────────────────┘
                                       │ Measured Low-Energy Bitstrings & Regime Entropy
                                       ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ 3. Execution & Risk Gate (AiTrader Portfolio Manager)                       │
│    • Filters out correlated cluster traps                                   │
│    • Applies Kelly / Tail-Risk sizing & logs full telemetry to sqlca01      │
└─────────────────────────────────────────────────────────────────────────────┘
            

Philosophy

Let Classical Do What Classical Does Best—Reserve Quantum for Exponential Combinatorics.

Most "quantum finance" demos fail because they try to replace simple linear regression or moving averages with noisy quantum circuits. Our philosophy is pragmatic engineering: classical gradient-boosted trees and GPUs are unbeatable at digesting millions of historical price bars for a single asset, while quantum processors natively represent the 2N entangled state space of how 30+ assets move together during extreme market stress. By combining zero-optimization protocols (LR-QAOA and DQAOA-GPT) with all-to-all qubit connectivity, AiTrader Quantum turns quantum mechanics from an academic curiosity into a practical risk-shield and portfolio optimizer.