Pricing and fees
How fills are priced, and the spread, trade, borrow, and liquidation charges.
Every fill uses Hyperliquid's mark price for the asset, read in the block that
executes the request. The vault never quotes its own price and never charges for
price impact. A quote(sizeDelta) view returns the price and fee a fill would
get at the current mark.
Charges
| Charge | Formula | Destination |
|---|---|---|
| Spread | spreadBps on each side of the mark | The insurance buffer, implicitly |
| Trade fee | tradeFeeBps × notional, on open and on close | The insurance buffer |
| Borrow fee | Entry notional × the growth of the borrow index since the position's last charge | The insurance buffer |
| Liquidation penalty | Up to liquidationPenaltyBps × notional, out of remaining equity | liquidatorShareBps to the liquidator, the rest to the buffer |
A long fills at the mark plus the spread and closes at the mark minus it; a short is the reverse. The trade fee is taken from collateral when opening, so margin is collateral minus the fee.
Borrow fee
The borrow fee pays for the hedge's funding and the HyperCore margin it ties up
while a position is held. It accrues on entry notional at borrowBpsPerDay,
pro rata by the second, and is charged from margin on close, on liquidation,
and on addMargin. Health checks and liquidation include the accrued fee.
The fee follows one global borrow index, the running sum of borrowBpsPerDay
times elapsed seconds. Each position stores the index at its last charge.
Rate changes are not retroactive
The index is checkpointed before a new rate applies, so each rate covers only the time it was in force. Raising the rate never charges a position for time held before the change, and lowering it never forgives time already accrued.
Refunds
A request that is cancelled, for any reason, returns all of its collateral and
pays no fee. Cancelled requests include a price beyond acceptablePrice, a
failed cap, a pause, and an expired window.
Continue with risk controls for the caps and liquidation, or parameters for the bounds on each rate.