Expand description
Shared utilities for Hyperliquid execution clients (perps and spot).
Contains parsing helpers and stream wrappers used by both
HyperliquidClient (perps) and HyperliquidSpotClient.
Error mapping is in the error module.
Structs§
- Cancel
OnDrop Stream - Stream wrapper that cancels background tasks when dropped.
- Open
Order - One order from the
openOrdersinfo endpoint, as the venue actually returns it. - User
Fill - Parse a decimal string from SDK response, logging warnings on failure.
One fill from the
userFillsinfo endpoint, as the venue actually returns it.
Functions§
- cid_
to_ cloid - The cloid to place an order under
cidwith, orNoneifcidcannot be one. - cloid_
to_ cid - The client id an order placed with
cloidwas placed under: the inverse ofcid_to_cloid. - instrument_
to_ spot_ coin - Extract coin pair from spot instrument (e.g., “PURR-USDC-SPOT” -> “PURR/USDC”).
- map_tif
- Map rustrade TimeInForce to Hyperliquid TIF string.
- millis_
to_ datetime - Convert milliseconds timestamp to
DateTime<Utc>. - open_
orders - Fetch every open order for
address, parsed intoOpenOrderrather than the SDK’s lossy type, which drops thecloid. - parse_
decimal - parse_
side - Parse SDK side string to rustrade Side.
- spot_
pair_ to_ instrument - Build the spot instrument name for
pair, from its tokens:BASE-QUOTE-SPOT(e.g.HYPE-USDC-SPOTfor the pair Hyperliquid names@107). - user_
fills_ by_ time - Read every fill
addressmade fromstart_mstoend_ms, both inclusive, in epoch milliseconds, parsed intoUserFillrather than the SDK’s lossy type.