hyperliquid-dex / hyperliquid-rust-sdk

MIT License
68 stars 49 forks source link

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

Closed mathdroid closed 2 months ago

mathdroid commented 2 months 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 2 months ago

Uodated debug format @lmlmt :)

lmlmt commented 2 months ago

Uodated debug format @lmlmt :)

Thanks for detailing everything so extensively!