← Documentation homeBuild
Developer overview
Three contracts, one Lens, a subgraph, and a small set of events. Pick where to start.
| Contract | What it does |
|---|
TranchedMetaVault | The main contract. One address per (chain, underlying vault). Wraps a single ERC4626 and exposes the depositor surface: depositSenior, depositJunior, requestSeniorWithdrawal, cancelSeniorWithdrawal, withdrawSenior, requestJuniorWithdrawal, cancelJuniorWithdrawal, withdrawJunior. |
PooledTrancheToken | Two ERC4626-compatible share tokens minted by every metavault (lcSEN, lcJUN). Fungible, transferable, with an internal share-lock that freezes shares while a withdrawal notice is pending. The metavault is the only minter/burner. |
LayerCoverLens | Stateless read aggregator. snapshot(vault) returns the full vault state atomically; userPosition(vault, user) returns the user's lcSEN / lcJUN balances plus any outstanding notices. |
LayerCoverFactory | Deploys a new metavault + tranche-token pair given an underlying ERC4626, an asset, an operator, and an initial premium rate. |
| Convention | Detail |
|---|
| Asset denomination | Tranche-share decimals match the underlying asset's decimals. A USDC-asset vault has 6-decimal lcSEN / lcJUN. |
| Bps everywhere | Rate and cap fields (protectionPremiumBps, SENIOR_PROTECTION_BPS, MAX_CORRELATED_SENIOR_LEVERAGE_BPS, etc.) are basis-point integers. Exact values live in the Constants table. |
Year is 365 days | Not 365.25. Annualised rates assume a 365-day calendar. |
| No upgrades | Contracts are immutable. A redeployment ships a new address; existing users keep the old one. The factory keeps a registry but doesn't proxy. |
| NAV reconciles every state-changing call | _syncAccounting() runs at the start of every external write; you can rely on the post-state to reflect the latest underlying value. |