๐Ÿ”Œ API & Developers

Hyperliquid API Error Responses: Troubleshooting Guide (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.
If you need a Hyperliquid account, use this referral link: Create a Hyperliquid account.

When troubleshooting Hyperliquid order and cancel requests, the first thing to check is the JSON response envelope, not only the transport status. The official Exchange endpoint examples show 200: OK responses where the envelope contains "status":"ok", while an individual order or cancel can still fail inside response.data.statuses.

In other words, transport or envelope success does not mean every submitted order succeeded. For batched order and cancel actions, the documented behavior is that errors are usually returned as a vector with the same length as the batched request. Some payload-level failures are returned earlier during pre-validation, and in that case only one error is returned for the entire payload.

This guide uses the official Hyperliquid documentation available on 2026-11-10 to explain:

1. Read the Exchange Response Envelope First

The Exchange endpoint is used for trading actions such as placing orders and canceling orders. The documented request is a POST to https://api.hyperliquid.xyz/exchange with a JSON body containing action, nonce, and signature.

For order submissions, the documented examples show three kinds of 200: OK response:

Successful resting order

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "resting": {
            "oid": 77738308
          }
        }
      ]
    }
  }
}

Order error inside an otherwise successful envelope

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "error": "Order must have minimum value of $10."
        }
      ]
    }
  }
}

Filled order

{
  "status": "ok",
  "response": {
    "type": "order",
    "data": {
      "statuses": [
        {
          "filled": {
            "totalSz": "0.02",
            "avgPx": "1891.4",
            "oid": 77747314
          }
        }
      ]
    }
  }
}

For cancel actions, the documented examples show:

Successful cancel

{
  "status": "ok",
  "response": {
    "type": "cancel",
    "data": {
      "statuses": [
        "success"
      ]
    }
  }
}

Cancel error inside an otherwise successful envelope

{
  "status": "ok",
  "response": {
    "type": "cancel",
    "data": {
      "statuses": [
        {
          "error": "Order was never placed, already canceled, or filled."
        }
      ]
    }
  }
}

The practical implication is that a bot should inspect response.data.statuses after every order or cancel submission. A response can be accepted at the envelope level while one or more submitted orders are rejected.

2. Batched Errors Are Usually Aligned to the Submitted Batch

The official Error responses documentation states that order and cancel errors are usually returned as a vector with the same length as the batched request.

That means if a bot submits three orders in one batch, the normal case is three status entries, one per submitted order. Each entry can indicate success, such as resting or filled, or an error string.

A reference handler should therefore:

  1. Check the envelope status.
  2. Read response.type to confirm whether the response is for an order or cancel action.
  3. Iterate through response.data.statuses.
  4. Log the index, submitted order identifier if available, and the returned status or error string.
  5. Treat any entry containing "error" as a business-level failure for that submitted item.
Reference example:

def log_order_statuses(payload, batch_size):
    if payload.get("status") != "ok":
        print("Envelope status:", payload.get("status"))
        return

    response = payload.get("response", {})
    statuses = response.get("data", {}).get("statuses", [])

    if not isinstance(statuses, list):
        print("Unexpected statuses payload:", statuses)
        return

    if len(statuses) == batch_size:
        for index, status in enumerate(statuses):
            if isinstance(status, dict) and "error" in status:
                print(f"Order {index} error: {status['error']}")
            else:
                print(f"Order {index} status: {status}")
    elif len(statuses) == 1 and batch_size > 1:
        # Pre-validation may return one error for the whole batch.
        print("Whole-batch error:", statuses[0])
    else:
        print("Unexpected statuses length:", len(statuses))

This is a reference pattern based on the documented response shape, not a claim that it has been run against live markets.

3. Some Payload Failures Return One Error for the Entire Batch

The Error responses documentation also explains that some errors are a deterministic function of the payload itself. Those errors are returned earlier as part of pre-validation. In that case, only one error is returned for the entire payload, because some of those errors do not apply to a specific order or cancel.

Documented examples include:

For batching bots, the documentation recommends handling the case where a single error is returned for a batch of multiple orders. In that case, the response could be duplicated n times before being sent to the callback function, because the whole batch was rejected for the same reason.

Practical handling:

๐Ÿ’ก Hyperliquid

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

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

4. Documented Batched Order and Cancel Errors

The table below lists documented batched error responses from the official Error responses page. The โ€œDiagnosticโ€ column is a troubleshooting action based on the documented error string.

Error sourceError typeDocumented error stringDiagnostic
OrderTickPrice must be divisible by tick size.Check the assetโ€™s tick size and ensure the submitted price conforms to it.
OrderMinTradeNtlOrder must have minimum value of $10.Increase the order notional so it is at least $10.
OrderMinTradeSpotNtlOrder must have minimum value of 10 {quote_token}.Increase the spot order size so the quote-token value is at least 10.
OrderPerpMarginInsufficient margin to place order.Reduce size, increase available margin, or review margin mode. See Hyperliquid Cross vs Isolated Margin.
OrderReduceOnlyReduce only order would increase position.Check position side. If the order would open or increase a position, remove the reduce-only flag or change direction.
OrderBadAloPxPost only order would have immediately matched, bbo was {bbo}.Adjust the post-only price so it rests instead of crossing the book, or use a different time-in-force behavior.
OrderIocCancelOrder could not immediately match against any resting orders.Check available liquidity. If resting is acceptable, use a resting order type instead of IOC. See Hyperliquid Order Not Filling? Slippage Fix.
OrderBadTriggerPxInvalid TP/SL price.Validate the trigger price for TP/SL orders. See Hyperliquid Take Profit & Stop Loss Orders.
OrderMarketOrderNoLiquidityNo liquidity available for market order.Check the order book. Use a limit order or reduce size if liquidity is insufficient.
OrderPositionIncreaseAtOpenInterestCapOrder would increase open interest while open interest is cappedReduce size or wait for open-interest conditions to change.
OrderPositionFlipAtOpenInterestCapOrder would increase open interest while open interest is cappedReduce size or wait for open-interest conditions to change.
OrderTooAggressiveAtOpenInterestCapOrder rejected due to price more aggressive than oracle while at open interest capAdjust the price so it is not more aggressive than the oracle while the cap applies.
OrderOpenInterestIncreaseOrder would increase open interest too quicklyReduce size or pace order flow.
OrderInsufficientSpotBalance(Spot-only) Order has insufficient spot balance to tradeCheck the relevant spot balance before submitting the order.
OrderOracleOrder price too far from oracleMove the submitted price closer to the oracle price.
OrderPerpMaxPositionOrder would cause position to exceed margin tier limit at current leverageReduce position size or leverage so the resulting position stays within the margin tier limit.
CancelMissingOrderOrder was never placed, already canceled, or filled.Reconcile open orders and fills before retrying. See Hyperliquid Missing Fills: Reconciliation Guide.
For asset-specific fields, such as the correct asset value for perpetuals and spot markets, see Hyperliquid API Asset IDs: Spot, Builder Perps, and Token ID Mapping.

5. Debug Signature Errors Before Depositing

The official Signing documentation recommends using an existing SDK instead of manually generating signatures because there are many ways signatures can be wrong.

An incorrect signature can recover a different signer based on the signature and payload. The documented possible errors include:

"L1 error: User or API Wallet 0x0123... does not exist."

Must deposit before performing actions. User: 0x123...

The returned address may not match the public address of the wallet being used to sign. The documentation also notes that the returned address can change for different inputs.

Important troubleshooting order:

  1. Check whether the recovered address matches the intended signer.
  2. Do not deposit before confirming that the recovered address is the intended user or API wallet address.
  3. If the recovered address is wrong, debug the signature construction first.
The Signing documentation lists common signature errors: Because an incorrect signature does not indicate why it is incorrect, the documentation recommends reading the Python SDK carefully and making sure the implementation matches exactly. If that does not resolve the issue, add logging to find where the output diverges.

For SDK-based implementation context, see Hyperliquid Python SDK Tutorial: Build a Bot.

6. Check Nonce and API-Wallet Behavior

Nonce and API-wallet issues can produce confusing behavior, especially when using automated strategies. The official Nonces and API wallets documentation provides several documented checks.

API wallets are for signing, not querying

API wallets, also called agent wallets in the docs, can be approved by a master account to sign on behalf of the master account or sub-accounts.

They are only used to sign. To query account data associated with a master or sub-account, pass the actual address of that account. A documented pitfall is using the agent wallet for queries, which can lead to an empty result.

For setup and revocation context, see:

Nonces are tracked per signer

On Hyperliquid, the 100 highest nonces are stored per address. Every new transaction must have a nonce larger than the smallest nonce in that set and must never have been used before.

Nonces are tracked per signer:

Nonces must be within (T - 2 days, T + 1 day), where T is the unix millisecond timestamp on the block of the transaction.

The Exchange endpoint documentation recommends using the current timestamp in milliseconds for nonce.

Do not reuse API wallet addresses after deregistration

The documentation strongly suggests not reusing API wallet addresses programmatically. Once an agent is deregistered, its used nonce state may be pruned. Previously signed actions can be replayed once the nonce set is pruned.

API wallets and their associated nonce state may be pruned when:

  1. The wallet is deregistered.
  2. The wallet expires.
  3. The account that registered the agent no longer has funds.
The documented recommendation is to generate a new agent wallet for future use.

Use separate API wallets for parallel subaccounts

Because nonces are stored per signer, separate subaccounts signed by the same API wallet share the nonce tracker of that API wallet. If multiple subaccounts are used in parallel, the documentation recommends generating separate API wallets under the master account and using one API wallet for each subaccount.

Batching and nonce counters

For automated strategies, the documentation suggests:

This structure is described as robust to out-of-order transactions within 2 seconds, which should be sufficient for an automated strategy geographically near an API server.

For rate-limit and user-limit behavior, see Hyperliquid API Rate Limits & User Limits. For real-time data handling, see Hyperliquid API Websocket Guide for Developers and Hyperliquid Websocket Reconnect Fix.

7. Practical Error-Handling Checklist

A useful troubleshooting checklist for Hyperliquid API errors is:

  1. Log the full request and response. Include action type, batch size, nonce, envelope status, and statuses.
  2. Separate envelope success from order success. A status: ok envelope can still contain per-order errors.
  3. Handle batch alignment. Expect one status per submitted item in the normal batched case.
  4. Handle whole-batch pre-validation errors. A single error may apply to the entire batch.
  5. Check documented error strings. Match the returned error string to the documented meaning before changing strategy logic.
  6. Verify signature recovery. For signature-related errors, confirm the recovered address before considering deposits.
  7. Check API-wallet usage. Use the agent wallet for signing and the actual account address for queries.
  8. Check nonce state. Ensure nonces are unique, within the documented time window, and not affected by pruned or reused agent wallets.
  9. Reconcile before retrying. For MissingOrder or missing fills, check order history and open orders before resubmitting.

Risk Warning

Risk Warning: Crypto trading involves substantial risk of loss. Never invest more than you can afford to lose. This is not financial advice.

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.

Sign up on Hyperliquid โ†’
๐ŸŽ 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). Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”ง
Troubleshooting & Fixes

Hyperliquid Python SDK: Suspected Silent WebSocket Server Error Messages and Debug Checks

A public SDK issue reports suspected silent WebSocket server-error messages. This reference explains how to treat it as unconfirmed and add defensive logging and reconnect checks.

November 28, 2026 โฑ 2 min read
๐Ÿ”ง
Troubleshooting & Fixes

Hyperliquid Spot Meta Array Mismatch Fix (2026)

Hyperliquid spotMetaAndAssetCtxs returns 320 assets while your code expects 711? Here is why the array length mismatch happens and how to make the Python SDK resilient.

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

Hyperliquid API expiresAfter: Action Deadline, Rejection, and 5x Rate-Limit Cost

Hyperliquid's optional expiresAfter field sets a millisecond deadline for an exchange action. After expiry, the action is rejected, and stale actions consume 5x the usual address-based rate limit.

November 11, 2026 โฑ 3 min read