Decentralized Interbank Lending Protocol on Solana
A trustless, collateralized lending protocol enabling instant settlement and transparent algorithmic interest rates for financial institutions.
Ensure you have these installed:
# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustc --version # Should be 1.75+
# Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
solana --version # Should be 1.17+
# Anchor
cargo install --git https://github.com/coral-xyz/anchor avm --locked
avm install latest && avm use latest
anchor --version # Should be 0.29+
# Node.js (for frontend)
node --version # Should be 18+
# PostgreSQL & Redis
psql --version # Should be 15+
redis-server --version # Should be 7+# 1. Clone and enter directory
git clone https://github.com/yourusername/DeSwift.git
cd DeSwift
# 2. Build smart contract
cd contracts
anchor build
cd ..
# 3. Setup backend
cd backend
cp .env.example .env
# Edit .env with your database credentials
cargo build
cd ..
# 4. Setup frontend
cd frontend
npm install
cd ..
# 5. Setup database
createdb deswift
psql deswift < migrations/001_initial.sql
psql deswift < migrations/002_add_indexes.sqlOption 1: All-in-one script
./scripts/run-local.shOption 2: Manual (3 terminals)
# Terminal 1: Solana validator
solana-test-validator
# Terminal 2: Deploy contract & run backend
cd contracts && anchor deploy
cd ../backend && cargo run
# Terminal 3: Frontend
cd frontend && npm run devDeSwift/
├── contracts/ # Solana smart contract (Anchor/Rust)
│ └── programs/deswift/src/
├── backend/ # REST API server (Axum/Rust)
│ └── src/
├── frontend/ # Web application (React/TypeScript)
│ └── src/
├── shared/ # Shared Rust types
├── migrations/ # PostgreSQL schemas
├── docs/ # Documentation
└── scripts/ # Utility scripts
| Feature | Description |
|---|---|
| Bank Tiers | Three-tier credit system with different borrowing limits |
| Collateral | Multi-asset support with risk-adjusted haircuts |
| Dynamic Rates | SOFR-inspired utilization-based interest rates |
| Loan Terms | Overnight, 7-day, and 30-day options |
| Liquidations | Automated engine for underwater positions |
Read the full documentation - Comprehensive guide covering:
- Architecture & data flow
- Smart contract reference (accounts, instructions)
- Backend API endpoints
- Frontend components
- Finance concepts (SOFR, haircuts, liquidations)
- Deployment guide
- Testing strategy
| Layer | Technology |
|---|---|
| Blockchain | Solana |
| Smart Contract | Anchor (Rust) |
| Backend | Axum (Rust) |
| Database | PostgreSQL |
| Cache | Redis |
| Frontend | React + TypeScript |
| Styling | Tailwind CSS |
| Endpoint | Description |
|---|---|
GET /api/v1/protocol/stats |
Protocol statistics |
GET /api/v1/rates |
Current interest rates |
GET /api/v1/banks |
List all banks |
GET /api/v1/loans |
List all loans |
See full API documentation for details.
- Fork the repository
- Create feature branch (
git checkout -b feature/name) - Commit changes
- Push and open Pull Request
MIT License - see LICENSE for details.
Anik Tahabilder PhD Student, Computer Science Wayne State University tahabilderanik@gmail.com