Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

How to Architect a Decentralized Lending Protocol

A technical guide for developers on designing and implementing the core smart contract modules for a secure, capital-efficient, and extensible lending protocol.
Chainscore © 2026
introduction
CORE COMPONENTS

How to Architect a Decentralized Lending Protocol

A technical guide to designing the foundational architecture of a decentralized lending protocol, covering smart contract structure, economic models, and key security considerations.

A decentralized lending protocol's architecture is built on a core set of smart contracts that manage collateralized debt positions (CDPs). The primary contracts include a Market Manager for listing assets, a Vault Engine for handling user deposits and loans, an Oracle Adapter for secure price feeds, and a Liquidation Module for managing undercollateralized positions. This modular separation of concerns enhances security and upgradeability. For example, Aave V3's architecture isolates risk parameters per asset via the PoolConfigurator and separates core lending logic in the Pool contract, allowing for targeted updates.

The economic model is defined by two critical smart contracts: an Interest Rate Model and a Liquidation Engine. The interest rate model, often a JumpRateModel or LinearRateModel, algorithmically adjusts borrowing rates based on pool utilization to balance supply and demand. The liquidation engine defines the health factor calculation and the process for liquidating vaults that fall below the liquidation threshold. Protocols like Compound use a Comptroller contract to manage risk parameters and calculate account liquidity, triggering liquidations via a public liquidateBorrow function.

Integrating secure, decentralized price oracles is non-negotiable for determining collateral values. The architecture must include an Oracle Adapter contract that consumes data from providers like Chainlink (AggregatorV3Interface) or a network of Pyth oracles. This adapter should implement circuit breakers and sanity checks to reject stale or manipulated prices. A critical design pattern is to use the oracle's price to calculate the user's health factor: health_factor = (collateral_value * liquidation_threshold) / debt_value. A health factor below 1.0 makes the position eligible for liquidation.

To manage insolvent positions, the liquidation module must be permissionless and incentive-aligned. It typically allows any user (a "liquidator") to repay a portion of the unhealthy debt in exchange for the borrower's collateral at a discounted rate, known as the liquidation bonus. The smart contract logic must atomically transfer the repaid debt and the discounted collateral, ensuring the protocol's solvency. For instance, a function signature might be liquidate(address borrower, uint256 repayAmount, address collateralAsset), which calculates the seized collateral using the current oracle price and a predefined liquidation penalty.

Finally, the architecture must plan for upgradeability and governance. Using proxy patterns like the Transparent Proxy (OpenZeppelin) or the Universal Upgradeable Proxy Standard (UUPS) allows logic upgrades while preserving user data and asset holdings. Governance is often facilitated by a DAO that holds a TIMELOCK contract and a governance token, voting on parameter changes (e.g., loan-to-value ratios, interest rate curves) or contract upgrades. This creates a decentralized framework for the protocol's long-term evolution and risk management, as seen in MakerDAO's governance of the DAI stablecoin system.

prerequisites
FOUNDATION

Prerequisites and Tech Stack

Building a decentralized lending protocol requires a robust technical foundation. This guide outlines the essential knowledge and tools needed before you begin development.

A strong grasp of Ethereum fundamentals is non-negotiable. You must understand the EVM, gas mechanics, and the structure of transactions. Proficiency in Solidity is essential for writing secure, efficient smart contracts that will manage user funds, interest rates, and liquidations. Familiarity with common patterns like the proxy upgrade pattern (e.g., EIP-1967) is crucial for maintaining and improving your protocol post-deployment. Knowledge of token standards, especially ERC-20 for the lending assets and your protocol's native token, and ERC-721 for potential NFT collateral, is also required.

Your development environment should be built for security and efficiency. Use Hardhat or Foundry as your primary development framework; they provide testing environments, deployment scripts, and debugging tools. For testing, write comprehensive unit and integration tests using Waffle or Foundry's native testing suite, aiming for high coverage, especially for core logic like interest accrual and liquidation. A local testnet like Hardhat Network is ideal for rapid iteration, while forking mainnet (e.g., using hardhat_reset) is necessary to test integrations with live protocols like Uniswap for oracle prices.

You will need to interact with several key DeFi primitives. An on-chain price oracle is critical for determining collateral values; integrating a decentralized solution like Chainlink or a custom oracle using Uniswap V3 TWAPs is a major architectural decision. Understanding debt and interest rate models is core to the protocol's economics. You must decide between a peer-to-peer model (like early Compound) or a pooled liquidity model, and implement an interest rate algorithm (e.g., a utilization-based model: borrowRate = baseRate + utilization * multiplier).

Security must be integrated from the start. Conduct manual code reviews and plan for multiple audits from reputable firms like OpenZeppelin or Trail of Bits. Utilize static analysis tools like Slither or MythX during development. You should also implement emergency pause mechanisms, timelock controllers for privileged functions, and a clear plan for handling protocol-owned liquidity and governance. All contracts should follow the Checks-Effects-Interactions pattern to prevent reentrancy and other state manipulation vulnerabilities.

Finally, prepare your deployment and monitoring stack. Use Etherscan verification for contract transparency. For front-end integration, you'll need a library like ethers.js or viem to interact with your contracts. Plan for subgraph development using The Graph to index protocol data (total value locked, user positions, historical rates) for your application and analytics dashboards. Your initial tech stack choices will define your protocol's security, scalability, and developer experience for years to come.

core-modules-overview
CORE PROTOCOL MODULES

How to Architect a Decentralized Lending Protocol

A technical guide to designing the fundamental components of a non-custodial lending and borrowing protocol.

A decentralized lending protocol's architecture is built on a few core modules that manage risk, collateral, and liquidity. The primary components are the lending pool, price oracle, liquidation engine, and governance mechanism. The lending pool is the central smart contract that holds user deposits, tracks loans, and calculates interest using a utilization-based rate model. This model dynamically adjusts borrowing rates based on the pool's available liquidity, incentivizing deposits when capital is scarce.

The price oracle is a critical security dependency. It provides real-time, manipulation-resistant price feeds for all supported collateral and debt assets. Most protocols, like Aave and Compound, use a decentralized oracle network like Chainlink, aggregating data from multiple sources. A robust oracle design must include circuit breakers and time-weighted average prices (TWAPs) to protect against flash loan attacks and short-term price volatility that could trigger unfair liquidations.

The liquidation engine automatically seizes undercollateralized positions to keep the protocol solvent. It defines a health factor for each borrower, calculated as (Collateral Value * Liquidation Threshold) / Borrowed Value. When this factor drops below 1, the position becomes eligible for liquidation. Liquidators are incentivized with a liquidation bonus, a discount on the seized collateral, paid from the borrower's position. Efficient liquidation requires low-latency monitoring and gas-optimized contract functions.

Interest accrual is typically handled via an exchange rate model. Instead of tracking individual interest balances, the protocol mints interest-bearing tokens (like aTokens or cTokens) to depositors. The exchange rate between this token and the underlying asset increases over time, representing accrued interest. For borrowers, interest is added to their debt balance continuously. This model is gas-efficient and allows interest-bearing tokens to be freely transferred or used as collateral elsewhere in DeFi.

Finally, protocol governance manages upgrades and parameter tuning. Using a decentralized autonomous organization (DAO) structure, token holders vote on proposals to adjust risk parameters like loan-to-value ratios, reserve factors, and oracle configurations. Governance contracts must include timelocks to allow users to exit if they disagree with a change, and emergency admins with multi-sig controls to pause the protocol in case of a critical bug, as seen in MakerDAO's governance model.

key-concepts
LENDING PROTOCOL DESIGN

Key Architectural Concepts

Core technical components that define a secure and efficient lending protocol. Understanding these concepts is essential for building or auditing DeFi lending systems.

02

Interest Rate Models

Interest rates are algorithmically determined by supply and demand to manage liquidity. Most protocols use a kinked rate model with distinct utilization segments.

  • Optimal Utilization (Uoptimal): A target point (e.g., 90%) where rates increase sharply.
  • Base Variable Rate: The minimum rate when utilization is low.
  • Slope1 & Slope2: Define the rate of increase before and after the kink. This model, used by Compound and Aave, balances lender yield with borrower incentives.
04

Liquidation Mechanisms

A robust liquidation system is critical for protocol solvency. It involves keepers (bots) who repay a borrower's debt in exchange for discounted collateral. Modern designs use Dutch auctions (like MakerDAO's Collateral Auction) or fixed discount liquidations (like Aave V3) to improve efficiency and reduce bad debt. The health factor formula (Collateral in USD * LTV) / Total Borrowed determines when a position becomes eligible for liquidation.

05

Token Standards & aTokens

Protocols issue interest-bearing tokenized deposits to represent user shares. Aave's aTokens (e.g., aUSDC) and Compound's cTokens are ERC-20 tokens that continuously accrue interest, with balances increasing in real-time. This design simplifies accounting and enables seamless integration with other DeFi protocols. The exchange rate between the underlying asset and the receipt token increases over time, reflecting accrued interest.

06

Governance & Upgradability

Decentralized governance, typically via a native token (AAVE, COMP), controls core parameters and smart contract upgrades. To manage upgrade risk, protocols use proxy patterns with a transparent governance timelock. The Governance v2 model often delegates voting power to representatives or uses a Safety Module (staked AAVE) as a final backstop. All changes require a proposal, voting period, and execution delay.

isolated-pools-design
ARCHITECTURE GUIDE

Designing Isolated Lending Pools

Isolated lending pools are a core architectural pattern for managing risk in DeFi. This guide explains how to design a protocol where each market operates independently, preventing contagion.

An isolated lending pool is a self-contained market for a single asset pair, where the supplied collateral can only be borrowed against a specific set of approved debt assets. This contrasts with cross-margin or shared pool models, where all assets in a protocol share a common risk pool. The primary advantage of isolation is risk containment; if an asset in one pool becomes insolvent or is exploited, the failure is confined to that specific pool, protecting all other assets and users in the protocol. Protocols like Solend's Isolated Pools and Radiant Capital's v2 utilize this model to list newer or riskier assets without jeopardizing their core markets.

The core smart contract architecture typically involves a factory pattern. A PoolFactory contract deploys individual LendingPool contracts, each configured for a specific collateral asset and a whitelist of borrowable assets. Each LendingPool manages its own loan-to-value (LTV) ratios, liquidation thresholds, interest rate models, and reserve factors. Key state variables include the total supplied and borrowed amounts, accrued interest, and the health of each user's position. By isolating this logic, upgrades or parameter adjustments can be made on a per-pool basis, and new pools can be launched without needing to migrate the entire protocol.

A critical component is the isolated risk oracle. Each pool must have a reliable price feed for its collateral and debt assets to calculate collateralization ratios. Since pools are isolated, you can implement custom oracle logic per pool—for instance, using a Time-Weighted Average Price (TWAP) oracle for a volatile asset while using a simpler spot price oracle for a stablecoin. The liquidation engine must also be pool-specific, triggering when a user's health factor falls below 1: health_factor = (collateral_value * LTV) / debt_value. This calculation uses only the prices and amounts within that single, isolated pool context.

When implementing the supply and borrow functions, you must enforce the pool's asset whitelist. A user can supply collateral asset X and may only borrow from the pre-defined list of debt assets [Y, Z]. The contract must track two key balances per user: their supply balance (earning interest) and their borrow balance (accruing interest). The borrow() function should check that the requested debt asset is on the whitelist and that the resulting health factor remains safe. This design inherently prevents a scenario where borrowing an unrelated asset from a different pool could destabilize this one.

For developers, a basic skeleton of an isolated pool's core function might look like this in Solidity:

solidity
function borrow(address debtAsset, uint256 amount) external {
    require(isBorrowable[debtAsset], "Asset not borrowable in this pool");
    (uint256 collateralValue, uint256 debtValue) = calculateUserPosition(msg.sender);
    uint256 newDebtValue = debtValue + (amount * oracle.getPrice(debtAsset));
    require((collateralValue * maxLTV) / newDebtValue >= 1e18, "Health factor below 1");
    // Update user debt and transfer tokens...
}

This highlights the essential checks: verifying the asset is allowed and ensuring the action maintains solvency within the pool's isolated context.

The final consideration is liquidity and composability. While isolation protects against systemic risk, it can fragment liquidity. Protocols often build a meta-layer or router that aggregates liquidity views across multiple pools for a better user experience. However, the underlying risk and settlement remain segregated. When designing your protocol, clearly document which assets are in which pools and their specific risk parameters. This transparency is crucial for user trust and aligns with the principle of E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness) by demonstrating a deliberate and safe architectural choice.

oracle-integration
ARCHITECTURE GUIDE

Integrating a Secure Price Oracle

A secure price oracle is the foundation of any decentralized lending protocol. This guide explains the architectural decisions and implementation steps for integrating a robust oracle solution.

A price oracle provides external market data, like the price of ETH/USD, to on-chain smart contracts. For a lending protocol, this data determines collateral values and triggers liquidations. The core challenge is oracle security: a manipulated price can lead to undercollateralized loans or unfair liquidations, risking user funds. Architecturally, you must choose between a push-based oracle (data updated on-chain at intervals) or a pull-based oracle (data fetched on-demand), each with distinct gas and latency trade-offs.

The most secure approach is to use a decentralized oracle network like Chainlink. Instead of a single data source, these networks aggregate data from multiple independent node operators. Your smart contract would reference a Chainlink AggregatorV3Interface contract, which provides a decentralized price feed. Key parameters to configure are the heartbeat (maximum time between updates) and deviation threshold (minimum price change that triggers an update), which balance freshness with gas costs.

Here is a basic Solidity implementation for fetching a price from a Chainlink oracle:

solidity
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
contract LendingProtocol {
    AggregatorV3Interface internal priceFeed;
    constructor(address _oracleAddress) {
        priceFeed = AggregatorV3Interface(_oracleAddress);
    }
    function getLatestPrice() public view returns (int) {
        (,int price,,,) = priceFeed.latestRoundData();
        return price;
    }
}

The latestRoundData() function returns the latest validated price. You must validate the returned timestamp and roundId to ensure the data is fresh and from a complete round.

Beyond the primary oracle, implement a circuit breaker and a fallback mechanism. A circuit breaker can pause borrowing or liquidations if the oracle reports an extreme, implausible price deviation. A fallback mechanism, such as a time-weighted average price (TWAP) from a decentralized exchange like Uniswap V3, can be used if the primary oracle fails or is frozen. This layered defense, known as the Oracle Security Module pattern, is used by protocols like Aave.

Finally, integrate the oracle price into your core logic. Calculate a user's health factor, which is the ratio of their collateral value to their borrowed value. If this factor falls below 1.0 (e.g., (collateralAmount * price) / borrowedValue < 1e18), the position becomes eligible for liquidation. Always use scaled precision in calculations (e.g., representing 100% as 1e18) and be mindful of integer overflows. Regularly monitor and update oracle addresses, as feed contracts can be upgraded by the provider.

liquidation-engine
BUILDING THE LIQUIDATION ENGINE

How to Architect a Decentralized Lending Protocol

A liquidation engine is the critical risk management system that protects a lending protocol's solvency by automatically closing undercollateralized positions.

A liquidation engine is the core risk mitigation mechanism for any decentralized lending protocol like Aave or Compound. Its primary function is to identify and close positions where the collateral value falls below a predefined liquidation threshold, preventing the protocol from accumulating bad debt. This process is not discretionary; it is a permissionless, automated function that any external actor (a "liquidator") can trigger in exchange for a financial incentive, typically a liquidation bonus or discount on the seized collateral. The engine must be designed for reliability under extreme market volatility, as this is precisely when it is needed most.

The architecture revolves around several key state variables tracked for each user position: the collateral balance, the debt balance, and the current collateral factor (or Loan-to-Value ratio). The engine continuously monitors the health factor, a numerical representation of a position's safety, calculated as (Collateral Value * Liquidation Threshold) / Debt Value. When this factor drops below 1.0, the position becomes eligible for liquidation. Price feeds from decentralized oracles like Chainlink are essential inputs for this calculation, making oracle security a paramount concern for the entire system's integrity.

The liquidation process itself is a atomic transaction. A liquidator calls the protocol's liquidate() function, specifying the underwater borrower and the debt to be repaid. In return, the liquidator repays a portion or all of the borrower's debt using the protocol's stablecoin and receives an equivalent value of the borrower's collateral, plus a bonus. For example, a common model is a 10% bonus: repaying $100 of debt might grant $110 worth of collateral. This bonus must be carefully calibrated to ensure it is high enough to incentivize liquidators during network congestion but not so high as to be overly punitive to borrowers.

Implementing this requires careful smart contract design. A robust _checkHealthFactor() function will validate positions before any borrow or withdrawal. The liquidation logic must handle multiple collateral and debt asset types, often using internal accounting with exchange rates and price oracles. Furthermore, protocols implement safeguards like a liquidation close factor (e.g., 50%) to limit how much of a position can be liquidated in one transaction, preventing overly large, destabilizing liquidations. Here's a simplified conceptual check in Solidity:

solidity
require(healthFactor < 1e18, "HEALTH_FACTOR_ABOVE_THRESHOLD");
uint256 maxDebtToLiquidate = (debtBalance * closeFactor) / 100;

Beyond the base mechanics, advanced protocols incorporate features to enhance stability. Isolated markets limit the collateral assets that can be used for specific debts, containing risk. Soft liquidations, as seen in MakerDAO, allow for gradual collateral auctioning instead of fixed-price seizures, potentially achieving better prices. The engine must also be gas-efficient, as high transaction costs can deter liquidators during crises, leading to protocol insolvency. Thorough testing, including simulations of flash crash scenarios and oracle failure, is non-negotiable before deployment.

Ultimately, a well-architected liquidation engine creates a robust economic flywheel. It reliably protects lender funds, provides a profitable opportunity for keepers, and enforces market discipline on borrowers. Its design choices directly impact the protocol's capital efficiency, risk profile, and resilience during black swan events, making it the most critical component to engineer correctly in a decentralized lending system.

upgradeability-path
ARCHITECTURE GUIDE

Implementing a Secure Upgrade Path

A guide to designing upgradeable smart contracts for decentralized lending protocols using proxy patterns and governance.

Decentralized lending protocols like Aave and Compound must evolve to integrate new collateral types, adjust risk parameters, and fix bugs, but immutable smart contracts prevent these necessary updates. A secure upgrade path is therefore a core architectural requirement. This is achieved by separating the protocol's logic from its storage using a proxy pattern. The proxy contract holds the protocol's state (user balances, reserves) and delegates all function calls to a separate logic contract. To upgrade, the proxy is pointed to a new logic contract address, preserving all user data while enabling new functionality.

The most common implementation is the Transparent Proxy Pattern, which uses an admin address to manage upgrades. A more decentralized approach is the UUPS (EIP-1822) proxy, where upgrade logic is built into the logic contract itself. UUPS proxies are more gas-efficient and allow upgrade authorization to be managed by a timelock-controlled governance contract, aligning with DeFi's permissionless ethos. When architecting a lending protocol, critical considerations include: ensuring storage layout compatibility between logic versions, implementing comprehensive testing and auditing for new logic, and establishing a robust governance process with timelocks to prevent rushed or malicious upgrades.

A practical implementation involves a ProxyAdmin contract that owns the proxy and executes upgrades via upgradeTo(address newImplementation). The governance token holders vote on upgrade proposals, which, if passed, are queued in a timelock (e.g., a 48-hour delay) before the ProxyAdmin executes them. This delay allows users to review code changes and exit positions if needed. It's crucial that the logic contract does not have a self-destruct function and that the initializer function (replacing the constructor) can only be called once to prevent re-initialization attacks.

Testing an upgradeable system requires deploying the entire stack: proxy, proxy admin, logic v1, and logic v2. Use frameworks like OpenZeppelin Upgrades Plugins for Hardhat or Truffle, which automate safety checks for storage collisions. A comprehensive test suite should simulate the governance flow, verify that user state persists post-upgrade, and include integration tests for new features. For example, after upgrading a lending pool to support a new stablecoin, tests must confirm that existing ETH and DAI loans are unaffected while the new asset's markets are correctly initialized.

Beyond the technical mechanism, a secure upgrade requires transparent communication and community oversight. All proposed logic changes should be accompanied by a detailed audit report from a reputable firm like Trail of Bits or OpenZeppelin, and the code should be verified on Etherscan. The final defense is escape hatch or circuit breaker mechanisms within the logic itself, allowing governance to pause specific functions in an emergency without a full upgrade. By combining robust proxy patterns, decentralized governance, and rigorous processes, a lending protocol can remain both adaptable and trustworthy.

ARCHITECTURAL APPROACHES

Core Module Design Patterns Comparison

A comparison of three fundamental design patterns for structuring the core logic of a decentralized lending protocol.

Architectural FeatureMonolithic ContractModular LibraryProxy/Upgradeable Factory

Core Logic Upgradeability

Gas Cost for New Markets

High

Low

Medium

Protocol Fee Flexibility

Fixed at deploy

Fixed at deploy

Configurable per market

Admin Attack Surface

Single contract

Single contract

Factory + Implementation

Time to Launch New Asset

Redeploy protocol

< 1 hour

< 10 minutes

Code Complexity

High

Medium

High

Example Protocol

Compound V2

Aave V3

Euler Finance

DEVELOPER FAQ

Frequently Asked Questions

Common technical questions and troubleshooting for architects building on-chain lending systems. Covers protocol design, security, and integration challenges.

Collateralization ratios are calculated as (Collateral Value / Loan Value) * 100. To manage them dynamically:

  • Use a decentralized oracle (e.g., Chainlink, Pyth) for real-time, tamper-resistant price feeds for both collateral and borrowed assets.
  • Implement liquidation thresholds (e.g., 110% for volatile assets) that trigger when the ratio falls below a safe minimum.
  • Add a health factor system, common in protocols like Aave, where Health Factor = (Collateral Value * Liquidation Threshold) / Total Borrowed. A factor below 1.0 makes the position eligible for liquidation.
  • Update ratios on-chain with every price feed update and user interaction (borrow, repay, deposit). Use a keeper network or permissionless function to trigger liquidations.
conclusion
ARCHITECTURE REVIEW

Conclusion and Next Steps

This guide has outlined the core components for building a secure and functional decentralized lending protocol. The next steps involve rigorous testing, deployment, and continuous improvement.

Building a lending protocol is an iterative process. After implementing the core architecture—collateral management, price oracles, interest rate models, and liquidation engines—the focus must shift to security and testing. Conduct comprehensive unit and integration tests using frameworks like Hardhat or Foundry. Perform formal verification for critical functions like the liquidateBorrow method. Engage a reputable audit firm; protocols like Aave and Compound undergo multiple audits before mainnet launch. A bug bounty program on platforms like Immunefi can provide an additional security layer.

For deployment, start with a testnet like Goerli or Sepolia to simulate real-world conditions without financial risk. Use a proxy upgrade pattern (e.g., OpenZeppelin's TransparentUpgradeableProxy) for your core contracts to allow for future fixes and improvements without migrating user positions. Carefully configure governance parameters if implementing a DAO, including proposal thresholds and timelocks. Monitor initial liquidity provisioning to ensure the protocol has sufficient capital to facilitate its first loans and withstand early volatility.

Post-launch, protocol maintenance is continuous. Monitor key risk parameters like Loan-to-Value (LTV) ratios, reserve factors, and liquidation incentives. Use chainlink data feeds or a custom oracle security module to ensure price feed reliability. Analyze usage patterns to adjust interest rate models; for instance, you might implement a kinked rate model that changes slope at a specific utilization rate to better manage liquidity. Community governance, facilitated by a native token, can decentralize these parameter updates over time.

To deepen your understanding, study the source code and documentation of established protocols. Review Aave V3's technical paper and Compound's Comet (Compound III) whitepaper to see how they handle isolated collateral and risk management. Experiment with forking mainnet and interacting with live contracts using Ethers.js or Viem. Contributing to open-source DeFi projects or building your own minimal prototype on a local Anvil chain are excellent ways to gain practical, hands-on experience in protocol architecture.

How to Architect a Decentralized Lending Protocol | ChainScore Guides