Skip to main content

System Design

Core Modules

1

API Gateway

REST/WS entry point for users, and AI agents
2

RPC Proxy

REST/WS RPC relay to the HL fullnode, using official RPC as backup
3

User Identifier

Verifies user identity and links to the corresponding agent wallet if configured
4

Signature Verifier & Risk Controller

Verifies EIP-712 intents and checks leverage/balance
5

MCP

Provides unified MCP APIs for AI Agents to fetch real-time market information and send trade requests

Pre-Liquidation Clearing

Pre-liquidation uses stricter rules than HL official liquidation to protect users
The pre-liquidation process:
  1. Aggregator monitors HL margin health
  2. When near liquidation threshold, Aggregator uses reduce-only IOC/limit via Agent Wallet to unwind at better price
  3. User preserves equity and saves memory