Hydra Core — Cross-Exchange Firewall

Multi-exchange risk enforcement and the Exchange Matrix for crypto platforms

Hydra Core — Cross-Exchange Firewall

Hydra Core is a Python service that enforces risk protocols across multiple cryptocurrency exchanges simultaneously. Unlike Arsenal (which operates within MT5), Hydra runs as a standalone process — monitoring and controlling positions across Binance, Bybit, HyperLiquid, and more.

🐉 Zero-Trust Risk Enforcement

Hydra doesn't trade. It watches. It enforces. If any position on any connected platform violates your risk parameters — whether the trade was placed by an Algorithm, a manual order, or a third-party system — Hydra will intervene.


Architecture

Your Dashboard
    ↓ (Risk Config)
Hydra Core (Python Service)
    ├── Binance API ← Monitor + Enforce
    ├── Bybit API   ← Monitor + Enforce
    ├── HyperLiquid ← Monitor + Enforce
    └── ... (extensible)

Hydra operates independently of your trading systems. It connects to exchange APIs with read + trade permissions, monitoring all account activity and intervening when risk limits are breached.


Exchange Matrix

The Exchange Matrix is a unified interface for connecting your crypto platforms. Configuration happens entirely via the Dashboard.

Connecting an Exchange

Navigate to Exchange Matrix

Go to Dashboard → Infrastructure → Exchange Matrix.

Add Exchange Connection

Click "Add Venue" and select your platform:

  • Binance (Spot & Futures)
  • Bybit (Unified Account)
  • HyperLiquid (Perps)

Enter API Credentials

Provide your API Key and Secret. The Dashboard encrypts these client-side (AES-256-GCM) before storing — identical to the Protocol Phoenix encryption model.

Set Permissions

Configure what Hydra is allowed to do:

  • Read Only — Monitor and alert only
  • Read + Cancel — Can cancel pending orders
  • Read + Close — Can close positions (recommended)
  • Full — Can cancel, close, and place hedging orders

⚠️ API Security

Always create exchange API keys with IP restriction enabled. Whitelist only your Execution Node's IP address. Never grant withdrawal permissions.


Risk Enforcement

Hydra evaluates positions against your configured limits every 5 seconds:

| Rule | Behavior | |------|----------| | Max Position Size | Rejects/closes positions exceeding lot limit | | Daily Loss Ceiling | Closes all positions when daily P&L reaches threshold | | Max Open Positions | Prevents new positions beyond count limit | | Correlation Limit | Prevents overexposure to correlated assets | | Equity Hard Stop | Emergency close-all at equity floor |

Enforcement Actions

When a violation is detected, Hydra acts progressively:

  1. Warning — Logged and alert sent (Telegram + Dashboard)
  2. Prevention — New positions blocked
  3. Liquidation — Offending positions closed at market
  4. Full Stop — All positions closed, trading suspended

🚨 Irreversible

When Hydra triggers a Full Stop, it closes ALL positions across ALL connected platforms. This is the nuclear option — designed for catastrophic scenarios. Resume trading only after reviewing the event in your Dashboard.


Deployment

Hydra Core runs on a Linux Execution Node (recommended) or Windows:

# Docker (recommended)
docker compose up -d hydra-core

# Or native Python
pip install -r requirements.txt
python main.py --config /path/to/config.json

💡 Separate Node

For maximum reliability, run Hydra on a separate Execution Node from your MT5 system. If the MT5 node fails, Hydra continues monitoring your exchange positions independently.


Next Steps