Hyperliquid separates resting orders from executed fills in its trading records
Last updated -Hyperliquid records executed spot and perpetual trades as fills, while unfilled orders can remain on the order book. Check the market, account, side, size and execution conditions before submission. Match the order record to its fills and resulting balance or position before sending another order.
Completed fills remain executed when a resting order is canceled, so cancellation cannot restore the previous position.
Immediate Execution and Resting Liquidity
Market and limit orders control how a trade seeks liquidity on the onchain order book. A market order seeks immediate execution against available orders. A limit order permits execution at its limit price or better. A buy limit caps the purchase price; a sell limit sets the lowest acceptable sale price. A crossing limit order can execute immediately, so choosing a limit does not automatically make the trade a resting order. A market order can fail with a no-liquidity error when no liquidity is available.
Time-in-force determines what happens to unmatched quantity. A good-til-canceled (GTC) order can leave a remainder on the book. Immediate-or-cancel (IOC) removes the quantity that cannot match immediately. Post-only, also labeled ALO for add liquidity only, prevents immediate matching and cancels an order that would cross.
Matching follows price-time priority, so equally priced resting orders compete by their arrival order.
The Selected Market and Its Trading Balance
Market selection connects the instrument being traded to the balance or position that the action changes. Spot trading exchanges the market's base asset against its quote asset, the asset used to state prices. A perpetual fill changes derivative exposure supported by collateral. Depending on the market and current position, a buy or sell can exchange spot tokens, open or enlarge a perpetual position or reduce existing exposure. API orders must identify the intended instrument with its market metadata. Spot and perpetual API orders use numeric asset identifiers derived from their respective market metadata. Mainnet and testnet identifiers can differ, and a display ticker may differ from the underlying market representation.
Account mode determines which balances support the selected action. Standard mode separates spot and perpetual balances, including balances across perpetual DEXs. Unified accounts share each asset's spot balance with cross-margin perpetual positions collateralized in that asset. Portfolio margin combines eligible assets and can automatically borrow against eligible collateral, subject to account eligibility and caps. Borrowed assets accrue interest. Once borrow caps are reached, additional margin must be supplied in the settlement asset. Read the available trading balance in the account's actual mode; a total portfolio value does not establish that every asset can fund the selected order. Confirm the selected subaccount as well; the signing connection alone does not identify which trading account an action targets.
Order Size and Book Depth
Order size describes the asset quantity being traded, while notional value describes that quantity at a specified price. Check which input the order form accepts. A collateral amount or leverage setting does not mean the same thing as position size, so confirm the side, quantity and price together using the selected market's permitted increments and minimum trade requirements. An order below its applicable minimum notional is rejected.
Book depth shows available quantity at successive price levels. The best bid or ask represents only the front of that book. A larger order can consume several levels and produce fills at different prices within its execution boundary; the midpoint between the best bid and ask is a reference rather than a promised fill price.
Slippage settings and limit prices constrain acceptable execution. Tighter boundaries can leave quantity unfilled when suitable liquidity disappears. A preview can change before submission because other orders can fill, enter or leave the book, so an estimated average price describes the displayed liquidity at that moment.
Position Direction and Reduce-Only Protection
Reduce-only is an execution restriction for an order intended to decrease an existing perpetual position. A sell reduces a long position; a buy reduces a short position. Check the current position direction before applying that restriction. An ordinary opposite-side order can close exposure and then open exposure in the other direction if its size exceeds the position. Reduce-only prevents that increase. It does not guarantee that the requested quantity will fill, and it does not close unrelated positions. Other reduce-only orders can be canceled if they no longer reduce the position.
Authorization and the Submitted Order
Order submission commits the configured trading action to validation and potential matching. Review the order form or signed payload for the market, account, side, quantity and price conditions. Check time-in-force and reduce-only separately because they govern different behavior. Attached trigger orders also need their own price and size review.
Authorization and order placement are distinct actions. An API-wallet approval authorizes that wallet to sign supported actions for the trading account, while an order action sends a specific trading instruction. Inspect the request's action type so a permission change is not mistaken for an order. A connection or approval message establishes no execution.
The last editable preview is not an execution receipt.
Once submitted, an order can match before a cancellation request takes effect. A valid signature authenticates the signer and signed payload, while the trading response and later records show whether the action was accepted or executed; inspect those records before treating the action as complete.
Accepted Orders and Actual Fills
API order responses distinguish an order resting on the book from an order that executed. A resting response supplies an order identifier, while a filled response includes executed size and average price. Inspect the per-order result inside the response: an outer success status can accompany an individual order error. Batched requests can also fail pre-validation before producing separate results for each order.
An open status means the order was placed successfully, without establishing that the requested trade has completed. Match the order identifier to the fills that belong to that order. A partial execution can leave both completed fills and an open remainder, so neither the original order size nor the remaining size alone describes the executed trade.
An order absent from the open-order view may have filled, been canceled or been rejected at placement. The order's historical status distinguishes these outcomes, while fill records establish whether any quantity traded; a canceled order can still have earlier fills that continue to affect the account.
Fill Prices, Fees and Account Reconciliation
Fill records describe executed trades through their instrument, side, quantity, price, time and order identifier. Compare these fields with the intended action. When an order has several fills, its executed quantity is the sum of their sizes, and its execution average weights each fill price by that fill's quantity.
Spot and perpetual trading have separate fee schedules, while maker or taker treatment follows how the trade supplied or consumed liquidity. Check the rate that applies to the account and market rather than importing a fixed rate from another instrument. An approved builder code can add a fee to eligible perpetual trades and spot sells. Builder fees do not apply to the buy side of spot trades.
A spot trade changes token balances, while a perpetual trade changes the position and its margin accounting. Unified accounts and portfolio margin report trading balances and holds through spot account state, while standard accounts keep the relevant balance views separate. A change in total account value is not, by itself, a measurement of the order's executed size.
Other activity can change balances during the same interval. Funding payments affect perpetual accounts; deposits, transfers and vault movements appear in separate ledger records. Include relevant movements when explaining a balance difference without treating them as fills from the selected order.
A Partial Exit With Different Time-in-Force Settings
In this hypothetical case, an account holds a long perpetual position of Q units and submits a reduce-only sell for S units, where S is smaller than Q. The selected market permits trading, the inputs meet its precision and minimum trade requirements and the account satisfies the applicable margin checks.
Only F units match at or above the sell limit, where F is positive and smaller than S. Under GTC, the remaining S - F units rest on the book while the position becomes Q - F units long. Canceling the remainder, once confirmed, leaves that smaller long position and no open remainder for this order.
Changing only time-in-force to IOC removes the unmatched S - F quantity automatically, assuming the same immediate fills. Neither configuration promises the full requested reduction; the completed quantity is F.
The matching fill sizes total F and show the sell direction, while a fresh position view shows Q - F units long. The order history and open-order view establish whether the remainder was canceled or is still resting.
A Missing Confirmation Without a Blind Retry
A missing confirmation after submission creates uncertainty about the order's outcome, especially if the interface disconnects. Stop resubmitting the same intended trade while checking its status. A second accepted order could add another execution to the account even when the first response never reached the screen.
Use the original order identifier or client order identifier when one is available. Check the correct trading account, selected market and recent fills. Refresh the corresponding balance or position view. API users can query order status and recover missed stream data through account information requests; a failed connection does not establish a failed trade.
Keep the next action tied to the confirmed state. A resting order may still be eligible for cancellation, while recorded fills already changed the account. An explicit rejection identifies a failed placement and may identify the input or account constraint involved. If records remain incomplete, another submission would increase uncertainty about total execution.
Canceling the Remainder or Changing the Order
Cancellation removes an order's future execution opportunity once the cancellation succeeds. Manually canceling a partially filled parent order also cancels its attached take-profit and stop-loss (TP/SL) orders. If you want exits for the resulting position, place separate TP/SL orders with the intended size. If that parent instead receives an insufficient-margin cancellation after a partial fill, its attached TP/SL orders are placed as if it had filled fully. Canceling a partially filled order does not reverse its completed fills. Check the remainder and cancellation status together, since an order can execute while a cancellation request is in flight. A missing-order cancellation error can mean the order already filled, already canceled or never existed.
Changing a limit price or quantity can alter whether an order immediately matches and how much exposure remains possible. Recheck the current position before modifying a reducing order. The original position may have changed through other fills, so an earlier size estimate may no longer describe the intended exit.
Waiting preserves the possibility that a resting remainder fills later, while canceling relinquishes that opportunity and leaves the already executed account change intact. Offsetting a completed fill requires another trade at the liquidity and terms available then, with its own fees.
Hyperliquid - common questions
Why Is a Price Rejected Even When the Order Size Is Valid?
Prices and sizes follow separate precision rules. Noninteger prices allow up to five significant figures, subject to a decimal limit of 6 minus szDecimals for perpetuals or 8 minus szDecimals for spot. Integer prices are exempt from the significant-figure limit. Sizes use the selected asset's szDecimals value. A size that passes validation therefore does not establish a valid price; automated orders must apply both rules.
Which Price Triggers a take-profit or stop-loss Order?
The mark price triggers take-profit and stop-loss orders. The last traded price or a chart's apparent touch does not establish that the trigger condition was reached. After activation, a market or limit order still needs executable liquidity. A limit exit can remain unfilled when the book moves beyond its acceptable price. Trigger activation and an executed closing fill are separate events, so inspect the resulting fills when checking an exit.
Does Every Order Require a Fresh Signature From the Main Wallet?
An approved API wallet can sign orders on behalf of the trading account. The main account authorizes that wallet, and the delegated wallet signs subsequent supported trading actions. A fresh main-wallet prompt is therefore not required for every order placed through that arrangement. The approval itself creates no fill. Check which signer is authorized and whether the actual order reached the trading system, especially when changing an automated integration.
When Can an Accepted Perpetual Order Be Canceled for Insufficient Margin?
A resting perpetual order can be canceled if it lacks sufficient margin when matching is attempted. Margin checks occur when an order opens and again for the resting side at each match. Changing prices or other account activity can alter the margin available after placement. Earlier acceptance therefore does not reserve an unconditional right to fill. A margin-canceled status identifies that outcome, while any previous fills remain part of the account.
Can a Live Fill Feed Repeat Trades After Reconnecting?
A reconnected fill stream can deliver a snapshot containing trades that the client already processed. Snapshot messages carry the isSnapshot flag. Applications that combine stored history with live updates should recognize those repeated records before adding their quantities or fees again. The subscription acknowledgment confirms the subscription. The initial fill snapshot supplies historical trades, so receiving it does not establish a new execution. Use the fill records themselves to reconcile actual execution.
What Does a Negative Fee in a Fill Record Mean?
A negative fee represents a rebate in the fill record. Preserve its sign when reconciling trading costs, and read feeToken to identify the asset in which the fee was recorded. If builderFee appears, the total fee already includes that component, so adding it again would overstate costs. A rebate entry describes that fill's accounting; it does not establish that every resting order or later trade receives the same treatment.