hybrid-perps-spec

Order Routing Scenarios


SC-RT-001: Small Market Order → Internal Internalization

Preconditions:

Steps:

  1. User places BTC long market order, qty 0.05 BTC
  2. Router computes notional: 0.05 × 100,000 = $5,000 ≤ $10,000 → INTERNAL

Expected Results:


SC-RT-002: Large Market Order → HL Proxy Execution

Preconditions:

Steps:

  1. User places ETH long market order, qty 5 ETH
  2. Router computes notional: 5 × 4,000 = $20,000 > $10,000 → HYPERLIQUID
  3. Send open order instruction to HL platform account

Expected Results:


SC-RT-003: Same Asset, Two Opens — Split Routing

Preconditions:

Steps:

  1. First open: BTC long, notional $5,000 → INTERNAL
  2. Second open: BTC long, notional $15,000 → HYPERLIQUID

Expected Results:


SC-RT-004: Force-Route to HL — Net Exposure at Limit

Preconditions:

Steps:

  1. Router checks BTC net exposure → at limit
  2. Force-route to HYPERLIQUID (even though $3,000 < $10,000 threshold)

Expected Results:


SC-RT-005: Force-Route to HL — HL Latency Exceeded

Preconditions:

Steps:

  1. Router detects HL channel latency > 500ms → pause internalization
  2. Force-route to HYPERLIQUID

Expected Results:


SC-RT-006: Close Order Routing Follows Original Position

Preconditions:

Steps:

  1. User initiates close of BTC INTERNAL position
  2. User initiates close of BTC HYPERLIQUID position

Expected Results:


SC-RT-007: Consecutive Opens Trigger Hedging

Preconditions:

Steps:

  1. User A places BTC long order, notional $5,000 → INTERNAL ($5K < $10K threshold)
  2. User B places BTC long order, notional $8,000 → INTERNAL
  3. User C places BTC long order, notional $9,000 → INTERNAL

Expected Results:


SC-RT-008: Natural Hedging from Multi-Directional Users

Preconditions:

Steps:

  1. User A places ETH long order, notional $8,000 → INTERNAL (platform holds short $8K)
  2. User B places ETH short order, notional $8,000 → INTERNAL (platform holds long $8K)

Expected Results: