# Vaults overview

> What a HyperVault and HyperPerpEngine pair is, the three vault tiers, who can create one, and the daily UTC epoch.

Source: https://docs.degenhive.ai/vaults

A vault is a pair of contracts on HyperEVM (chain 999): a `HyperVault` that holds depositors' USDC and issues shares, and a `HyperPerpEngine` that trades the vault's HyperCore account. One factory call deploys both, and each pair is its own upgradeable proxy set.

> [!IMPORTANT]
> The vault contracts are not deployed yet and not externally audited. Addresses publish at launch on [Network](https://docs.degenhive.ai/network.md). Code on this page uses placeholders such as `VAULT` and `ENGINE`.

## How a vault works

The vault is an ERC-7540 asynchronous vault with an ERC-7575 share token (6 decimals, the vault address itself). Depositors queue USDC during a UTC day. Once per day, `roll()` prices the shares, takes fees, mints queued deposits and pays queued redemptions. The [depositor guide](https://docs.degenhive.ai/vaults/depositors.md) walks through each call.

Capital moves in one direction at a time:

1. Settled USDC sits in the vault as `idleUsdc`.
2. The keeper or manager calls `deployToEngine(amount)`. The engine holds it on HyperEVM as `evmIdleUsdc`.
3. The engine bridges USDC to its own HyperCore account and trades perps through CoreWriter limit orders.
4. To pay withdrawals, USDC comes back from HyperCore to the engine, and the vault pulls it at the roll.

The engine never uses a HyperCore API wallet. Only three callers can trade: the vault's keeper, its strategy manager and the council. Each step either follows the latest forecast round of the vault's job (`stepMarket`) or a target the caller supplies (`stepMarketTarget`). See [Trading](https://docs.degenhive.ai/vaults/trading.md).

NAV is `idleUsdc + engine.totalEquityUsdc()` minus fees owed. Engine equity is its HyperEVM idle USDC plus its HyperCore account value across tracked perp dexes and spot USDC. Pending deposits and settled-but-unclaimed USDC sit in the vault's balance but stay outside NAV.

## Flagship and third-party vaults

| | Flagship | Third-party |
|---|---|---|
| Who deploys | Council only, in every creation mode | Council, whitelisted creators or anyone, by `CreationMode` |
| Creation fee | None | `creationFeeUsdc` (10 USDC by default) |
| Fee terms set by | Council only | Strategy manager or council |
| Management fee | 100% to the protocol | Protocol take, rest to the manager |
| Performance fee | Royalties, forecasters, then the protocol | Protocol take, royalties, forecasters, then the manager |
| Drawdown latch | Optional (0 turns it off) | Required, 200 bps up to the tier maximum |

The Flagship runs a 1% management fee and a 25% performance fee. Every vault chooses its own fees within the bounds on [Fees](https://docs.degenhive.ai/vaults/fees.md).

## Tiers

Every vault declares a `VaultTier` in its DNA. The tier sets the ceilings the DNA must fit under and scales how much of equity one asset may take. These are the defaults in `HyperVaultConfig`:

| `VaultTier` | `maxGrossBps` | `maxNetExposureBps` | `maxDailyLossBps` | `maxDrawdownBps` | `assetWeightMultiplierBps` | Per-asset cap, market tier 1 / 2 / 3 |
|---|---|---|---|---|---|---|
| `FLAGSHIP` (0) | 50,000 (5x) | 5,000 (0.5x) | 1,000 (10%) | 5,000 (50%), or 0 | 10,000 (1x) | 25% / 10% / 3% |
| `INSTITUTIONAL` (1) | 50,000 (5x) | 5,000 (0.5x) | 1,000 (10%) | 2,500 (25%) | 10,000 (1x) | 25% / 10% / 3% |
| `COMMUNITY_ARENA` (2) | 50,000 (5x) | 30,000 (3x) | 1,000 (10%) | 5,000 (50%) | 40,000 (4x) | 100% / 40% / 12% |

Global floors apply on top: gross exposure at least 5,000 bps, daily loss stop at least 50 bps, drawdown latch at least 200 bps for third-party vaults. The council can change tier bounds with `setTierBounds` inside hard ceilings (gross 5,000–50,000, daily loss 50–1,000, drawdown 200–5,000, multiplier 10,000–100,000). A change applies to new vaults only, except `assetWeightMultiplierBps`, which every engine reads live.

Market tiers rank assets: 1 is majors, 2 is the top 50 plus HIP-3 markets, 3 is the long tail. A vault with `marketTier` 3 may trade tiers 1 to 3. Per-asset caps start from `tierMaxWeightBps` (25%, 10%, 3%), times the tier multiplier, capped at 100%.

## Vault DNA

DNA is the vault's permanent risk identity. The factory validates it, copies it into the engine and no setter exists. Only an engine implementation upgrade (72-hour delay) could change it.

```solidity
struct VaultDna {
    bool isFlagship;          // true iff vaultTier == FLAGSHIP
    uint8 marketTier;         // 1 majors, 2 top-50 + HIP-3, 3 long tail
    uint24 maxGrossBps;       // 5,000..50,000 (0.5x..5x)
    uint16 maxNetExposureBps; // <= maxGrossBps and the tier cap
    uint16 maxDailyLossBps;   // 50..1,000
    VaultTier vaultTier;
    uint16 maxDrawdownBps;    // 0 (flagship only) or 200..tier max
}
```

Execution knobs (`EngineRiskParams`) are separate and can change: tighten at once, loosen after 7 days. See [Risk](https://docs.degenhive.ai/vaults/risk.md).

## Who can create a vault

`HyperVaultConfig.creationMode` gates `HyperVaultFactory.deployStrategyVault`:

| `CreationMode` | Who may deploy a third-party vault |
|---|---|
| `OFF` (0, default) | Nobody. Only the council, and only flagships. |
| `WHITELISTED` (1) | The council and addresses on `creatorWhitelist` |
| `PERMISSIONLESS` (2) | Any address |

Check before you build: `canCreateVault(creator, false)` returns the answer for your address. Flagships are council-only in every mode.

## Public and private vaults

A vault is public unless it sets `whitelistEnabled`. On a private vault, only whitelisted addresses can request deposits, as owner and as controller. The compliance admin, the manager or the council maintains the list with `setWhitelistedLp(lp, allowed)`. With `whitelistTransfers` also on, shares can only move to whitelisted addresses. Redemptions are never whitelist-gated, so a removed depositor can always leave. The factory whitelists the manager automatically, and the compliance admin defaults to the manager.

## The daily epoch

The vault keeps one clock: the UTC day, `block.timestamp / 86400`. Each day has one roll.

- Requests made before 00:00 UTC settle at the next roll.
- From 00:00 UTC, the keeper, manager or council may call `roll()`.
- From 02:00 UTC, anyone may call it.
- If nobody rolls for several days, one roll covers them: the management fee accrues for every elapsed day.

Shares minted at a roll earn from that roll on, even before the depositor claims them.

## Roles

| Role | Set by | Powers |
|---|---|---|
| Council (`admin`) | `HyperVaultConfig` two-step admin | Every setter; the only fee-terms holder on flagships; `clearDrawdownStop`, `setEmergencyFlatten` |
| Strategy manager | Creator at deploy; council after | Fee terms, keeper, cap, whitelist, wind-down (third-party); risk params; trading |
| Keeper | Manager or council, `setKeeper` | Trading, bridging, `deployToEngine`, early roll window |
| Compliance admin | Manager or council | Whitelist settings |
| Protocol allocator | Council | A depositor with no minimum, no cap and no management fee |
| Operator | Each depositor, `setOperator` | Requests and claims for that depositor |

## Related

- [Create a vault](https://docs.degenhive.ai/vaults/create.md) Deploy a vault and engine pair through the factory.
- [Trading](https://docs.degenhive.ai/vaults/trading.md) How steps, bridging and CoreWriter orders work.
- [Risk](https://docs.degenhive.ai/vaults/risk.md) Stops, latches, flatten paths and wind-down.
- [Deposits & withdrawals](https://docs.degenhive.ai/vaults/depositors.md) ERC-7540 requests, daily rolls and claims.
