Architecture

System architecture overview.

Components

LendingManager - Central orchestrator for lending operations Modules - Handle collateral validation and custody Hooks - Custom logic injection points Router - Batch transaction executor Oracle - Price feed aggregator Liquidator - Default handling

Key Contracts

LendingManager

  • Entry points: termInitialize, termModifyPosition, loanInitialize, allocate, repay

  • Upgradeable via UUPS pattern

  • Pausable for emergencies

Router

  • Combines multiple operations in one transaction

  • Command pattern execution

Oracle

  • Supports Chainlink and Pyth

  • 18 decimal normalization

Integration

Build Modules: Implement ILoanModule to handle custom collateral types

Build Hooks: Implement IHooks to add logic at lifecycle events

Use Router: Batch operations for gas efficiency

Reference deployed contracts for implementation details.

Last updated