System Architecture

Every safety feature in this system exists because something broke without it.

Server Infrastructure

Separation of concerns by machine: research happens where it cannot touch money, execution happens where nothing else runs.

Hostinger

AI Hub

Kaleo AI orchestration layer. 11 specialized agents with memory, learning, and LLM routing. Discord + WhatsApp integration.

Kaleo Agents LLM Router n8n Pulse

Dedicated Live Host

Live Trading

Production execution environment on dedicated hardware, timezone-pinned to America/New_York. Runs the protection daemon (the armed stop-loss layer), the entry engine, and reconciliation alarms as a systemd fleet.

Trade Engine Risk Engine Position Mgr

Dev Machine

Research + CI

Development only, deliberately disarmed. Research harness, backtests, and a pre-push CI gate that blocks on lint, tests, and dirty state. Code reaches the live host only through deployment.

Research Harness CI Gate 5,500+ Tests

Risk Framework

Every trade passes through multiple safety layers before execution.

Kelly Criterion Sizing

I used to size up 3x after a win streak and give back the entire month in two trades. Kelly removes emotion from sizing: it calculates mathematically optimal position size based on edge and win rate. Negative Kelly means zero allocation, no matter how good the trade looks.

Kelly fraction 1-5% per trade
Hard stop 3% max loss

Circuit Breakers

Statistical circuit breakers using binomial distribution to detect when losses exceed normal variance. 5% daily loss limit triggers a global stop across all strategies.

Daily loss limit 5% of equity
Detection Binomial dist.

TP:SL Validation

Beast BNB had a 94% win rate and still lost money. The average win was $0.013, the average loss was $0.371, a 29:1 loss-to-win ratio. TP:SL validation now blocks any trade where the ratio doesn't support the win rate.

ATR stops Preferred
Trailing +1% activate, 8% trail

Why it's built this way

Every guard rail has a scar behind it.

3 stop-loss layers

Whale Mirror had no stop-loss at all. Positions drifted from -3% to -50% with zero protection. The only exit was when the whale exited. Now every position has three independent layers: bot trailing stop, exchange backstop Stop Market, and hard leverage cap.

Circuit breaker

Momentum SAR executed 613 trades at 2.4% win rate and lost $41.27 before anyone noticed. The circuit breaker now uses binomial distribution: if consecutive losses exceed what random chance would produce, trading pauses automatically.

Rate limiting

Beast re-entered 1,679 times within one minute of each stop-loss hit. Machine-gun overtrading. The system also once placed 63 duplicate trades in a single second. Rate limiting and deduplication now gate every order before it reaches the exchange.

Exit tracking

78% of trades never closed. The exit tracking system was broken and nobody noticed for weeks. Orphaned positions sat on the exchange accumulating unrealized losses. Now every position is reconciled on startup and monitored continuously.

Tech Stack

Purpose-selected tools. No bloat, no frameworks for the sake of frameworks.

Python
Core engine
SvelteKit
This site
Three.js
3D visuals
GSAP
Animations
Hyperliquid
Exchange
SQLite
Data store
Discord
Alerts + ops
WhatsApp
Mobile alerts