Skip to content

Commit 8baad66

Browse files
authored
Fix market orders for HIP-3 DEXs (#225)
1 parent ea84213 commit 8baad66

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hyperliquid/exchange.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def _slippage_price(
9191
coin = self.info.name_to_coin[name]
9292
if not px:
9393
# Get midprice
94-
px = float(self.info.all_mids()[coin])
94+
dex = coin.split(":")[0] if ":" in coin else ""
95+
px = float(self.info.all_mids(dex)[coin])
9596

9697
asset = self.info.coin_to_asset[coin]
9798
# spot assets start at 10000

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55

66
[tool.poetry]
77
name = "hyperliquid-python-sdk"
8-
version = "0.20.0"
8+
version = "0.20.1"
99
description = "SDK for Hyperliquid API trading with Python."
1010
readme = "README.md"
1111
authors = ["Hyperliquid <[email protected]>"]

0 commit comments

Comments
 (0)