Vault value
Every deposit and redemption is priced from the vault's net asset value, which the contract computes itself from its own HyperEVM balance and its HyperCore account. It returns a range rather than one number, so a price pushed for a moment cannot move value between holders.
Three prices: spot, oracle, mark
| Price | What it is | Used for |
|---|---|---|
| Spot | The last price on HyperCore's own spot book for the coin. | One end of the spot leg's range; the guardian's unwinding. |
| Oracle | Hyperliquid's oracle for the perp: a median of spot prices on external venues, which a trade on HyperCore's own book cannot move. | The other end of the spot leg's range; the value of the short; the reference for the operator's spot orders. |
| Mark | The price Hyperliquid marks perp positions at, built from the oracle and the perp's own book. | Reference for perp orders and for the margin and balance checks. |
HyperCore reports the short's account value at the mark price. The vault moves it to the oracle before adding it up, by adding size × (oracle − mark) (the size is negative for a short). With both legs valued at the oracle, they cancel at one price, and a gap between mark and oracle, which comes and goes with the perp's own order book, does not appear in the vault's value.
Which end prices what
The two ends of the range differ by the spot coins times the gap between the spot price and the oracle. Each side of a settlement gets the end that protects the holders who stay:
| Operation | Priced at | Why |
|---|---|---|
| Deposits (settleEpoch) | navHigh | A depositor cannot buy shares cheaply because the spot book dipped. |
| Epoch redemptions (settleEpoch) | navLow | A redeemer cannot take out more because the spot book spiked. |
| Instant redemptions | navLow | Same reason, plus the instant-exit fee. |
| Performance fee | navLow | A pushed spot price never triggers a fee. |
| Operator's cash buffer | navLow | The minimum cash and the cash owed to queued redemptions in depositToCore. |
Example: a vault with $60,000 of cash and margin and 1,000 coins. The oracle says $50.00, the spot book $50.20. Then low = 60,000 + 1,000 × 50.00 = $110,000 and high = 60,000 + 1,000 × 50.20 = $110,200. New shares cost the high value, leaving shares pay out at the low one.
The spot deviation bound
A thin spot book can be pushed for a block. The range already keeps that from favouring the side that pushed; the bound keeps it from mattering at all beyond a set size. In the strict read, the vault refuses to price if the spot price is more than maxSpotDeviationBps away from the oracle, reverting with SpotOffOracle(spot, oracle).
- The bound is set per vault, above zero and at most
MAX_SPOT_DEVIATION_BPS= 1,000 (10%). - It only applies while the spot leg is worth more than $1,000 at the oracle (
MIN_GUARDED_EXPOSURE): below that, a gap moves too little to be worth refusing. - Whoever chooses the moment of a settlement can therefore move at most the bound times the spot leg between holders, and only in the direction the range already protects against.
Strict and tolerant reads
The same calculation runs in two modes. Users, the operator and anyone settling an overdue vault get the strict read; the guardian's and the owner's settlements get the tolerant one.
| Strict | Tolerant | |
|---|---|---|
| Oracle price missing | Reverts NoPrice | Uses the spot price in its place |
| Mark price missing with a short open | Reverts NoPrice | Takes the account value as HyperCore marks it |
| Spot price missing | Counts as a full deviation: reverts SpotOffOracle above $1,000 of spot, else uses the oracle | Uses the oracle in its place |
| Spot beyond the deviation bound | Reverts SpotOffOracle | Prices anyway; redemptions still use the lower price |
| Used by | navRange(), redeemInstant, the operator, public settlement | Guardian and owner settlement, and the very first settlement |
The tolerant mode exists for the cases where a strict read would freeze every exit: a perp that Hyperliquid delists or halts (its price reads zero or the read fails), or a coin whose spot depegs from the oracle. In those cases the guardian or the owner can still settle, valuing what is left, and holders get out through the epochs. Price reads never revert on their own; only the strict mode turns a missing price into a revert.
Borrowed USDC
Some HyperCore margin modes let an account borrow USDC against its spot holdings. The vault has no function that enters such a mode, but if the account ever ended up borrowing, leaving the loan out would overstate the vault. So the calculation reads the account's USDC borrow from Hyperliquid's borrow and lend precompile and subtracts it. If that read is unavailable, it counts as zero.
Why the reads are gas-capped
On HyperEVM, a read precompile that fails does not return quickly: it consumes all the gas it was given. The mainnet test of the first vault found the borrow and lend precompile failing for every account, and with the whole call's gas forwarded, each value read cost about 29 million gas.
The vault now gives the borrow read and each price read (spot, oracle, mark) at most 30,000 gas, far more than a successful read needs. A failing read costs at most that, returns zero, and the strict and tolerant rules above decide what zero means. A full value read then costs on the order of 200,000 gas.