Hyperliquid executes spot and perpetual trades through onchain order books
Hyperliquid is a layer 1 blockchain that runs spot and perpetual trading through onchain order books. Spot trades exchange token balances; perpetual contracts create price exposure backed by collateral. Order status shows what remains open; fills and account records show what executed and which balances or positions changed.
Updated -From a submitted order to the account record
A trading instruction identifies the market, direction, size, and execution conditions before HyperCore attempts to match it. HyperCore is the blockchain component that handles the native trading books. Its matching engine prioritizes price, then time among orders at the same price.
An accepted order can remain open without producing a trade. A fill records an executed quantity and price. Partial execution leaves a difference between the requested size and the amount actually traded. The order conditions determine whether that remainder stays available for matching or disappears.
The execution record connects the instruction to its financial effect. Fill data includes the order identifier, traded size, execution price, fee, and fee token. Those fields allow reconciliation against the selected account rather than against a confirmation message alone. Several fills can belong to the same order.
Compare the total filled size with the submitted size and check the status of any unfilled remainder. Then compare the expected balance or position change from those fills and fees with the account record, accounting for funding, transfers, and any borrowing.
For spot trading, reconciliation concerns the assets exchanged and the resulting balances. Perpetual accounting also concerns the position and its margin. Displayed entry prices and profit figures summarize that accounting; they do not replace the underlying trades and balances. Changes elsewhere in the account can also affect a portfolio total.
Spot holdings and perpetual exposure
Spot markets exchange the assets in a listed pair, while perpetual markets provide long or short exposure through a derivative. A perpetual contract has no scheduled expiry. Holding one creates continuing margin and funding obligations, even after the opening order has finished executing.
| Market action | What execution changes | Instrument scope |
|---|---|---|
| Spot purchase | Acquires the base asset using the quote asset | The selected listed spot pair |
| Spot sale | Exchanges the base asset for the quote asset | The selected listed spot pair |
| Open or increase a perpetual long | Creates or increases positive price exposure | The selected perpetual contract and its collateral rules |
| Open or increase a perpetual short | Creates or increases negative price exposure | The selected perpetual contract and its collateral rules |
The perpetual rows describe opening or increasing exposure. An opposite-direction trade can instead reduce an existing position. A funded spot purchase creates an asset balance. With portfolio margin, an insufficient trading balance can trigger automatic borrowing against eligible collateral. Borrowed assets accrue interest, so the account mode remains relevant to this distinction.
Where does trading collateral sit?
The account mode determines whether spot and perpetual activity use separate balances or share collateral. Standard mode separates spot balances and balances across perpetual venues. Unified accounts use a single balance for each asset, including spot holdings and cross-margin positions collateralized in that asset. Portfolio margin combines eligible assets under portfolio-level collateral rules, subject to account eligibility requirements and asset-specific caps. When borrowing caps are reached, additional margin must come from the settlement asset.
Cross margin shares collateral within the scope permitted by the account mode. Isolated margin allocates collateral to an individual position. Some markets restrict the available margin modes or prevent margin removal. These conditions affect how much balance remains available for another order or withdrawal. A wallet total alone therefore does not establish the amount available to a particular market.
Wallet access and the wider blockchain
Trading access supports an EVM-compatible wallet or email login, with funding routes determined by the chosen interface and asset. HyperCore holds the native order books; HyperEVM supports general-purpose smart contracts within the same blockchain. A deposit intended for an application and a balance available for native trading can occupy different execution environments. The destination must match the intended use. Sharing a blockchain does not make every asset balance immediately available to every application.
Execution prices, fees, and funding
A limit order sets an acceptable execution price, while immediate execution depends on available opposing liquidity. Larger orders can consume liquidity at several prices. The spread and book depth therefore affect the average fill price. Time-weighted average price orders divide execution into smaller orders over a chosen duration, but market conditions can prevent the full requested quantity from filling.
Trading fees also depend on the applicable schedule, account tier, and whether execution adds or removes liquidity. Spot and perpetual markets have separate schedules. Market-specific adjustments and interface builder fees can affect the charge. A quoted trading fee alone does not describe the difference between the anticipated price and the eventual average fill.
Perpetual funding transfers value between long and short holders at scheduled intervals. Its direction and amount depend on the applicable funding calculation and the position held. Funding can change the account balance without a new trade, so a complete reconciliation includes funding entries alongside fills. Future payments cannot be inferred from one displayed rate.
What can stop an order from completing?
Insufficient balance or margin, invalid price increments, unavailable liquidity, and market limits can prevent an order from executing. A rejection identifies a different problem from an order that remains open. Post-only instructions also reject immediate matching because their purpose is to add resting liquidity. Repeating an unchanged instruction does not resolve those conditions.
An uncertain response calls for a status lookup before another submission. An order may already have filled even when the interface did not display confirmation. The order identifier and fill history distinguish that case from a rejection or an outstanding remainder. Canceling an unwanted remainder limits further execution, but it cannot reverse completed fills. A cancellation response also needs interpretation: a missing order may never have been placed, or it may already be filled or canceled.
Position maintenance and the exit boundary
Cross-margin positions become subject to liquidation when the relevant account equity falls below their maintenance margin requirement. Mark-price movements and funding can change that relationship after entry. Cross-margin positions can also affect one another through shared collateral. Isolated positions use their own allocated margin and position value for liquidation calculations. Portfolio margin applies its maintenance rules across the eligible portfolio. Closing exposure requires executed closing trades; removing an outstanding entry order leaves existing exposure intact. A completed position exit therefore concerns the remaining position size, while withdrawing funds remains a separate action with its own balance and transfer conditions.
Before you start with Hyperliquid
Can a limit order incur a taker fee?
A limit order can incur a taker fee when it immediately matches resting liquidity. The limit controls the acceptable price; it does not automatically make the order a maker order. Post-only adds a separate condition that prevents immediate matching. The applicable fee still depends on the market and account schedule.
Do I need a gas token for every Hyperliquid trade?
Native HyperCore trading does not require a gas payment for each trade. Trading fees still apply, and deposits or withdrawals can involve separate network costs. HyperEVM transactions use HYPE for gas. The relevant requirement therefore depends on whether the action is native trading, a transfer, or a smart-contract transaction.
Which price triggers a perpetual stop-loss order?
The mark price triggers perpetual take-profit and stop-loss orders. Triggering activates the order; the subsequent execution depends on its market or limit conditions. A stop-limit order can remain unfilled if available prices move beyond its limit. The trigger price therefore does not guarantee the closing price.
What happens to attached exits when I cancel a partially filled parent order?
If you cancel a partially filled parent order, its attached take-profit and stop-loss orders are also canceled. If insufficient margin causes the cancellation instead, the attached exits are placed as though the parent order had fully filled. After your cancellation, the filled portion can leave an existing position without those attached exits. To set TP/SL exits for that remaining position, place them separately, for example as position-associated orders. This behavior concerns exits attached to a parent order, rather than every independently placed exit order.
How does reduce-only prevent an accidental position reversal?
Reduce-only constrains an order to reducing an existing position instead of opening exposure in the opposite direction. An instruction that would increase exposure can be rejected or canceled under that condition. Reduce-only does not guarantee execution, since the order still needs acceptable prices, available liquidity, and an eligible position to reduce.
Is my Hyperliquid trading activity private?
HyperCore trading activity is publicly recorded onchain. Orders, cancellations, trades, and liquidations form part of that transparent record. Account-address queries can also retrieve trading information, including fills. Wallet control authorizes account actions, but it does not make those actions confidential.