Deposits, redemptions, epochs
A basis vault does not mint or burn shares on demand. Deposits and redemptions are requests, collected during an epoch and settled together at the vault's value at the end of it. Small exits can skip the wait and be paid at once from the vault's cash.
Why requests, not instant swaps
A deposit only earns once its USDC has been turned into spot coin and a matching short on Hyperliquid, and a redemption only pays once part of the position has been unwound back to USDC. Both take trades on HyperCore and transfers between HyperEVM and HyperCore. Pricing each request on its own, at the moment it arrives, would let late arrivals pay less than the real cost of getting in or out, and leave it to the holders who stay.
Batching requests into epochs (the pattern of ERC-7540 asynchronous vaults) solves that: every request in an epoch gets the same price, measured at settlement, and the vault has the time it needs to trade.
- Epoch 7Requests collect: deposits and redemptions wait in the epoch.
- SettlementPriced at the vault's value; filled pro rata if cash is short; claims open.
- Epoch 8The operator builds or unwinds the position for the new flows.
The functions
// Deposits
requestDeposit(uint256 assets, address receiver)
claimDeposit(uint256 epoch, address user) returns (uint256 shares)
cancelDeposit() returns (uint256 assets)
// Scheduled redemptions
requestRedeem(uint256 shares, address receiver)
claimRedeem(uint256 epoch, address user) returns (uint256 assets)
cancelRedeem() returns (uint256 shares)
// Instant redemption from cash
redeemInstant(uint256 shares, uint256 minAssets) returns (uint256 assets)
// Closing an epoch
settleEpoch()- requestDeposit
- Pulls
assetsUSDC from the caller and queues it for the current epoch on behalf ofreceiver. At leastMIN_DEPOSIT, 1 USDC. Refused while the vault is paused or closing. - requestRedeem
- Moves
sharesfrom the caller into the vault's escrow and queues them for the current epoch. Always allowed, paused or not. Queued shares keep their share of gains and losses until settlement. - claimDeposit
- After the epoch settles: transfers the receiver's shares, in proportion to its part of the epoch's deposits. Anyone may call it for a user; the shares always go to that user.
- claimRedeem
- After the epoch settles: pays the user's USDC, and hands back any shares that could not be redeemed because cash was short. Anyone may call it for a user.
- cancelDeposit / cancelRedeem
- Take back a request still queued in the current epoch. Only possible when the vault is paused, closing or overdue: queued funds are never stuck behind a settlement that cannot happen.
- redeemInstant
- Burns shares and pays at once from the vault's free cash, for a higher fee, within a cap per epoch. Reverts if the payment would be less than
minAssets.
How long an epoch lasts
An epoch opens when the previous one settles. Two parameters bound how long it stays open:
| Parameter | Meaning | Bound in the contract |
|---|---|---|
minEpochDuration | The operator cannot settle an epoch younger than this, so holders have time to queue before cash is counted. | At least the cooldown |
maxEpochDuration | Past this, the epoch is overdue: anyone may settle it, and the operator loses its powers until a settlement happens. | Above the minimum, at most 7 days |
cooldown | Seconds after any HyperCore order or transfer before the next action or a settlement, so every check reads the previous action's result. | 5 seconds to 10 minutes |
The guardian and the owner may settle at any time, as long as the cooldown has passed. Within those bounds the operator settles when it has done the trading the epoch needs.
What settleEpoch does
- 1Reads the vault's valueCalls the vault's value calculation, which returns a range:
navLowandnavHigh. The two differ only when the coin's spot price and its oracle price disagree. See Vault value. - 2Charges the performance feeIf value per share is above the high-water mark, new shares go to the fee recipient first, so this epoch's requests are priced after the fee. See Fees and high-water mark.
- 3Prices deposits at the high endShares minted = deposits after the entry fee × supply ÷ navHigh. A newcomer never buys in below what the vault could be worth.
- 4Prices redemptions at the low endUSDC released = shares × navLow ÷ supply, after the exit fee. A leaver never takes out more than the vault is surely worth.
- 5Pays from cash, pro rata if shortRedemptions are paid from the USDC on HyperEVM, this epoch's deposits included. If that is not enough, every redemption in the epoch is filled by the same fraction.
- 6Opens the next epochSets aside the USDC for claims, resets the instant-exit allowance, snapshots the fees for the new epoch and emits
EpochSettled(epoch, navLow, navHigh, sharesMinted, sharesBurned, assetsReleased).
Worked example
A vault with 100,000 shares, worth between $103,900 (low) and $104,000 (high), already at its high-water mark so no performance fee is due. The entry and exit fees are 0.10% each in this example. During the epoch, deposits of $20,000 and redemptions of 10,000 shares were queued. The vault holds $6,000 of free cash on HyperEVM.
The cash covers every redemption, so all 10,000 shares are burned. Depositors claim 19,211.54 shares between them; redeemers claim $10,379.61. The supply becomes 109,211.54 shares. Value per share rises from $1.03900 to $1.03945: the entry and exit fees and the gap between the high and the low price stay with the vault, and the high-water mark rises by the same amount, so none of it is later charged as performance.
Partial fills and the unpaid flag
A settlement never waits on the operator to bring cash back: it pays what it can and hands the rest back. But an epoch that leaves redemptions unpaid changes the vault's state:
shortfallis set: the operator may not move any USDC from HyperEVM to HyperCore until a later settlement pays every queued redemption in full.unpaidSincerecords when redemptions first went unpaid. If they stay unpaid for longer thanmaxEpochDuration, the vault counts as overdue, exactly as if an epoch had run past its deadline.- Even before any shortfall, the operator must leave on HyperEVM the cash owed to redemptions already queued in the current epoch when it moves USDC to HyperCore.
What an overdue vault allows is on Operator limits and safety.
The first epoch and dead shares
The first settlement with deposits starts the share supply. Shares have 18 decimals and USDC 6, so the first depositors get 1012 share units per micro-USDC: one share per dollar. Out of that first mint, DEAD_SHARES (1015 units, a thousandth of a share) go to the address 0xdead, where nobody can spend them.
The dead shares keep the supply above zero for good. Without them, if every holder left, whatever the last holders left behind (fees, dust below the coin's lot size) would go to the next depositor. The minimum deposit of 1 USDC guarantees the first epoch always covers them. Anything the vault already held before the first deposits, such as the change left after its HyperCore account was activated, counts toward those first depositors.
Instant redemptions
redeemInstant(shares, minAssets) pays at once from the vault's free cash on HyperEVM, the USDC that is neither waiting for an epoch nor set aside for claims. The operator keeps part of the vault in cash for this: when moving USDC to HyperCore it must leave at least minCashBps of the vault's value behind.
- Priced at the low end of the value range, with the instant-exit fee taken off. The fee stays in the vault.
- Capped per epoch in total, across all users, at
instantCapBpsof the vault's value; the allowance resets at each settlement, and the operator cannot settle an epoch younger thanminEpochDurationto reset it early. - Not held back by the cooldown. A HyperCore action still in flight can only make the value read low, never high, so it can cost the redeemer, not the vault, and
minAssetsbounds that cost. - Still possible while the vault is paused or closing. It does refuse to price while the spot price is too far from the oracle (see Vault value).
Example: a vault worth $103,900 with 100,000 shares and an instant fee of 0.30%. Redeeming 1,000 shares pays 1,000 × 1.039 × 0.997 = $1,035.88 in the same transaction. With a cap of 2% of value, instant redemptions in the epoch can total $2,078 across all users.