A non-custodial lending protocol built on Solana using the Anchor framework.
This protocol enables users to supply assets to earn interest and to borrow other assets by providing collateral.
It is inspired by the fundamental mechanisms of protocols like Compound and Aave, but tailored for Solana's speed and composability.
- Collateralized lending with configurable Loan-to-Value (LTV)
- Interest accrual over time using a simple linear model
- Liquidation system with configurable bonuses
- Secure token vaults managed by PDAs
- Oracle integration for real-time asset pricing
Key Accounts
| Account | Description |
|---|---|
Reserve |
Stores configuration, liquidity data, interest parameters |
Obligation |
Tracks a user’s deposits, borrowings, and health factor |
Vault |
PDA-controlled account holding actual token balances |
Oracle |
External source for asset price (e.g., Pyth, Switchboard) |
Instruction Set
InitializeReserve: Create a new lending market for a supported tokenDeposit: Supply assets and mint interest-bearing creditsBorrow: Borrow assets by locking collateral under LTV limitsRepay: Repay borrowed assets and update interestWithdraw: Withdraw supplied collateral when not borrowedLiquidate: Liquidate under-collateralized positions
| Parameter | Value |
|---|---|
| Borrow Factor | 60% |
| Liquidation LTV | 75% |
| Liquidation Bonus | 5% ~10% |
| Base Interest Rate | 3% APR |
- Solana – High-throughput L1 blockchain
- Anchor – Framework for Solana smart contract development
- Rust – Core language for writing on-chain logic
- Pyth Network – Oracle solution for price feeds
- TypeScript – Optional frontend / SDK integration
Make sure
anchor,solana-cli, and Rust toolchain are properly installed.
# Clone the repo
git clone https://github.com/libaice/solana-lending-lite
cd solana-lending-lite
# Build and deploy
anchor keys sync
anchor build
anchor deploy --provider.cluster devnet