hyperliquid-rs

Crates.iohyperliquid-rs
lib.rshyperliquid-rs
version0.1.0
created_at2025-10-10 14:53:13.322987+00
updated_at2025-10-10 14:53:13.322987+00
descriptionA wrapper for the Hyperliquid API.
homepage
repositoryhttps://github.com/0xhappyboy/trade-sdk/tree/main/hyperliquid-sdk
max_upload_size
id1877052
size109,556
happy₿oy (0xhappyboy)

documentation

README

📈 hyperliquid-sdk

A wrapper for the Hyperliquid API.

License

简体中文 | English

Examples

Client initialization

Method 1

# Set environment variables
export HYPERLIQUID_API_KEY=hyperliquid_api_key
export HYPERLIQUID_SECRET_KEY=
let api_key = env::var("HYPERLIQUID_API_KEY").unwrap_or_else(|_| "your api key".to_string());
let secret_key = env::var("HYPERLIQUID_SECRET_KEY").unwrap_or_else(|_| "your secret key".to_string());
let client = HyperliquidClient::new().auth(api_key, secret_key);

Method 2

let client = HyperliquidClient::new().auth("your api key".to_string(), "your secret key".to_string());

Get price by symbol

let client = HyperliquidClient::new().auth("your api key".to_string(), "your secret key".to_string());
match client.get_price_by_symbol(symbol).await {
    Ok(price) => println!("{} current price: ${:.2}", symbol, price),
    Err(e) => println!("error: {}", e),
}
Commit count: 0

cargo fmt