Measure execution against a recorded reference at your actual order size. A tight price limit can control fill prices while leaving part of the hedge unfilled.
A small trading fee does not guarantee a cheap perpetual trade. Your order may consume several price levels, so the average fill can differ materially from the best quote you first saw. The useful question is: what would the complete order cost at the intended size, relative to a clearly recorded reference price?
This guide calculates an order's volume-weighted average fill price, separates spread crossing from additional depth cost, and shows why a tighter limit can leave a funding hedge only partly filled. Every order-book level and fee below is hypothetical, not a current exchange quote.
Choose the reference before measuring slippage
Record the best bid, best ask and timestamp before submitting an order. The midpoint is their average:
Midpoint = (best bid + best ask) / 2
With a $99.90 bid and $100.10 ask, the midpoint is $100.00. The full bid-ask spread is $0.20, or 20 basis points relative to that midpoint. One basis point is 0.01%.
Buying immediately at $100.10 already costs 10 basis points relative to the midpoint, even if every unit fills at the best ask. Measuring against the best ask would exclude that initial spread crossing. Both benchmarks can be useful, but the denominator and reference must be explicit.
The calculations here use the pre-order midpoint for every basis-point comparison. They measure executed-price shortfall; they do not attempt to price the opportunity cost of an unfilled order.
Walk the order book for your actual quantity
Assume a linear USD-settled perpetual with one contract unit representing one unit of the underlying, sufficient margin and these visible asks:
| Ask price | Available quantity at this level | Cumulative quantity |
|---|---|---|
| $100.10 | 40 units | 40 units |
| $100.20 | 60 units | 100 units |
| $100.50 | 100 units | 200 units |
A buy for 150 units would take 40 at $100.10, 60 at $100.20 and 50 at $100.50 if the book remained unchanged and those quantities were available to the order.
Execution notional = 40 × $100.10 + 60 × $100.20 + 50 × $100.50 = $15,041
Order VWAP = sum of (fill quantity × fill price) / total filled quantity
The resulting average is $15,041 / 150 = $100.273333... per unit. This is the average of this order's fills, not a market-wide session VWAP indicator. Use unrounded values for subsequent calculations.
Hyperliquid's order-book documentation describes price-time matching and valid price and size increments. Check the contract multiplier, tick size and lot size of the specific market before translating a displayed quantity into notional exposure.
Separate the spread from additional depth cost
At the $100.00 reference midpoint, 150 units have $15,000 reference notional. The buy spends $15,041, so the executed-price shortfall is $41:
Buy shortfall = execution notional − filled quantity × reference midpoint
Shortfall in basis points = shortfall / reference notional × 10,000
That is 27.3333 basis points. For a sell, reverse the dollar comparison: reference notional minus execution proceeds. Positive shortfall then consistently means worse execution than the reference.
The $41 can be decomposed using the same midpoint denominator:
| Component | Calculation | Dollar cost | Basis points |
|---|---|---|---|
| Crossing from midpoint to best ask | 150 × ($100.10 − $100.00) | $15 | 10.0000 |
| Additional cost beyond best ask | $15,041 − 150 × $100.10 | $26 | 17.3333 |
| Total executed-price shortfall | $15 + $26 | $41 | 27.3333 |
Do not add another $15 spread allowance to the $41 total: the total already includes it. The $26 is the extra cost of walking this static book beyond its best ask. It is not an estimate of how your trade will causally change future market prices.
Add fees using actual execution notional
Suppose the account pays a hypothetical taker fee of 0.04%, or four basis points. Apply it to the $15,041 execution notional:
Fee = $15,041 × 0.0004 = $6.0164
The entry's price shortfall plus fee is $47.0164, approximately $47.02, or 31.3443 basis points of the $15,000 midpoint reference notional. The combined figure is slightly more than 27.3333 plus four because the fee uses the actual fill notional, not the reference notional.
This fee is an invented input, not a statement of a current Hyperliquid account tier. Hyperliquid's fee documentation illustrates why fee schedules and account conditions need separate verification. Include applicable market-specific charges or discounts when obtaining your own estimate.
Test size instead of extrapolating a small quote
The same hypothetical book produces these results for different buy sizes:
| Buy quantity | Execution notional | Average fill price | Shortfall versus $100 midpoint | Shortfall in basis points |
|---|---|---|---|---|
| 40 units | $4,004 | $100.1000 | $4 | 10.0000 |
| 100 units | $10,016 | $100.1600 | $16 | 16.0000 |
| 150 units | $15,041 | $100.2733 | $41 | 27.3333 |
| 200 units | $20,066 | $100.3300 | $66 | 33.0000 |
These rows exclude fees. A quote for 40 units does not justify assuming the same per-unit cost for 200. For an order larger than the displayed 200 units, this snapshot alone cannot calculate the remaining fills.
Splitting an order into pieces does not, by itself, recreate consumed liquidity. If the book never replenishes or changes, consuming the same levels in smaller pieces gives the same aggregate fill notional before any differences in fees. In practice, time introduces new prices and fill uncertainty; it does not guarantee a cheaper result.
Understand the trade-off of an IOC limit
Now keep the planned 150-unit buy but set an Immediate-or-Cancel limit at $100.20. In this unchanged-book scenario, only 100 units are available at or below the limit. Those fills total $10,016, averaging $100.16; the remaining 50 units are canceled.
The tighter price bound reduces executed size. If a short for 150 units has already filled on another venue, the pair now contains a 100-unit long and a 150-unit short: 50 units of net short exposure, worth $5,000 at the reference price. That figure is exposure, not an immediate $5,000 loss.
Hyperliquid's order-type documentation distinguishes limit orders, IOC and Post Only orders. IOC does not mean that the full requested size must fill. Post Only constrains an order to resting execution; it does not promise a fill or simultaneous execution with a hedge elsewhere. Check the relevant venue's behavior rather than treating every limit order as a maker order.
Compare an estimate with actual fills
Save the pre-order reference and timestamp, intended quantity, limit settings, actual fills and actual fees. Recalculate the weighted average from the fills rather than comparing only the first or last execution with the quote.
Record unfilled quantity separately. A low average cost on a small partial fill does not demonstrate that the intended position was completed cheaply. For a paired trade, track the remaining unmatched quantity after each fill and the conditions for reducing or completing that exposure.
Use PerpsMania's PerpDEX comparison to shortlist markets and fee schedules, then obtain size-specific quotes on the venue. Our full arbitrage cost guide extends entry costs to the complete round trip, while the margin-buffer guide explains why an execution plan must also preserve adequate collateral on each account.
Sources and assumptions
- Hyperliquid: order book — matching priority and valid price and quantity increments.
- Hyperliquid: order types — limit, IOC and Post Only mechanics.
- Hyperliquid: fees — example of venue-specific fee schedules and account conditions.
Sources checked on 31 October 2026. The asset price, book quantities, contract multiplier, fee and hedge fills are hypothetical. The model assumes an unchanged order book, adequate margin, full access to the displayed depth and USD settlement. It excludes funding, price changes during submission, liquidation, network costs and taxes. A snapshot-based estimate is not a promised fill or a recommendation to trade a particular size. RFQ and automated-market-maker venues require their own quote and execution models.
Check your own assumptions
Use the guide as a framework, then inspect the relevant markets and inputs on PerpsMania.
Compare PerpDEX markets and feesEducational material, not personalized investment advice. Numerical examples are hypothetical unless explicitly identified as sourced market data. Perpetual trading can result in loss of all posted collateral. Some product pages contain referral links; PerpsMania may benefit when you use them.