The system supports three routing modes, controlled by admin via the admin panel (see 11-admin.md).
| Mode | Trigger Scenario | Routing Behavior |
|---|---|---|
HL_MODE (Hyperliquid Mode) |
Net exposure too large, high risk | All new opens → HL; no internalization |
NORMAL_MODE (Default) |
Net exposure within acceptable range | Route by standard threshold |
BETTING_MODE (Aggressive Mode) |
Net exposure very low, book balanced | Route by elevated betting threshold |
Notional Value = Order Quantity × Current HL Mark Price
switch (current routing mode):
case HL_MODE:
→ All new open orders → HYPERLIQUID (regardless of size)
case NORMAL_MODE:
if Notional Value ≤ Normal Mode Threshold (default $10,000)
→ INTERNAL (platform internalization)
else
→ HYPERLIQUID
case BETTING_MODE:
if Notional Value ≤ Betting Mode Threshold (default $50,000)
→ INTERNAL (platform internalization)
else
→ HYPERLIQUID
Routing decision latency target: < 5ms P99
| Setting | Default | Applies To |
|---|---|---|
| Normal mode routing threshold | $10,000 | NORMAL_MODE |
| Betting mode routing threshold | $50,000 | BETTING_MODE |
Normal mode, threshold $10,000:
- BTC long $5,000 → INTERNAL
- BTC long $15,000 → HYPERLIQUID
Result: User holds two independent BTC long positions, each with its own entry price.
- Isolated mode: each position liquidated independently
- Cross mode: both positions share account equity; liquidation computed at account level
| Condition | Description |
|---|---|
| Volatility spike (>5%/hour) | No internalization during extreme price moves |
| HL latency exceeded (>500ms) | Conservative fallback to HL |
Note: Routing modes already cover “net exposure at limit” and “manual halt” scenarios — these are no longer listed as independent force-route conditions.
Close order must follow the original position source:
Cross-system offset is forbidden: an INTERNAL position cannot offset a HYPERLIQUID position.
| Order Type | Handling |
|---|---|
| INTERNAL pending limit order | Remove from internal queue; release frozen margin |
| HYPERLIQUID pending limit order | Send cancel instruction to HL |
Users cannot detect routing differences:
Single-order cross-threshold splitting is not supported in MVP:
Every routing decision must be logged:
routing_mode: HL_MODE / NORMAL_MODE / BETTING_MODE)