hyperliquid-dex/hyperliquid-python-sdk

How to place market order?

Closed this issue · 2 comments

I am trying to implement market order request, but then I have some problem understanding this.
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint

now I checked the code, but then I saw this.

# Get aggressive Market Price
px = self._slippage_price(coin, is_buy, slippage, px)
# Market Order is an aggressive Limit Order IoC
return self.order(coin, is_buy, sz, px, order_type={"limit": {"tif": "Ioc"}}, reduce_only=False, cloid=cloid)

should I be using the isMarket parameter or I should do IoC with aggressive price (e.g. best ask when buying)

The isMarket parameter is for trigger orders. There is no isMarket parameter for regular orders. The sdk's implementation is correct.

thanks for the clarification @traderben