System Architecture

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

Server Infrastructure

Three geographically distributed nodes, each purpose-built for its role.

Hostinger

AI Hub

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

Kaleo Agents LLM Router n8n Pulse

InterServer

Live Trading

Production execution environment. Runs all live strategies against Hyperliquid with real capital. Sub-second order placement.

Trade Engine Risk Engine Position Mgr

Contabo

Fast Assistant

Low-latency compute node for auxiliary services, email management, and fast data processing tasks.

Email Ops Data Sync Fast Compute

Risk Framework

Institutional-grade risk management. 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 2% 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 +0.5% activate, 2% 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