← Documentation home
Build

Developer overview

Three contracts, one Lens, a subgraph, and a small set of events. Pick where to start.

What you're integrating with

ContractWhat it does
TranchedMetaVaultThe 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.
PooledTrancheTokenTwo 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.
LayerCoverLensStateless read aggregator. snapshot(vault) returns the full vault state atomically; userPosition(vault, user) returns the user's lcSEN / lcJUN balances plus any outstanding notices.
LayerCoverFactoryDeploys a new metavault + tranche-token pair given an underlying ERC4626, an asset, an operator, and an initial premium rate.

Conventions worth knowing

ConventionDetail
Asset denominationTranche-share decimals match the underlying asset's decimals. A USDC-asset vault has 6-decimal lcSEN / lcJUN.
Bps everywhereRate 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 daysNot 365.25. Annualised rates assume a 365-day calendar.
No upgradesContracts 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.