Skip to content
[HL] PRIVATEER

HL Privateer - an agentic open fund experiment on Hyperliquid

EXPERIMENT CONCLUDED

HL Privateer was an experiment in running an agentic trading desk on Hyperliquid. A crew of 7 LLM agents (Claude/Codex) proposed discretionary long/short trades with structured reasoning. A deterministic risk engine hard-gated every proposal before the OMS could execute. The whole thing ran on a single home server behind a Cloudflare Tunnel.

Key ideas
  • Fail-closed risk gates — 11 sequential checks as pure functions. No I/O, deterministic. Any failure = DENY.
  • AI proposes, never executes — agents output structured proposals with conviction scores. Only the runtime can place orders.
  • Fire-and-forget trades — SL/TP placed on Hyperliquid at entry. No trailing stops, no runtime rebalancing.
  • Event-sourced audit trail — hash-chained (SHA-256) audit events across all proposals, decisions, and executions.
  • x402 machine payments — pay-per-call API for agent-to-agent data markets. External agents pay USDC on Base to consume signals.
  • State machine — INIT, WARMUP, READY, IN_TRADE, HALT, SAFE_MODE. Dependency errors trigger SAFE_MODE (risk-reducing only).
Data flow
Hyperliquid               Agent Runner
(API + WS)                (7 LLM roles)
    |                          |
    | ticks                    | proposals
    v                          v
+--------------------------------------------+
| Runtime                                    |
|                                            |
| Market Adapter ----> Risk Engine           |
|                      (11 checks,           |
|                       pure fns,            |
|                       fail-closed)         |
|                          |                 |
|                    ALLOW | DENY            |
|                          |                 |
|                         OMS -----------------> Hyperliquid
|                     (place, fill,          |
|                      reconcile)            |
|                          |                 |
| +------------------------+---------------+ |
| |       Redis Streams (12 typed)         | |
| +--------+-------------------+-----------+ |
+----------+-------------------+-------------+
           |                   |
    +------+-----+      +-----+------+
    |  WS Gate   |      |  REST API  |
    |  (fanout)  |      | (JWT/x402) |
    +------+-----+      +-----+------+
           |                  |
           v                  v
    +---------------------------------+
    |     ASCII Trade Floor UI        |
    +---------------------------------+
VIEW SOURCE
BunTypeScriptNext.jsPostgresRedisHyperliquidx402