Architecture
Architecture
LendingManager — Central orchestrator. Entry points: termInitialize, termModifyPosition, loanInitialize, allocate, repay. Upgradeable via UUPS. Pausable.
Insurance Layer — Prices put options based on LTV, duration, and volatility. Collects premiums. Executes hedges on external options markets. Settles payoffs at maturity.
Hooks — Custom logic at lifecycle events. Implement IHooks to inject behavior at term creation, deposit, allocation, and repayment. Built-in: AaveV3 (idle yield), P2P (manual approval), Timelock (delayed execution).
Modules — Collateral validators. Implement ILoanModule to handle custom collateral types. Built-in: ERC20LTV (BTC/ETH with LTV validation), ERC721 (NFT collateral), Attestation (credential-based lending).
Liquidator — Dutch auction for defaulted loans. Price declines over time. First buyer wins.
Router — Batch operations in one transaction. Command pattern execution.
Oracle — Chainlink and Pyth price feeds. 18 decimal normalization. Staleness checks.
Integration
Build custom hooks or modules to extend the protocol. Reference the deployed contracts and interfaces:
Building Hooks —
IHooksinterface and examplesBuilding Modules —
ILoanModuleinterface and examplesContract Addresses — Deployed contracts per network
Last updated