๐Ÿ”ง Troubleshooting & Fixes

Hyperliquid Python SDK: Builder Perp Slippage Price Misclassified as Spot (2026)

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you. I only review tools I actually use.
Reported in GitHub issue #341, the Hyperliquid Python SDK's Exchange._slippage_price can misclassify HIP-3 builder-deployed perp assets as spot. The result is that market_open and market_close may build a market order with a price that has too many decimals for a perp market.

This article summarizes the reported root cause, the affected asset-ID ranges, the arithmetic example in the issue, and the community-suggested fix. As of 2026-11-13, the issue is open; the fix below is a community suggestion, not a confirmed SDK patch.

Symptom

The issue affects builder-deployed perp markets, not ordinary spot markets. The reporter says the failure is fail-closed: the order is rejected and no funds move. The worst case is broken market_open or market_close on some builder-perp markets.

Hyperliquid's order types documentation describes a market order as an order that executes immediately at the current market price. The SDK slippage logic is meant to calculate a usable price for such orders, but the reported bug can make the calculated price invalid for the perp market's decimal rules.

Root cause

The issue points to hyperliquid/exchange.py:119-139, specifically the classification:

is_spot = asset >= 10_000

According to the issue, spot asset IDs start at 10000, while builder-deployed HIP-3 perp asset IDs start at 110000. Because every builder perp ID is also >= 10000, the SDK treats it as spot.

The issue cites Hyperliquid documentation for the decimal allowance: MAX_DECIMALS is 6 for perps and 8 for spot. Therefore the SDK can apply the spot decimal allowance 8 - szDecimals instead of the perp allowance 6 - szDecimals.

The reporter notes that five-significant-figure rounding often keeps the number of decimals low, which is why the issue may appear only on some low-priced builder perps. The issue was reported against SDK version 0.24.0, commit 2fdb18f9517675ea03695a0962bd19eece9c83f0.

Affected asset-ID ranges

Asset typeReported ID rangeClassification in SDK 0.24.0
Spot assetsstart at 10000spot
Builder-deployed HIP-3 perpsstart at 110000incorrectly treated as spot
The reported issue affects builder-deployed perp assets at or above 110000. It does not describe a change to Hyperliquid's API asset-ID mapping; for broader context, see Hyperliquid API asset IDs.

Example from the issue

The issue gives a testnet example:

For a perp market, the maximum price decimals are:

6 - 4 = 2

For a spot market, the maximum price decimals would be:

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Create a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

8 - 4 = 4

The SDK's buy price at 5% slippage is:

38.5 * 1.05 = 40.425

40.425 has three decimal places, which exceeds the reported perp cap of two. A two-decimal price such as 40.42 would fit the decimal cap.

The reporter could not obtain a server-side price-specific rejection on testnet because both the invalid-price order and the valid-price control order were rejected earlier with a wallet/API-wallet error. The decimal-cap violation itself is supported by the arithmetic and the documentation cited in the issue.

Community-suggested fix

The issue suggests bounding the spot range instead of using an open-ended lower bound:

is_spot = 10_000 <= asset < 110_000

Alternatively, the issue suggests tracking asset kind from metadata instead of relying on ID ranges.

This is a reference patch suggested in the public issue. It should be treated as a workaround until the SDK maintainers confirm and release an official fix. If you are not using builder-deployed perp markets, this issue is unlikely to affect your SDK orders.

Practical notes

Sources

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Create a Hyperliquid account โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Every tool reviewed here is something I've used with real capital. Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”Œ
API & Developers

Hyperliquid API Agent Wallet: Revoke & Fix (2026)

Learn how to safely revoke and reset API agent wallet permissions on Hyperliquid. Troubleshoot stale permissions, SDK errors, and vault deposit rejections step-by-step.

August 4, 2026 โฑ 11 min read
๐Ÿ”Œ
API & Developers

Hyperliquid API Asset IDs: Spot, Builder Perps, and Token ID Mapping

Use the official Hyperliquid API asset-ID formulas for standard perps, builder-deployed perps, spot pairs, and token IDs, with examples.

November 10, 2026 โฑ 3 min read
๐Ÿ”Œ
API & Developers

Hyperliquid HIP-3: user_fills dex Parameter Missing Fix (2026)

Fix HIP-3 fill tracking on Hyperliquid by parsing the dex prefix from coin, paging userFillsByTime, and using documented WebSocket userFills subscriptions.

July 11, 2026 โฑ 7 min read