From 3b332ddfaaf19198a05599fa44addcec5c614992 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 3 Nov 2025 20:30:13 -0800 Subject: [PATCH] Fix market orders for HIP-3 DEXs --- hyperliquid/exchange.py | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hyperliquid/exchange.py b/hyperliquid/exchange.py index 96677f2d..f3c7a33b 100644 --- a/hyperliquid/exchange.py +++ b/hyperliquid/exchange.py @@ -91,7 +91,8 @@ def _slippage_price( coin = self.info.name_to_coin[name] if not px: # Get midprice - px = float(self.info.all_mids()[coin]) + dex = coin.split(":")[0] if ":" in coin else "" + px = float(self.info.all_mids(dex)[coin]) asset = self.info.coin_to_asset[coin] # spot assets start at 10000 diff --git a/pyproject.toml b/pyproject.toml index b7e75695..aae20142 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "hyperliquid-python-sdk" -version = "0.20.0" +version = "0.20.1" description = "SDK for Hyperliquid API trading with Python." readme = "README.md" authors = ["Hyperliquid "]