Skip to main content
Enterprise Only. The Hive is available exclusively to enterprise customers. To get access, contact us at contact@mathematicalcompany.com.
Ten agents researching independently will find the same market, open the same position, and blow up together. No portfolio view. No quality gate. Nobody deciding how much capital each agent deserves. The Hive fixes this. Thirteen compiled Rust subsystems handle coordination, evolution, risk, and execution for a fleet of trading agents. Pheromone fields for indirect communication. Evolutionary engines that breed new strategies. Bayesian reputation scoring. A 6-phase kill chain for automated incident response. All proprietary algorithms ship as opaque native binary. Below everything, the compiled Rust risk pipeline rejects any order that violates hard limits.

Hive

13 Rust subsystems: pheromone fields, evolutionary engines, behavioral cloning, causal discovery, impact modeling, metamorphic execution.

Agent Pipeline

9-phase workflow per agent. Research, analyze, backtest, pass 5 statistical tests, propose, execute on approval.

Circuit Breaker

No LLM. Daemon thread. Checks portfolio limits every 2 seconds. Emergency stop with no override path.

Event Bus

WebSocket pub/sub. 6 channels. Real-time state across agents, Hive, risk, and knowledge. Ring buffers for late joiners.

The Coordination Problem

Five agents, each independently researching markets. Prediction markets, stocks, options. Without coordination:
  • Agent A and Agent C both find the same Fed rate market. Both buy yes. 2x the exposure you planned for, and neither agent knows the other exists.
  • Agent B finishes a backtest with a Sharpe of 1.2 and starts trading. Overfit. No one checked.
  • Agent D requests 3,000.AgentErequests3,000. Agent E requests 4,000. Your budget is $5,000. Both get funded because there’s no central accounting.
  • All five agents are long the same sector. One event wipes out the portfolio.
The SwarmCoordinator runs a fitness-scored tick loop. The PheromoneField detects crowding automatically. The ConsensusEngine aggregates conflicting views. The CriticalityMonitor triggers the KillChain when systemic risk spikes. Agents can’t trade without the AutonomyController’s permission. And below all of this, the Rust engine rejects any order that violates compiled risk limits.

Quick Start

from horizon.hive import HiveController, HiveConfig, AutonomyMode

config = HiveConfig(
    total_capital=100_000,
    max_agents=50,
    initial_mode=AutonomyMode.Observe,
    host="0.0.0.0",
    port=8780,
    auth_token="your-secret-token",
)

hive = HiveController(config)

# Spawn agents from 9 archetype templates
agent = hive.spawn_agent("momentum", markets=["BTC-YES"], capital=5000.0)

# Full status across all 13 subsystems
status = hive.status()

# Start the oversight loop + WebSocket server (blocking)
hive.run()
Remote connections:
from horizon.hive import HiveClient

client = HiveClient("ws://hive-server:8780", token="your-secret-token")
client.connect()
print(client.status())
client.spawn(template="arbitrage", markets=["BTC-YES", "ETH-YES"])
Legacy LLM-driven swarm (still available):
from horizon.swarm import SwarmConfig, run_swarm

config = SwarmConfig(
    api_key="sk-or-...",
    hive_model="anthropic/claude-sonnet-4-6",
    agent_model="openai/gpt-5.4-mini",
    max_agents=10,
    max_capital_usd=10_000,
    exchange_backend="paper",
)

run_swarm(config)

How Orders Hit the Rust Engine

Every order from every agent goes through the same compiled risk pipeline in src/risk.rs.
Agent  →  submit_order  →  Engine.submit()  →  8 compiled checks  →  Exchange
Kill switch, price bounds, size bounds, position limits, notional cap, drawdown threshold, rate limit, dedup. All Rust. Python can’t skip any of them. A 1,000agentcanttakea1,000 agent can't take a 5,000 position. Rejected before it reaches the exchange. The SwarmCoordinator enforces total capital limits in compiled Rust. No agent receives more than max_capital_per_agent_pct (default 15%) of total AUM. Capital allocation is fitness-weighted. Better agents get more capital. One agent’s risk breach doesn’t affect another agent’s engine. Portfolio-wide limits are handled by the CriticalityMonitor and KillChain.

Five Risk Layers

Each enforces independently. Lower layers can’t be overridden by higher ones.
LayerEnforcerWhatOverride
EngineCompiled Rust8-point pipeline: kill switch, bounds, limits, cap, drawdown, rate, dedupNo
Per-AgentSwarmCoordinator (Rust)Capital allocation per agent, fitness-weighted rebalancingNo
Kill ChainCompiled Rust + Python callbacks6-phase incident response: detect, contain, preserve, diagnose, remediate, learnNo
Circuit BreakerDaemon thread, no LLMPortfolio drawdown, daily P&L, stuck detection. Emergency stop.No
Hive AutonomyAutonomyController (Rust)Progressive trust: Observe, Suggest, Supervised, Autonomous, SkynetCan’t override layers 1-4
The Hive reasons about strategy. It can’t override compiled safety limits. An agent that decides to “take more risk” still hits the Rust pipeline.

13 Rust Subsystems

All proprietary algorithms compiled to native binary via PyO3. No source code ships in the Python package.

SwarmCoordinator

Fleet management. Fitness scoring, selection pressure, promotion pipeline, capital rebalancing.

PheromoneField

9-channel stigmergic communication. Evaporation, diffusion, emergent market signals.

ConsensusEngine

IC-weighted signals, internal prediction markets, Dempster-Shafer belief aggregation.

AgentFactory

9 archetype templates + 5 spawn sources: evolution, clone, user, imprint, opportunistic.

MAPElitesArchive

300-cell quality-diversity grid. Keeps the swarm diverse by construction.

EvolutionEngine

NSGA-II multi-objective optimization with island model. 5 islands, periodic migration.

CriticalityMonitor

15-indicator systemic risk. Hurst, VPIN, transfer entropy, BOCPD, CUSUM. Triggers avalanche reserve.

CausalEngine

Granger causality + transfer entropy + lead-lag detection. Early warning for regime shifts.

SelfImpactModel

Almgren-Chriss impact estimation. Gates orders exceeding expected alpha. Internal crossing.

ImprintSystem

Behavioral cloning via 3-layer MLP. Learns your trading style with DAgger-style corrections.

AutonomyController

5-mode progressive trust. Each graduation requires statistical evidence.

KillChain

6-phase incident response. Genome blacklisting prevents failed strategies from re-evolving.

MetamorphicExecutor

Anti-fingerprint execution. Randomized child orders, jittered timing, decoy orders.

Configuration

HiveConfig controls all 13 subsystems. Key settings:
SettingDefaultPurpose
total_capital100,000Total AUM across all agents
max_agents50Maximum concurrent agents
initial_modeObserveStarting autonomy mode
max_drawdown_pct0.20Portfolio-wide drawdown limit
max_capital_per_agent_pct0.15No single agent gets more than 15%
pheromone_tick_interval1.0sPheromone evaporation/diffusion rate
criticality_check_interval60sHow often to run the 15-indicator check
avalanche_reserve_pct0.15Capital held in reserve for crises
dream_enabledTrueOffline accelerated evolution between sessions
imprint_enabledTrueLearn from operator behavior
metamorphic_enabledTrueAnti-fingerprint execution
host / port0.0.0.0:8780WebSocket server for remote connections

Models

The Hive uses LLMs for the ReACT research agent and high-level oversight. OpenRouter by default, any model works.
HiveConfig(
    api_base="https://openrouter.ai/api/v1",
    hive_model="anthropic/claude-sonnet-4-6",
    agent_model="openai/gpt-5.4-mini",
)
You can point api_base at any OpenAI-compatible endpoint: local models, Azure, your own proxy. The compiled Rust subsystems don’t use LLMs. They run deterministic algorithms.