guilder-client-hyperliquid
Hyperliquid exchange client for the guilder multi-exchange crypto trading library.
Implements all guilder abstraction traits against the Hyperliquid REST and WebSocket APIs, so strategies written against the traits work on Hyperliquid with no exchange-specific code.
Implementation status
| Trait | Status |
|---|---|
TestServer |
Complete |
GetMarketData |
Complete |
GetAccountSnapshot |
Complete |
ManageOrder |
Complete |
SubscribeMarketData |
Complete |
SubscribeUserEvents |
Complete |
Usage
[]
= "0.4"
use HyperliquidClient;
use ;
let client = new;
// all guilder traits are available
let symbols = client.get_symbol.await?;
let book = client.get_l2_orderbook.await?;
With the orderbook engine
use OrderbookEngine;
let engine = new;
engine.track.await?;
Features
- Auto-reconnecting WebSocket streams —
subscribe_*methods return logically persistent streams that auto-reconnect on connection loss (5s delay). Consumers see transientErritems but the stream never terminates due to a dropped connection. - WebSocket multiplexing — multiple subscriptions share a single connection where possible.
- Configurable rate limiting — respects Hyperliquid's weight-based rate limits with configurable budgets.
Rate limits
REST API
All REST requests share an aggregated weight budget of 1,200 per minute.
Info endpoint (/info) weights
| Request type | Weight |
|---|---|
l2Book |
2 |
allMids |
2 |
clearinghouseState |
2 |
orderStatus |
2 |
spotClearinghouseState |
2 |
exchangeStatus |
2 |
userRole |
60 |
| All other info requests | 20 |
Exchange endpoint (/exchange) weights
weight = 1 + floor(batch_length / 40)
WebSocket API
| Limit | Value |
|---|---|
| Max simultaneous connections | 10 |
| Max new connections per minute | 30 |
| Max subscriptions | 1,000 |
| Max messages sent per minute (all connections) | 2,000 |
Method weight reference
| Method | Endpoint | Weight |
|---|---|---|
ping |
allMids |
2 |
get_symbol |
meta |
20 |
get_l2_orderbook |
l2Book |
2 |
get_price |
allMids |
2 |
get_open_interest |
metaAndAssetCtxs |
20 |
get_asset_context |
metaAndAssetCtxs |
20 |
get_predicted_fundings |
predictedFundings |
20 |
get_positions |
clearinghouseState |
2 |
get_open_orders |
openOrders |
20 |
get_collateral |
clearinghouseState |
2 |
place_order |
meta + exchange |
21 |
change_order_by_cloid |
openOrders + meta + exchange |
41 |
cancel_order |
openOrders + meta + exchange |
41 |
cancel_all_order |
openOrders + meta + exchange |
41 |
Part of guilder
trading.yaml → guilder-abstraction → guilder-core → your strategy
↗
guilder-client-* ────
See the guilder repository for the full architecture.