NAV Settlement Flow
NAV settlement in King's Vault V2 is a secure two-step (propose-confirm) process. It prevents single-block flash loan manipulations and allows the Admin to verify values before performance fees are minted.
sequenceDiagram
participant Keeper
participant Admin
participant Controller
participant Vault
participant Strategy
Keeper->>Controller: proposeValues(vault)
Controller->>Vault: totalSupply()
Controller->>Vault: idleAssets()
Controller->>Strategy: totalAssets()
Controller->>Controller: store pending epoch
Admin->>Controller: confirmValues(vault, epoch)
Controller->>Controller: validate epoch and freshness
Controller->>Controller: promote pending to confirmed
opt profit and manager configured
Controller->>Vault: mintFeeSharesOnlyForController(manager, shares)
end
Propose Values
The Keeper initiates the process by calling proposeValues(vault). The Controller takes a snapshot of the following fields:
| Field | Source |
|---|---|
assets |
totalStrategyAssets(vault) + IVault(vault).idleAssets() |
supply |
IERC20(vault).totalSupply() |
pnlBasis |
activeBookValue + recalledYield |
pnl |
Absolute difference between totalStrategyAssets and pnlBasis |
isProfit |
totalStrategyAssets >= pnlBasis |
Confirm Values
The Admin finalizes the settlement by calling confirmValues(vault, epoch).
| Check | Failure |
|---|---|
Proposal is no older than MAX_PROPOSAL_AGE = 1 hours |
ProposalStale(pendingTimestamp, currentTimestamp) |
| Epoch equals latest pending epoch and is greater than confirmed epoch | EpochMismatch(expected, actual) |
Caller has DEFAULT_ADMIN_ROLE |
AccessControl revert |
Performance Fee Shares
If the confirmed epoch is profitable and a fee manager is configured, the Controller instructs the vault to mint fee shares directly to the manager. This naturally dilutes existing holders to pay the performance fee.
fee = pnl * feeRate / 1_000_000
shares = supply * fee / (assets - fee)
If the confirmed epoch is a loss (isProfit == false), the Controller reduces the activeBookValue to match the new reality and mints no fee shares.