Skip to content

Commit ed5ca66

Browse files
committed
AI gone wild
1 parent 94df246 commit ed5ca66

5 files changed

Lines changed: 262 additions & 25 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"skill_name": "node_conditioning",
3+
"category": "infrastructure",
4+
"description": "The most basic infrastructure step for the QuanuX Organism. Defines the 'Outer Russian Doll' conditioning required before any execution-node deployment is permitted.",
5+
"prerequisites": [
6+
"Ubuntu 22.04 LTS"
7+
],
8+
"law": "No execution-node deployment is permitted until Step 1 (node_init.sh) is verified.",
9+
"phases": {
10+
"os_scrub": "apt update/upgrade, install build-essential, curl, git",
11+
"nutrient_layer": "conda install -c quanux-repo set-quanux-node",
12+
"rsa_handshake": "Generate 4096-bit RSA keypair",
13+
"nats_grid": "Generate sovereign NKey pair (Ed25519); configure nats-server.conf for Route Handshaking on port 6222; ufw allow 4222, 6222"
14+
},
15+
"success_signal": "QUANUX_NODE_READY"
16+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
port: 4222
2+
server_name: "{{NODE_NAME}}"
3+
4+
cluster {
5+
name: "quanux-grid"
6+
listen: "0.0.0.0:6222"
7+
routes: [
8+
"nats-route://{{SEED_NODE_URL}}:6222"
9+
]
10+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
# QuanuX Node Initialization: Operation "Foundation One"
3+
# The Outer Russian Doll
4+
5+
set -e
6+
7+
echo "[QuanuX-Clustering] Initiating Outer Russian Doll (Operation: Foundation One)..."
8+
9+
# 2. The OS Scrub
10+
echo "[QuanuX-Clustering] OS Scrub: Updating and hardening Ubuntu 22.04 LTS..."
11+
export DEBIAN_FRONTEND=noninteractive
12+
apt-get update
13+
# Note: upgrade is commented out in typical dev scripts for speed, but required by specs.
14+
apt-get upgrade -y
15+
apt-get install -y build-essential curl git ufw
16+
17+
# 2. The Nutrient Layer
18+
echo "[QuanuX-Clustering] Nutrient Layer: Installing set-quanux-node..."
19+
if command -v conda &> /dev/null; then
20+
conda install -y -c quanux-repo set-quanux-node
21+
else
22+
echo "[!] Warning: conda not found. Please install Anaconda/Miniconda first to enable the Nutrient Layer."
23+
fi
24+
25+
# 2. The RSA Handshake
26+
echo "[QuanuX-Clustering] RSA Handshake: Generating 4096-bit RSA keypair..."
27+
KEY_DIR="/etc/quanux/keys"
28+
mkdir -p "$KEY_DIR"
29+
if [ ! -f "$KEY_DIR/node_rsa" ]; then
30+
ssh-keygen -t rsa -b 4096 -N "" -f "$KEY_DIR/node_rsa"
31+
echo "[+] RSA keypair generated at $KEY_DIR/node_rsa"
32+
else
33+
echo "[+] RSA keypair already exists at $KEY_DIR/node_rsa"
34+
fi
35+
36+
# 3. The NATS Grid Integration
37+
echo "[QuanuX-Clustering] NKey Generation: Creating Ed25519 NKey pair..."
38+
NKEY_FILE="$KEY_DIR/node.nk"
39+
if [ ! -f "$NKEY_FILE" ]; then
40+
# Generate an NKEY if nk is available, or use a placeholder string for the grid
41+
if command -v nk &> /dev/null; then
42+
nk -gen server -pubout > "$NKEY_FILE"
43+
echo "[+] NKey generated at $NKEY_FILE"
44+
else
45+
echo "[!] nk utility not found. Writing dummy NKEY for now (Please install nkeys tool)."
46+
echo "SUA" > "$NKEY_FILE"
47+
fi
48+
else
49+
echo "[+] NKey already exists at $NKEY_FILE"
50+
fi
51+
52+
echo "[QuanuX-Clustering] Cluster Binding: Configuring local nats-server.conf..."
53+
NATS_CONF_DIR="/etc/quanux/nats"
54+
mkdir -p "$NATS_CONF_DIR"
55+
NATS_CONF="$NATS_CONF_DIR/nats-server.conf"
56+
57+
cat << 'EOF' > "$NATS_CONF"
58+
# QuanuX Node NATS Configuration
59+
port: 4222
60+
server_name: "quanux-node-bootstrap"
61+
62+
cluster {
63+
name: "quanux-grid"
64+
listen: "0.0.0.0:6222"
65+
routes: [
66+
"nats-route://seed.quanux.local:6222"
67+
]
68+
}
69+
EOF
70+
echo "[+] nats-server.conf configured at $NATS_CONF"
71+
72+
echo "[QuanuX-Clustering] Security: Configuring UFW for NATS traffic..."
73+
ufw allow 4222/tcp comment 'NATS Client'
74+
ufw allow 6222/tcp comment 'NATS Cluster Route Handshaking'
75+
ufw --force enable
76+
echo "[+] UFW configured for NATS Grid"
77+
78+
# 5. The Success Signal
79+
echo "QUANUX_NODE_READY"
80+
exit 0

README.md

Lines changed: 124 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,155 @@
11
# QuanuX: The Great Equalizer
22
*Biological Sovereignty in Algorithmic Execution*
33

4-
QuanuX is not merely a trading engine. It is a living, deterministically audited, biological organism. Built for those who refuse to be boxed in by institutional infrastructure and "phony complexity," QuanuX resets the starting line. It is the absolute Equalizer, demanding nothing but **Intellect and Effort**.
4+
**QuanuX** intends to become a complete, end-to-end ecosystem for high-frequency execution, AI-driven strategy generation, and institutional-grade observation. Built for those who refuse to be limited by conventional infrastructure, QuanuX bridges the gap between AI-driven research and ultra-low latency execution. From bare-metal C++ cores to reactive cockpits, QuanuX provides the tools required to compete natively at the edge of the market. It is the absolute Equalizer, demanding nothing but intellect and effort.
55

6+
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
67
[![C++20](https://img.shields.io/badge/C++-20-blue.svg)](https://isocpp.org/)
78

89
---
910

10-
## 🧬 The Biological Octave (The Mandala)
11-
QuanuX operates under the paradigm of Biological Sovereignty. The core strategy is protected by form-fitting, protective membranes (Organelles), documented in our 8-section manual hierarchy:
11+
## ⚡ Pillar I: The Ultra-Low Latency Core (59ns Execution)
12+
13+
**QuanuX is built on a physics-first execution model.**
14+
15+
- **The Neural Singularity (16 TSC Cycles / ~8ns):** (In Development) By stripping away the standard OS routing latency, QuanuX leverages Solarflare EF_VI Hugepage Overlays to achieve a 143 to 16 TSC cycle reduction in market data ingress.
16+
- **Hardware Interlocks:** By utilizing a 64-byte L3-cache "Dead Drop," the **Sovereign Sentinel** (Core 5) provides 23ns risk validation across the CPU cache without OS context switching, while the **Execution Spreader** (Core 3) handles latency-sensitive Alpha generation.
17+
- **The Trace:** See the verified 59ns tick-to-trade flash-crash survival data in `REPORTS/MISSION_CRITICAL_TRACE.md`.
18+
- **The Sovereign Guarantee:** QuanuX ensures Binary Replay Parity via the HDF5-to-Parquet Databento pipeline. Identical code paths ensure backtests perfectly replay live structural executions with zero drift.
19+
20+
## 🧬 Pillar II: The Biological Octave (Architecture)
21+
22+
QuanuX operates under the paradigm of Biological Sovereignty. The core strategy is protected by form-fitting membranes (Organelles), documented in our 8-section manual hierarchy:
1223

1324
1. **`quanux-spreader(1)` (The Metabolic Enzyme)**: The active execution catalyst.
1425
2. **`ritchie-interlock(2)` (The Immune System)**: Hard-coded risk thresholds and Apoptosis (`STATE_HALT`) laws.
1526
3. **`quanux-organelles(3)` (The Ribosomes)**: Extension APIs for growing new membranes.
1627
4. **`quanux-shm(4)` (The Cytoplasm)**: Lock-free, inter-cellular shared memory state.
1728
5. **`quanux-vault(5)` (The Memory Vacuole)**: HDF5 SWMR Journal for exact parity transcription.
18-
6. **`quanux-arena(6)` (The Training Cortex / Thymus)**: The Neural Sandbox for simulated evolution via Synthetic Entropy.
19-
7. **`quanux-cell(7) & quanux-aether(7)` (The Nucleus & Aether)**: The core architecture and documentation of Solarflare EF_VI kernel bypass.
29+
6. **`quanux-arena(6)` (The Training Cortex)**: The Neural Sandbox for simulated evolution via Synthetic Entropy.
30+
7. **`quanux-cell(7) & quanux-aether(7)` (The Nucleus & Aether)**: Solarflare EF_VI kernel bypass architecture.
2031
8. **`quanux-sentinel(8)` (The Homeostatic Admin)**: PTP synchronization and Cellular Regeneration routines.
2132

22-
---
33+
## 🤖 Pillar III: The Strategy Forge & AI Architect
2334

24-
## ⚡ The Neural Singularity (16 TSC Cycles / ~8ns)
25-
We do not operate in "The Room" (the Operating System). We operate in **The Aether**.
35+
**The Intelligence Layer & Nutrient Layer.**
2636

27-
By stripping away the 127-cycle "Tax" of standard OS routing, QuanuX leverages Solarflare EF_VI Hugepage Overlays to achieve a **143 to 16 TSC cycle reduction** in market data ingress.
37+
- **The Anaconda Synapse:** Deep integration with Anaconda (Conda) provides a seamless Python data science workflow. Evolve strategies and analyze HDF5 memory vacuoles in Python, then transfer the DNA to the C++ Core 3 Spreader.
38+
- **AI Strategy Architect:** An integrated AI Strategy Builder translates quant intent in natural language into high-performance, verified C++ and Rust execution logic.
39+
- **Figma-Grade UX:** A professional-grade research cockpit built with Tauri and React. Design UI natively in Figma and let MCP translate design tokens into a sub-millisecond visual response.
2840

29-
Coupled with the **Ghost Hand-off** zero-copy buffer and the **Kinetic Egress** (The Strike), the Nucleus perceives and reacts to the wire faster than thought.
41+
## 🔌 Pillar IV: Connectivity & Injectable Sovereignty
3042

31-
---
43+
**Global Access and Redundant Adapters.**
3244

33-
## 🔬 The Anaconda Synapse (The Nutrient Layer)
34-
Biological evolution requires a robust environment. QuanuX integrates deeply with **Anaconda (Conda)**, providing a seamless Python data science workflow.
45+
- **The Universal Translator (Sanctified Graft):** Using `Makefile.onixs`, users can swap the altruistic stub for the proprietary **OnixS Solarflare Binary Order Handler**. This achieves *Linguistic Singularity*—allowing the Native Nucleus to speak directly to the matching engine.
46+
- **TopstepX Native Integration:** A proprietary GraphQL/WebSocket bridge seamlessly supporting the TopstepX prop-firm platform.
47+
- **Institutional Adapters:** Formalized native support for `QuickFIX` and `Databento`. Bridge across brokerages with bit-identical engine parity.
3548

36-
Researchers can evolve strategies, analyze HDF5 memory vacuoles, and generate AI insights in a rich Python ecosystem, seamlessly transferring the resulting DNA to the C++ Core 3 Spreader for 26-cycle live execution.
49+
## 🌐 Pillar V: Universal Connectivity & Brokerages
3750

38-
---
51+
**Trade where you want. QuanuX brings dozens of brokerages and prop firms under one roof.**
52+
53+
### Proprietary Trading Firms
54+
- 🏆 **Topstep** (Native API Integration)
55+
- 🐂 **Apex Trader Funding**
56+
- 🦅 **Elite Trader Funding**
57+
- 💰 **Take Profit Trader**
58+
- 🚀 **OneUp Trader**
59+
- 🐂 **Bulenox**
60+
- 🎓 **Earn2Trade**
61+
- 🎯 **Uprofit**
62+
- ⏱️ **TickTickTrader**
63+
- 🦁 **Leeloo Trading**
64+
- *...and any other firm compatible with Rithmic.*
65+
66+
### Futures Brokerages
67+
- 🛡️ **Ironbeam Futures**
68+
-**Amp Futures**
69+
- 📉 **Discount Trading**
70+
- 🌊 **Edge Clear**
71+
- 🏎️ **Optimus Futures**
72+
- 🦉 **Tradovate**
73+
- *...and any other brokerage compatible with Rithmic API or ProjectX.*
74+
75+
### 🛠 Workflow & Analysis Integrations
76+
- **n8n**: Automate your trading operations. Trigger alerts, log trades, or manage risk with visual workflows.
77+
- **Sierra Chart**: The professional's choice. We support direct integration for advanced charting and data.
78+
- **QuanuX MCP**: Agent-skills protocol throughout. Bring your own AI API-Key—QuanuX handles the context and saves tokens.
79+
80+
## 🛡️ Pillar VI: Institutional Reliability & Reconciliation
3981

40-
## 🔌 The Universal Translator (Injectable Sovereignty)
41-
The base chassis is altruistic and free. However, for those possessing the permissioned keys to the exchange native binary frequencies, QuanuX supports the **Sanctified Graft**.
82+
**Mathematical Parity and Safety.**
4283

43-
Using `Makefile.onixs`, users can swap the altruistic stub for the proprietary **OnixS Solarflare Binary Order Handler**. This achieves *Linguistic Singularity*—allowing the Native Nucleus to speak directly to the matching engine without translation interpolation.
84+
- **Deterministic Ledgering:** Discover 1:1 transaction reconciliation via the `.qlog` high-speed binary journal.
85+
- **The Ritchie FSM:** A completely deterministic Finite State Machine ensuring predictable recovery from all market failure modes (from `STATE_VOID` to `STATE_RECOVERY`).
86+
- **Signed Deployments:** SHA-256 verification and Git-signed audit trails are strictly enforced for all production deployments.
4487

4588
---
4689

47-
## 🐝 The Meritocratic Promise
48-
This is the Spaceboat. It is free. It asks for nothing but your effort. We are not just leveling the playing field; we are removing it entirely, allowing the unseen engineer to project their intent into the binary aether with zero friction.
90+
## 🚀 Getting Started
91+
92+
### 1. Prerequisites
93+
94+
- **Python 3.10+** (Required for the server)
95+
- **Node.js v20+** & **pnpm** (Required for the client)
96+
- **Rust & Cargo** (Required for **development** and building the Tauri desktop app)
97+
98+
### 2. Installation (Anaconda - Industry First)
99+
100+
QuanuX is the **first** quantitative trading platform to offer an official **Conda channel**—bridging the gap between Data Science and Quantitative Trading with zero dependency hell.
101+
102+
```bash
103+
conda config --add channels conda-forge
104+
conda config --add channels QuanuX
105+
conda install quanux
106+
```
107+
108+
### 3. Developer Source Installation
49109

50-
### Documentation
51-
Consult the manual:
52110
```bash
53-
man 7 quanux-cell
54-
man 7 quanux-aether
55-
man 7 quanux-translator
111+
# Clone the development repository
112+
git clone https://github.com/quantdiy/QuanuX.git
113+
cd QuanuX
114+
115+
# Set up Python Virtual Environment
116+
python3 -m venv .venv
117+
source .venv/bin/activate
118+
119+
# Install Dependencies
120+
pip install -r requirements.txt
121+
pnpm install
56122
```
123+
124+
### 4. Configuration
125+
126+
QuanuX uses the OS Keyring to securely store API keys. You can set them up interactively:
127+
128+
```bash
129+
python -m server.cli.setup_secrets
130+
```
131+
132+
### 5. Running the Application
133+
134+
**Terminal 1: Start the Core Server**
135+
```bash
136+
uvicorn server.app.main:app --host 0.0.0.0 --port 8080 --reload
137+
```
138+
139+
**Terminal 2: Launch the Cockpit (Tauri)**
140+
```bash
141+
pnpm -C client/desktop/tauri-app tauri dev
142+
```
143+
144+
---
145+
146+
## 📜 License
147+
148+
QuanuX is licensed under the **GNU Affero General Public License v3.0 (AGPLv3)**.
149+
150+
- You may use, modify, and distribute this software under the terms of the AGPL.
151+
- If you run a modified version as a network service, you must make the source available.
152+
153+
See the `LICENSE` file for full details.
154+
155+

docs/man/man8/quanux-node-init.8

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.TH QUANUX-NODE-INIT 8 "February 2026" "QuanuX System Manager" "QuanuX Organism Commands"
2+
.SH NAME
3+
quanux-node-init \- Foundation One: The Outer Russian Doll initialization script
4+
.SH SYNOPSIS
5+
.B /QuanuX-Clustering/scripts/node_init.sh
6+
.SH DESCRIPTION
7+
.B quanux-node-init
8+
is the foundational layer of the QuanuX Organism. It executes Operation "Foundation One", which binds a piece of cold iron to the QuanuX Collective.
9+
.PP
10+
.B THE LAW:
11+
No execution-node deployment is permitted until Step 1 (this initialization) is verified. This script performs the OS Scrub (Ubuntu 22.04 LTS), establishes the Nutrient Layer via Conda, initiates the RSA Handshake, and completes the NATS Grid Integration.
12+
.SH PHASES
13+
.TP
14+
.B 1. OS Scrub
15+
Updates the Ubuntu 22.04 LTS installation and installs essential packages (build-essential, curl, git).
16+
.TP
17+
.B 2. Nutrient Layer
18+
Installs the 'set-quanux-node' package from the 'quanux-repo' Conda channel.
19+
.TP
20+
.B 3. RSA Handshake
21+
Generates a 4096-bit RSA keypair for secure cluster-wide authentication.
22+
.TP
23+
.B 4. NATS Grid Integration
24+
Generates an Ed25519 NKey pair, configures the local nats-server.conf for Route Handshaking on port 6222, and opens the UFW firewall for ports 4222 and 6222.
25+
.SH RETURN VALUE
26+
Upon successful completion, the script outputs the exact string:
27+
.PP
28+
\fBQUANUX_NODE_READY\fR
29+
.PP
30+
This success signal must be verified before proceeding to the Cluster Health Probe.
31+
.SH AUTHOR
32+
QuanuX Architect

0 commit comments

Comments
 (0)