Hyperliquid

Hyperliquid is an Onchain Venue for Opening, Resizing, and Closing Perpetual Positions

Hyperliquid is an onchain perpetuals venue where a trader chooses direction, margin mode, leverage, size, and order type, then manages the resulting position from the position row. An opening fill establishes exposure and an entry price. Adding size recalculates the weighted entry, while reducing size preserves that entry and realizes part of the PnL. A reduce-only order closes exposure without crossing zero into the opposite position.

Updated on 6 Aug 2026

Avoid a reversal when closing

An opposite-side close order becomes a reversal when its filled size exceeds the open position. The reduce-only flag prevents that mistake by allowing the order to remove exposure, never add the other side. The same question is answered in Hyperliquid staking.

A long position requires a sell to reduce it, while a short position requires a buy. Without reduce-only, an oversized fill passes through zero and establishes new exposure. On Hyperliquid, use reduce-only for partial exits, full manual closes, and resting exit orders. If no reducible position remains, the instruction is rejected or canceled rather than becoming a fresh trade.

Avoid a reversal when closing
Position action Order behavior Prerequisite
Open A buy creates or increases a long; a sell creates or increases a short Usable USDC margin and selected leverage
Resize upward A same-side fill adds exposure and recalculates the entry price An existing position within the asset's margin limits
Resize downward or close An opposite-side reduce-only fill removes exposure without reversal An existing position on the opposite side

The order ticket expresses the intended action, but the position row confirms what happened. A submitted close is not necessarily a completed close. Partial fills leave a smaller position, and a resting limit order leaves exposure open until more size matches. Compare the remaining position size with zero before treating the lifecycle as finished.

Margin mode before position size

Position margin has 2 principal modes: cross and isolated. Cross is the default and shares collateral among cross-margin positions, while isolated margin confines collateral and PnL to one asset's position.

Leverage accepts any integer from 1x to the asset's maximum. Initial margin equals position notional divided by leverage. At 5x, the formula reserves 20% of notional; at 10x, it reserves 10%. The maintenance-margin rate at maximum leverage equals 50% of the corresponding initial-margin rate. More leverage therefore leaves less equity between entry and forced position reduction.

Margin removal must leave the greater of the initial-margin requirement or 10% of total open notional. Cross positions also respond to unrealized PnL and funding elsewhere in the account. Isolated positions accept direct margin additions and removals. A displayed liquidation price remains an estimate because funding and other cross positions change the equity supporting exposure.

Build the entry from side, size, and order type

A perpetual entry combines the asset, long or short direction, size, margin mode, leverage, and execution instruction. A market order seeks an immediate match, while a limit order fills only at its stated price or better.

Once an EVM address connected through Rabby, MetaMask, or WalletConnect has usable USDC collateral, matching occurs on the HyperCore order book rather than Arbitrum. BTC, ETH, SOL, and HYPE perpetuals follow the same position lifecycle. Their allowable leverage, size precision, book depth, and margin tier still differ by market.

HyperCore matches orders through price-time priority. Perpetual prices accept at most 5 significant figures and no more than 6 minus the asset's szDecimals fractional digits. Sizes round to that asset's szDecimals, while integer prices remain valid regardless of significant-figure count. Good Til Cancel orders rest until filled or canceled; Immediate or Cancel orders remove any unmatched remainder immediately.

Position status after the fill

The position row records the state created by executed orders. Read its direction, signed size, entry price, mark price, unrealized PnL, margin use, leverage, and estimated liquidation price before submitting the next adjustment.

Unrealized PnL equals side multiplied by the difference between mark and entry prices, then multiplied by position size. The side multiplier is +1 for a long and -1 for a short. Entry price and displayed PnL are frontend tracking components; the underlying accounting rests on margin, fills, funding, and balance changes.

Account value includes unrealized PnL, whereas available balance also reflects margin committed to positions and orders. Portfolio charts provide 24-hour, 7-day, and 30-day views, sampled around every 15 minutes. Those charts describe account history. The live position row and fill records are the better controls for deciding whether an entry completed or exposure still remains.

Resize exposure without losing track of basis

Position resizing treats increases differently from reductions. A same-side fill increases absolute size and recalculates the entry price as a size-weighted average; an opposite-side reduction leaves the recorded entry price unchanged.

A 25% reduce-only fill leaves 75% of the original size open and realizes PnL only on the removed portion. The remaining position continues from its existing entry basis. Adding again produces a new weighted entry from the old open size and the added fill, so the latest execution price does not become the entry price by itself.

Cross margin released by a reduction immediately joins the shared account calculation. Other positions with negative unrealized PnL can consume part of it, leaving available balance below the margin label that disappeared. Isolated accounting stays with that position. Fixed-size TP/SL instructions also retain their specified size after a resize, so compare every open trigger order with the new exposure.

TP/SL orders as position instructions

Take Profit and Stop Loss orders use the mark price as their trigger. Once triggered, each instruction submits either a market close or a limit close against the order book.

The position form defaults a TP/SL instruction to the entire open position, effectively 100% of its size at trigger time. Entering a specific amount turns it into a fixed-size instruction that does not follow later resizing. TradingView chart controls allow trigger levels to be moved visually, while the position form remains the clearest place to confirm size and order type.

A TP/SL market order carries a fixed 10% slippage tolerance. A TP/SL limit order instead uses 2 prices: the mark-price trigger and the limit accepted after activation. A fast move beyond that limit leaves the order resting without a fill. Parent-linked OCO instructions remain untriggered while the parent is incomplete; manually canceling a partially filled parent also cancels its children.

Close cleanly with market or limit orders

A manual close order takes the opposite side of the current position and enables reduce-only. Market execution prioritizes immediate matching against available book liquidity; limit execution controls the worst accepted price but leaves the position open when no matching liquidity reaches that level.

Immediate or Cancel suits a close where unmatched size should disappear at once. Good Til Cancel suits a resting exit that remains active across later blocks. Reduce-only belongs on either choice. It keeps a delayed fill from reversing exposure after another order, TP/SL instruction, or manual action has already reduced the position.

After execution, confirm that position size reads zero and inspect the order list for obsolete instructions. A Filled status describes the submitted order, not the trader's broader intention. An order sized below the full position fills completely while leaving residual exposure, and a partially filled full-size order does the same until its remainder matches or is canceled.

Balance and funding after exit

Post-close accounting separates realized trade outcome from immediately usable collateral. Closed PnL reflects the price move and trading charge attached to closing fills, while total and available balances also account for every other cross position and resting order.

Funding applies for the interval during which exposure existed. Funding settles every 1 hour at one-eighth of the computed 8-hour rate, and the premium input is sampled every 5 seconds. The fixed interest component is 0.01% per 8 hours, equivalent to 0.00125% per hour, while the protocol funding cap is 4% per hour. Positive funding sends value from longs to shorts; negative funding reverses that direction.

The funding payment uses position size, oracle price, and the applicable funding rate. Consequently, two closes at the same displayed mark still produce different account changes when their holding intervals or execution fills differ. In cross margin, released collateral also supports remaining positions before it becomes withdrawable. Reconcile the position row, fills, funding entries, closed PnL, and available balance as separate records.

Use TWAP for a larger reduction

TWAP execution divides a larger order into smaller suborders sent every 30 seconds. Hyperliquid's TWAP constrains each suborder to 3% maximum slippage, making it an execution schedule rather than a promise that the entire requested size will fill.

When earlier suborders fall behind, later catch-up orders reach at most 3x the normal suborder size. A Scale order takes another route by placing multiple limit orders across a chosen price range. Either method needs reduce-only when its purpose is an exit. Post Only, also called ALO, keeps a limit order resting instead of matching immediately.

Track the remaining position size rather than the schedule's original target. Unmatched TWAP slices leave exposure open, and Scale orders continue resting until filled or canceled. Once the position reaches zero, cancel any outstanding exit instructions that no longer serve the trade. The complete lifecycle ends only when both the position state and relevant open-order state agree.

Helpful answers about Hyperliquid

Does closing a perpetual position send USDC back to Arbitrum?

Closing a perpetual position does not initiate an Arbitrum withdrawal. The close changes exposure and releases eligible collateral inside the account's HyperCore balance, although cross-margin requirements may keep some of that amount unavailable. Moving USDC to an external EVM address requires a separate bridge withdrawal, so the zero position and the receiving-wallet balance are separate states.

Are BTC, ETH, and SOL perpetuals settled in their underlying coins?

BTC, ETH, and SOL perpetuals do not deliver their underlying coins when closed. The contracts create price exposure, and reductions realize PnL into the account's collateral balance. Receiving the underlying asset requires a separate spot purchase or transfer path. Closing a BTC perpetual, for example, removes contract exposure rather than transferring BTC into the trader's wallet.

Could a sub-account close a position held by the master account?

A sub-account order does not directly change a position recorded under the master account. Each position belongs to the clearinghouse state of its designated account. The master account signs authorized actions for a sub-account, but the order must target that sub-account explicitly. Sub-accounts remain separate under portfolio margin as well, so their positions and collateral are not automatically merged.

Who owns a position opened by an approved API wallet?

The master account or designated sub-account owns the position, not the approved API wallet. The API wallet acts as a signing agent for authorized trading actions. Account data must therefore be queried with the underlying master or sub-account address. Automated resize and close instructions must target the same account state used for the original opening order.

When is a post-only close order rejected?

A post-only close order is rejected when its limit price would execute immediately upon arrival. Post Only, also called ALO, exists to add a resting order to the book. Move the limit away from executable levels or choose a regular limit or IOC instruction when immediate matching is intended. Keep reduce-only enabled when the order's sole purpose is removing exposure.

What happens to a GTC entry order after TP/SL closes the position?

A non-reduce GTC entry order remains active until it fills or is canceled, even after a separate TP/SL order closes the existing position. A later fill establishes fresh exposure. A reduce-only order that no longer reduces anything is rejected or canceled instead. Review all open orders after an automated exit because closing one position does not universally cancel unrelated instructions.

Do I need Arbitrum ETH for every resize or close?

Arbitrum ETH is not required for each HyperCore resize or close after collateral is available for trading. Those orders are native trading actions rather than Arbitrum transactions. Arbitrum ETH applies when the trader sends a deposit transaction through the standard USDC bridge route. The connected wallet or approved signing agent still authorizes every requested position action.