hyperliquid-dex / hyperliquid-rust-sdk

MIT License
57 stars 47 forks source link

feat(ExchangeClient): Add market open and close methods #55

Closed mathdroid closed 3 weeks ago

mathdroid commented 3 weeks ago

Description

This PR introduces market_open and market_close methods to the ExchangeClient, aligning the Rust SDK's functionality with the existing Hyperliquid Python SDK.

Key Changes

Implementation Details

Usage Example

let market_open_params = MarketOrderParams {
    asset: "ETH",
    is_buy: true,
    sz: 0.01,
    px: None,
    slippage: Some(0.01),
    cloid: None,
    wallet: None,
};

let response = exchange_client.market_open(market_open_params).await?;

Testing

Screenshot 2024-09-04 at 02 19 37

Related Issues

Closes #44

mathdroid commented 3 weeks ago

Uodated debug format @lmlmt :)

lmlmt commented 3 weeks ago

Uodated debug format @lmlmt :)

Thanks for detailing everything so extensively!