Lens Contract
The Lens contract provides read-only access to protocol data and analytics for the Monolith lending protocol. Contract implementationFunctions
getCollateralOf
_lender: Lender instance to read fromborrower: Address of the borrower
uint256: Effective collateral amount for display/accounting
- If the borrower has zero free‑debt shares, returns the cached collateral balance directly.
- Otherwise, iterates up to 5 missed epochs to apply any redemption index changes, reducing collateral accordingly.
- After iterating missed epochs, also applies the current epoch’s pending redemption index.
- Mirrors the lender’s internal lazy‑update logic without mutating state.

