pub struct HyperliquidClient { /* private fields */ }Implementations§
Trait Implementations§
Source§impl GetAccountSnapshot for HyperliquidClient
impl GetAccountSnapshot for HyperliquidClient
Source§async fn get_positions(&self) -> Result<Vec<Position>, String>
async fn get_positions(&self) -> Result<Vec<Position>, String>
Returns open positions from clearinghouseState. Requires with_auth.
Zero-size positions are filtered out. Positive szi = long, negative = short.
Source§impl GetMarketData for HyperliquidClient
impl GetMarketData for HyperliquidClient
Source§async fn get_symbol(&self) -> Result<Vec<String>, String>
async fn get_symbol(&self) -> Result<Vec<String>, String>
Returns all perpetual asset names from Hyperliquid’s meta endpoint.
Source§async fn get_open_interest(&self, symbol: String) -> Result<Decimal, String>
async fn get_open_interest(&self, symbol: String) -> Result<Decimal, String>
Returns the current open interest for symbol from metaAndAssetCtxs.
Source§async fn get_asset_context(
&self,
symbol: String,
) -> Result<AssetContext, String>
async fn get_asset_context( &self, symbol: String, ) -> Result<AssetContext, String>
Returns a full AssetContext snapshot for symbol from metaAndAssetCtxs.
Source§async fn get_predicted_fundings(&self) -> Result<Vec<PredictedFunding>, String>
async fn get_predicted_fundings(&self) -> Result<Vec<PredictedFunding>, String>
Returns predicted funding rates for all symbols across all venues.
Source§impl ManageOrder for HyperliquidClient
impl ManageOrder for HyperliquidClient
Source§async fn place_order(
&self,
symbol: String,
side: OrderSide,
price: Decimal,
volume: Decimal,
order_type: OrderType,
time_in_force: TimeInForce,
) -> Result<OrderPlacement, String>
async fn place_order( &self, symbol: String, side: OrderSide, price: Decimal, volume: Decimal, order_type: OrderType, time_in_force: TimeInForce, ) -> Result<OrderPlacement, String>
Places an order on Hyperliquid. Requires with_auth. Returns an OrderPlacement with
the exchange-assigned order ID. Market orders are submitted as aggressive limit orders (IOC).
Source§async fn change_order_by_cloid(
&self,
cloid: i64,
price: Decimal,
volume: Decimal,
) -> Result<i64, String>
async fn change_order_by_cloid( &self, cloid: i64, price: Decimal, volume: Decimal, ) -> Result<i64, String>
Modifies price and size of an existing order by its order ID. Requires with_auth.
Fetches the order’s current coin and side before submitting the modify action.
Source§impl SubscribeMarketData for HyperliquidClient
impl SubscribeMarketData for HyperliquidClient
Source§fn subscribe_l2_update(&self, symbol: String) -> BoxStream<L2Update>
fn subscribe_l2_update(&self, symbol: String) -> BoxStream<L2Update>
Streams L2 orderbook updates for symbol. Each message from Hyperliquid is a
full-depth snapshot; every level is emitted as an individual L2Update event.
All levels in the same snapshot share the same sequence value.
Source§fn subscribe_asset_context(&self, symbol: String) -> BoxStream<AssetContext>
fn subscribe_asset_context(&self, symbol: String) -> BoxStream<AssetContext>
Streams asset context updates for symbol via Hyperliquid’s activeAssetCtx subscription.
Source§fn subscribe_liquidation(&self, user: String) -> BoxStream<Liquidation>
fn subscribe_liquidation(&self, user: String) -> BoxStream<Liquidation>
Streams liquidation events for a user address via Hyperliquid’s userEvents subscription.
Hyperliquid’s liquidation event is account-level; symbol is empty and side is Sell.
Source§impl SubscribeUserEvents for HyperliquidClient
impl SubscribeUserEvents for HyperliquidClient
Source§fn subscribe_user_fills(&self) -> BoxStream<UserFill>
fn subscribe_user_fills(&self) -> BoxStream<UserFill>
Streams the user’s own order executions via the userEvents WS subscription.
Requires with_auth (streams are empty if no user address is set).
Source§fn subscribe_order_updates(&self) -> BoxStream<OrderUpdate>
fn subscribe_order_updates(&self) -> BoxStream<OrderUpdate>
Streams order lifecycle events via the orderUpdates WS subscription.
Requires with_auth.
Source§fn subscribe_funding_payments(&self) -> BoxStream<FundingPayment>
fn subscribe_funding_payments(&self) -> BoxStream<FundingPayment>
Streams funding payments applied to positions via the userEvents WS subscription.
Requires with_auth.