Docs menu
Accounting & Oracles
Onchain accounting and oracle integrity are the foundation of AlphaYields' verifiability commitment. Every share price, NAV figure, and yield calculation depends on this layer functioning correctly.
How NAV is computed
Total assets are the sum of all position values across every active facet, plus undeployed spot balances. Each facet accounts for itself — a Morpho facet reads getUserAccountData(); an sFLOW facet reads exchangeRate() × balance. Facets do not call each other. A malfunction or stale oracle causes that facet's call to revert, surfacing the problem immediately rather than silently corrupting NAV. Fees are applied inside deposit() and redeem() before the NAV snapshot, making fee accrual explicit and auditable.
Oracle registry
Every price feed must be registered before use, recording its address, quoted asset, and staleness threshold (standardised to Chainlink's interface). If a feed has not updated within its threshold, any dependent transaction reverts — there is no fallback that silently accepts a stale price. Non-Chainlink oracles are wrapped in a standardised adapter.
Oracle approval criteria
- 01Implementation audit — the oracle contract cannot be paused or manipulated by a single key
- 02Data source review — upstream source and fallback rules are confirmed
- 03Liveness test — the feed must have updated within its threshold at approval time
What happens when an oracle fails
- ▪Deposits and withdrawals depending on the affected oracle revert
- ▪The NAV is not updated with the stale or incorrect value
- ▪The affected facet can be paused by governance without affecting other facets
- ▪Withdrawals via other facets remain operational
The revert-on-stale-oracle design is a deliberate safety choice. A vault that silently accepts a stale price could be drained through manipulation. Reverting is conservative by design.
Next — Security Overview →