> For the complete documentation index, see [llms.txt](https://baselend.gitbook.io/baselend/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://baselend.gitbook.io/baselend/protocol/technical-specification.md). Agents can also search and read this documentation through its [MCP server](https://baselend.gitbook.io/baselend/~gitbook/mcp).

# Technical Specification

## Protocol Architecture

Baselend utilizes a modular smart contract architecture for maximum flexibility. Core contracts include:

* Baselend - Main protocol logic and state
* InterestRateModel - Calculate dynamic rates
* Oracle - Fetch external price data
* Governance - Manage voting and proposals
* Rewards - Distribute fees and incentives

New versions of contracts can be introduced through governance. Interfaces between contracts are minimized for security.

## Security Design

Key security design principles include:

* Formal verifications - Mathematical proofs of correctness
* Comprehensive auditing - Internal and external code audits
* Bug bounties - Ongoing bounties for discovering vulnerabilities
* Monitoring - Activity logging and anomaly detection
* Oracles - Multi-source price feeds to prevent manipulation

## Lending Parameters

Key adjustable lending parameters include:

* Collateral ratios - Minimum collateral required per loan
* Liquidation thresholds - Collateral ratio floor before liquidation
* Interest rate models - Formulas to determine dynamic rates
* Fee structure - Origination/liquidation fees charged

Parameters are calibrated to balance risk and utility for assets.
