Sovereign HFT Trading System β Pure Rust Hive with Omni-Router and in-process AI inference.
Omni-Router (Dual-Exchange) β Native Binance and Bitfinex support running concurrently in L0 hot paths.
The War Room Dashboard β 10Hz HTML5 Canvas SSE live data stream displaying OBI tachometers and VWS (Volume Weighted Spread).
1088B Zero-Copy MMap Architecture (ArmadaStateV2) β Ultra-fast IPC telemetry memory mapping avoiding kernel overhead.
Sub-millisecond execution β Zero-allocation Rust hot paths with fixed-point arithmetic (i64 Γ 1e8)
5-bot fleet β Hydra (MM), Moonshot (flash dip), Grid (grid maker), Trigon (tri-arb), Nexus (cross-venue arb)
Dual AI inference β In-process Candle Logit Sniping (<20ms) + Gemini 3.1 Pro strategic oracle via ZeroClaw
Hexagonal Architecture β VenueAdapter trait enables zero-effort exchange integration (Bitfinex, Binance, ...)
Cognitive Engineering β Few-Shot anchored L1 prompt + Sovereign Constitution L2 with Chain-of-Thought forcing
Brain Transplant Protocol β Safe hot-swap GGUF models with shadow mode validation, zero downtime
Autonomous operation β Sovereign Boot Protocol (v20.0 Strategy Pattern) with 5 RiskClass Pillars (HEDGE, ARBITRAGE, MARKET_MAKER, STAT_ARB, POSITIONAL), quota watchdog, Sentinel guardian
Lock-free IPC β mmap with SeqLock atomics, 64-byte cache-line aligned structs via /dev/shm/beroun/
βββββββββββββββββββββββ βββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β L0: MUSCLE β β L1: REFLEXES β β L2: GENERAL β
β (Rust Execution) β β (Candle + Cortex) β β (ZeroClaw + Gemini) β
β β β β β β
β Hydra βββ β β Candle L1 Brain β β Sovereign Constitution β
β Grid βββ€ mmap ββββΌββββββ€ Logit Sniping (<20ms) β β Gemini 3.1 Pro Preview β
β Moonshotββ€ β β 4-token: BID/ASK/ β β <thinking> CoT forcing β
β Trigon βββ€ β β HOLD/KILL β β RAG memory (SQLite) β
β Nexus βββ β β CPU mode (GTX 1060) β β Telegram alerts β
β β β β β Quota Watchdog (5min) β
β VenueAdapter trait β β β β β
β Bitfinex + Binance β β β β Hard Guardrails: β
β β β ChatTemplate Resolver β β FAIL-FAST / MAX EXPO / β
β β β (Phi3/Llama3/Qwen2/ β β ANTI-JITTER β
β β β Gemma2/Mistral) β β β
βββββββββββββββββββββββ βββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
<1ms <20ms ~5min cycle
# Build all bots + AI
cargo build --release
# Deploy fleet
./deploy_armada.sh --build
# Start ZeroClaw L2 Oracle
export GEMINI_API_KEY=your_key
zeroclaw daemon
# Hot restart via systemd
sudo systemctl restart sniper-armada
# Status
zeroclaw status
sniper/
βββ hydra/ # L0 Market Maker (Rust β Bitfinex WS)
βββ moonshot/ # L0 Flash Crash Dip Buyer (Rust β multi-pair)
βββ grid/ # L0 Dynamic Grid Maker (Rust β L2 warped)
βββ trigon/ # L0 Triangular Arbitrage (Rust β 14 triangles)
βββ nexus/ # L0 Cross-Exchange Arb (Rust β BinanceβBitfinex)
βββ shared/ # sniper-shared crate (types, IPC, framework, venues)
β βββ src/exchange/ # VenueAdapter trait + BitfinexVenue + BinanceVenue
βββ candle-brain/ # π§ In-process L1 AI inference (Candle + GGUF)
β βββ src/brain.rs # CandleL1Brain β GGUF model loading + inference
β βββ src/logit_sniper.rs # Logit Sniping β 4-token classifier
β βββ src/chat_template.rs # Model-agnostic template resolver
β βββ src/transplant.rs # SBP v3.1 Brain Transplant Protocol
βββ architect/ # L1 Cortex (Rust) + L2 Oracle + Commander
β βββ cortex/ # Sovereign Cortex daemon (Sentinel, GPU, UDS)
β βββ l2_oracle.py # Legacy L2 brain (replaced by ZeroClaw)
β βββ tg_commander.py # Telegram interface + bot management
βββ zeroclaw/ # π ZeroClaw L2 Orchestrator
β βββ config.toml # Gemini 3.1 Pro, SQLite RAG, Telegram
β βββ system_prompt.md# Sovereign Constitution (CRO persona)
β βββ tools/ # mmap tools (read_engine_state, write_risk_param, quota_watchdog)
βββ infra/ # systemd service, install/stop scripts
βββ state/ # Persistent pre-crash state (armada_state.json)
βββ deploy_armada.sh # Sovereign Boot Script
βββ watchdog.sh # Cron-based process monitor
βββ ARCHITECTURE.md # Full system documentation
βββ README.md # This file
ROLE: Ultra-low latency HFT Reflex Core.
TASK: Classify L2 microstructure to predict next 100ms price tick.
OUTPUT: EXACTLY ONE TOKEN FROM [BID, ASK, HOLD, KILL].
<thinking> block required before any Tool Call| Layer | Mechanism | Protection |
|---|---|---|
| L0 | SeqLock + Atomics | Data consistency without locks |
| L1 | OBI + Sweep + KILL | Toxic flow protection (<20ms) |
| L1 | Sentinel (4-layer) | PnL crash, position drift, heartbeat |
| L1 | Brain Transplant | Safe model swap with rollback |
| L2 | Hard Guardrails | FAIL-FAST, MAX EXPO, ANTI-JITTER |
| L2 | Quota Watchdog | Telegram alert on API quota exhaustion |
| L2 | Sovereign Boot Protocol | PaperβLive validation (66min) |
| OS | systemd Restart=always | Auto-restart on failure, OOM protection |
| OS | watchdog.sh (cron) | Last-resort process resurrection |
# Prerequisites
sudo apt install -y nvidia-cuda-toolkit # For future GPU acceleration
# Install systemd service + kernel tuning
sudo ./infra/install_service.sh
# Configure API keys
cp .env.example .env
# Edit: BITFINEX_API_KEY, BINANCE_API_KEY, TELEGRAM_BOT_TOKEN, GEMINI_API_KEY
# ZeroClaw onboarding
zeroclaw onboard --quick --provider gemini --model gemini-2.5-pro
# Verify
sudo systemctl status sniper-armada
zeroclaw status
Private. All rights reserved.
2 commits
Rust
49.7%
Python
39.0%
HTML
9.5%
Shell
1.8%
Sovereign HFT Trading System β Pure Rust Hive with Omni-Router and in-process AI inference.
Omni-Router (Dual-Exchange) β Native Binance and Bitfinex support running concurrently in L0 hot paths.
The War Room Dashboard β 10Hz HTML5 Canvas SSE live data stream displaying OBI tachometers and VWS (Volume Weighted Spread).
1088B Zero-Copy MMap Architecture (ArmadaStateV2) β Ultra-fast IPC telemetry memory mapping avoiding kernel overhead.
Sub-millisecond execution β Zero-allocation Rust hot paths with fixed-point arithmetic (i64 Γ 1e8)
5-bot fleet β Hydra (MM), Moonshot (flash dip), Grid (grid maker), Trigon (tri-arb), Nexus (cross-venue arb)
Dual AI inference β In-process Candle Logit Sniping (<20ms) + Gemini 3.1 Pro strategic oracle via ZeroClaw
Hexagonal Architecture β VenueAdapter trait enables zero-effort exchange integration (Bitfinex, Binance, ...)
Cognitive Engineering β Few-Shot anchored L1 prompt + Sovereign Constitution L2 with Chain-of-Thought forcing
Brain Transplant Protocol β Safe hot-swap GGUF models with shadow mode validation, zero downtime
Autonomous operation β Sovereign Boot Protocol (v20.0 Strategy Pattern) with 5 RiskClass Pillars (HEDGE, ARBITRAGE, MARKET_MAKER, STAT_ARB, POSITIONAL), quota watchdog, Sentinel guardian
Lock-free IPC β mmap with SeqLock atomics, 64-byte cache-line aligned structs via /dev/shm/beroun/
βββββββββββββββββββββββ βββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
β L0: MUSCLE β β L1: REFLEXES β β L2: GENERAL β
β (Rust Execution) β β (Candle + Cortex) β β (ZeroClaw + Gemini) β
β β β β β β
β Hydra βββ β β Candle L1 Brain β β Sovereign Constitution β
β Grid βββ€ mmap ββββΌββββββ€ Logit Sniping (<20ms) β β Gemini 3.1 Pro Preview β
β Moonshotββ€ β β 4-token: BID/ASK/ β β <thinking> CoT forcing β
β Trigon βββ€ β β HOLD/KILL β β RAG memory (SQLite) β
β Nexus βββ β β CPU mode (GTX 1060) β β Telegram alerts β
β β β β β Quota Watchdog (5min) β
β VenueAdapter trait β β β β β
β Bitfinex + Binance β β β β Hard Guardrails: β
β β β ChatTemplate Resolver β β FAIL-FAST / MAX EXPO / β
β β β (Phi3/Llama3/Qwen2/ β β ANTI-JITTER β
β β β Gemma2/Mistral) β β β
βββββββββββββββββββββββ βββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ
<1ms <20ms ~5min cycle
# Build all bots + AI
cargo build --release
# Deploy fleet
./deploy_armada.sh --build
# Start ZeroClaw L2 Oracle
export GEMINI_API_KEY=your_key
zeroclaw daemon
# Hot restart via systemd
sudo systemctl restart sniper-armada
# Status
zeroclaw status
sniper/
βββ hydra/ # L0 Market Maker (Rust β Bitfinex WS)
βββ moonshot/ # L0 Flash Crash Dip Buyer (Rust β multi-pair)
βββ grid/ # L0 Dynamic Grid Maker (Rust β L2 warped)
βββ trigon/ # L0 Triangular Arbitrage (Rust β 14 triangles)
βββ nexus/ # L0 Cross-Exchange Arb (Rust β BinanceβBitfinex)
βββ shared/ # sniper-shared crate (types, IPC, framework, venues)
β βββ src/exchange/ # VenueAdapter trait + BitfinexVenue + BinanceVenue
βββ candle-brain/ # π§ In-process L1 AI inference (Candle + GGUF)
β βββ src/brain.rs # CandleL1Brain β GGUF model loading + inference
β βββ src/logit_sniper.rs # Logit Sniping β 4-token classifier
β βββ src/chat_template.rs # Model-agnostic template resolver
β βββ src/transplant.rs # SBP v3.1 Brain Transplant Protocol
βββ architect/ # L1 Cortex (Rust) + L2 Oracle + Commander
β βββ cortex/ # Sovereign Cortex daemon (Sentinel, GPU, UDS)
β βββ l2_oracle.py # Legacy L2 brain (replaced by ZeroClaw)
β βββ tg_commander.py # Telegram interface + bot management
βββ zeroclaw/ # π ZeroClaw L2 Orchestrator
β βββ config.toml # Gemini 3.1 Pro, SQLite RAG, Telegram
β βββ system_prompt.md# Sovereign Constitution (CRO persona)
β βββ tools/ # mmap tools (read_engine_state, write_risk_param, quota_watchdog)
βββ infra/ # systemd service, install/stop scripts
βββ state/ # Persistent pre-crash state (armada_state.json)
βββ deploy_armada.sh # Sovereign Boot Script
βββ watchdog.sh # Cron-based process monitor
βββ ARCHITECTURE.md # Full system documentation
βββ README.md # This file
ROLE: Ultra-low latency HFT Reflex Core.
TASK: Classify L2 microstructure to predict next 100ms price tick.
OUTPUT: EXACTLY ONE TOKEN FROM [BID, ASK, HOLD, KILL].
<thinking> block required before any Tool Call| Layer | Mechanism | Protection |
|---|---|---|
| L0 | SeqLock + Atomics | Data consistency without locks |
| L1 | OBI + Sweep + KILL | Toxic flow protection (<20ms) |
| L1 | Sentinel (4-layer) | PnL crash, position drift, heartbeat |
| L1 | Brain Transplant | Safe model swap with rollback |
| L2 | Hard Guardrails | FAIL-FAST, MAX EXPO, ANTI-JITTER |
| L2 | Quota Watchdog | Telegram alert on API quota exhaustion |
| L2 | Sovereign Boot Protocol | PaperβLive validation (66min) |
| OS | systemd Restart=always | Auto-restart on failure, OOM protection |
| OS | watchdog.sh (cron) | Last-resort process resurrection |
# Prerequisites
sudo apt install -y nvidia-cuda-toolkit # For future GPU acceleration
# Install systemd service + kernel tuning
sudo ./infra/install_service.sh
# Configure API keys
cp .env.example .env
# Edit: BITFINEX_API_KEY, BINANCE_API_KEY, TELEGRAM_BOT_TOKEN, GEMINI_API_KEY
# ZeroClaw onboarding
zeroclaw onboard --quick --provider gemini --model gemini-2.5-pro
# Verify
sudo systemctl status sniper-armada
zeroclaw status
Private. All rights reserved.
2 commits
Rust
49.7%
Python
39.0%
HTML
9.5%
Shell
1.8%