Hyperliquid Docs
  • About Hyperliquid
    • Core contributors
  • Onboarding
    • How to start trading
    • How to use the HyperEVM
    • Connect mobile via QR code
    • Export your email wallet
    • Testnet faucet
  • HyperCore
    • Overview
    • Bridge
    • API servers
    • Clearinghouse
    • Oracle
    • Order book
    • Staking
    • Vaults
      • Protocol vaults
      • For vault leaders
      • For vault depositors
    • Multi-sig
  • HyperEVM
    • Tools for HyperEVM builders
  • Hyperliquid Improvement Proposals (HIPs)
    • HIP-1: Native token standard
    • HIP-2: Hyperliquidity
    • HIP-3: Builder-Deployed Perpetuals
    • Frontend checks
  • Trading
    • Perpetual assets
    • Contract specifications
    • Margin tiers
    • Fees
    • Builder codes
    • Order book
    • Order types
    • Take profit and stop loss orders (TP/SL)
    • Margining
    • Liquidations
    • Entry price and pnl
    • Funding
    • Miscellaneous UI
    • Auto-deleveraging
    • Robust price indices
    • Self-trade prevention
    • Portfolio graphs
    • Hyperps
    • Market making
  • Validators
    • Running a validator
    • Delegation program
  • Referrals
    • Staking referral program
  • Points
  • Historical data
  • Risks
  • Bug bounty program
  • Audits
  • Brand kit
  • For developers
    • API
      • Notation
      • Asset IDs
      • Tick and lot size
      • Nonces and API wallets
      • Info endpoint
        • Perpetuals
        • Spot
      • Exchange endpoint
      • Websocket
        • Subscriptions
        • Post requests
        • Timeouts and heartbeats
      • Error responses
      • Signing
      • Rate limits
      • Bridge2
      • Deploying HIP-1 and HIP-2 assets
      • Deploying HIP-3 assets
    • HyperEVM
      • Dual-block architecture
      • Raw HyperEVM block data
      • Interacting with HyperCore
      • HyperCore <> HyperEVM transfers
      • Wrapped HYPE
      • JSON-RPC
    • Nodes
      • L1 Data Schemas
Powered by GitBook
On this page
  1. For developers
  2. API

Error responses

Order and cancel errors are usually returned as a vector with same length as the batched request.

Below is a list of possible batched error responses:

Error source
Error type
Error string

Order

Tick

Price must be divisible by tick size.

Order

MinTradeNtl

Order must have minimum value of $10

Order

PerpMargin

Insufficient margin to place order.

Order

ReduceOnly

Reduce only order would increase position.

Order

BadAloPx

Post only order would have immediately matched, bbo was {bbo}.

Order

IocCancel

Order could not immediately match against any resting orders.

Order

BadTriggerPx

Invalid TP/SL price.

Order

MarketOrderNoLiquidity

No liquidity available for market order.

Order

PositionIncreaseAtOpenInterestCap

Order would increase open interest while open interest is capped

Order

PositionFlipAtOpenInterestCap

Order would increase open interest while open interest is capped

Order

TooAggressiveAtOpenInterestCap

Order rejected due to price more aggressive than oracle while at open interest cap

Order

OpenInterestIncrease

Order would increase open interest too quickly

Order

InsufficientSpotBalance

(Spot-only) Order has insufficient spot balance to trade

Order

Oracle

Order price too far from oracle

Cancel

MissingOrder

Order was never placed, already canceled, or filled.

Important: Some errors are a deterministic function of the payload itself, and these are instead returned earlier as part of pre-validation. In this case only one error is returned for the entire payload, as some of these errors do not apply to a specific order or cancel.

Examples include: empty batch of orders, non-reduce-only TP/SL orders, and some forms of tick size validation.

For API users that use batching, it's recommended to handle the case where a single error is returned for a batch of multiple orders. In this case, the response could be duplicated ntimes before being sent to the callback function, as the whole batch was rejected for this same reason.

For API users that use historical orders, a list of all the cancel / reject historical order statuses can be found below:

Historical Order Status
Reason

marginCanceled

Canceled due to insufficient margin

vaultWithdrawalCanceled

Canceled due to vault withdrawal

openInterestCapCanceled

Canceled due to open interest cap

selfTradeCanceled

Canceled due to self-trade prevention

reduceOnlyCanceled

Canceled due to reduce only

siblingFilledCanceled

Canceled due to TP/SL child sibling fill

delistedCanceled

Canceled due to asset delisting

liquidatedCanceled

Canceled due to liquidation

scheduledCancel

Canceled due to scheduled cancel action

internalCancel

Canceled due to internal error

tickRejected

Rejected due to invalid tick price

minTradeNtlRejected

Rejected due to order notional below minimum

perpMarginRejected

Rejected due to insufficient margin

reduceOnlyRejected

Rejected due to reduce only

badAloPxRejected

Rejected due to post-only immediate match

iocCancelRejected

Rejected due to IOC not able to match

badTriggerPxRejected

Rejected due to invalid TP/SL price

marketOrderNoLiquidityRejected

Rejected due to lack of liquidity for market order

positionIncreaseAtOpenInterestCapRejected

Rejected due to open interest cap

positionFlipAtOpenInterestCapRejected

Rejected due to open interest cap

tooAggressiveAtOpenInterestCapRejected

Rejected due to price too aggressive at open interest cap

openInterestIncreaseRejected

Rejected due to open interest cap

insufficientSpotBalanceRejected

Rejected due to insufficient spot balance

oracleRejected

Rejected due to price too far from oracle

PreviousTimeouts and heartbeatsNextSigning

Last updated 14 days ago