Build a decentralized lending protocol on the Solana blockchain using the Anchor framework.
This challenge guides you through creating a secure lending smart contract that enables users to:
- Deposit collateral
- Borrow assets
- Repay loans
- Face liquidation when undercollateralized
- Solana's Account Model: Understanding how accounts store state and data
- Program-Derived Addresses (PDAs): Deriving deterministic addresses for program accounts
- Cross-Program Invocations (CPI): Interacting with SPL Token programs
- Oracle Integration: Fetching real-time price feeds for asset valuation
- Interest Rate Models: Calculating and applying interest on loans
- Health Factors: Monitoring collateralization ratios
- Liquidation Protocols: Handling undercollateralized positions
- Environment Setup - Configure your development environment
- Rust Basics - Essential Rust programming concepts
- Solana Model - Understanding Solana's architecture
- Anchor Framework - Getting started with Anchor
- SPL Token Basics - Working with tokens on Solana
- Basic Deposit - Implementing deposit functionality
- Basic Withdraw - Implementing withdrawal functionality
- Account Structure - Bank, user accounts, and account space management
- Interest - Interest calculation, accrual, and rate models
- Lending Core - Borrow, repay, and LTV calculations
- Liquidation - Health factors, triggers, and liquidation process
- Oracle - Price feed integration and fetching
- PDA - PDA concepts, derivation, and bump seeds
- Security - Vulnerabilities, reentrancy protection, and validation
- Treasury - Treasury creation and security
This challenge is developed using the StackClass Course SDK. Refer to the StackClass documentation for information on:
- Contributing language support
- Submitting solutions
- Rust 1.87+
- Cargo 1.87+
- Anchor framework
- Solana CLI
The main source file you'll be working with is:
programs/lending-program/src/lib.rs
See LICENSE file for details.