The three accumulators
All three are monotonic — they only grow — which is what makes the accounting simple to verify and impossible to game by cycling funds.
The fee rule
At each outbound transfer, the vault computes new profit:Properties
feeRateis immutable — set at deployment, capped by the vault generation, no setter exists.- Event-time valuation. Every accumulator update uses the accepted price feed at that moment and emits an event, so the entire fee history is reconstructable from the chain.
- Stale feed ⇒ waiver. If a required feed is stale at the gate, the fee is zero and a waiver event is emitted — the book never records a guessed number.
- Failed fee transfer ⇒ deferral. The owed amount is booked per token and retried; the owner’s payout is never held hostage by the treasury leg.
- In-kind exits pay from loose balances. When positions leave intact, the fee is collected from the vault’s loose token balances; if they’re insufficient, the exact shortfall is quoted to the owner up front rather than discovered mid-transaction.