Unlock liquidity from real-world assets through AI-powered decentralized lending
Built for Mantle Hackathon 2026 | Tracks: RWA/RealFi, DeFi & Composability, AI & Oracles
TokenLend is a decentralized lending platform that enables SMEs in emerging markets to access stablecoin loans using their real-world assets (RWA) as collateral. By combining blockchain technology with AI-powered asset valuation, TokenLend bridges the gap between physical assets and digital finance.
- 700+ million SMEs globally struggle to access affordable credit
- Banks require extensive documentation and formal collateral
- $5.2 trillion credit gap in emerging markets (IFC, 2021)
- Physical assets (phones, equipment, inventory) sit idle as untapped liquidity
- Traditional lending lacks transparency and fair risk assessment
TokenLend allows SMEs to:
- Upload real-world assets (phones, laptops, machinery, vehicles)
- Get instant valuation through AI-powered assessment
- Receive tokenized collateral as ERC-721 NFTs
- Access stablecoin loans (USDT, USDC, MNT) up to safe LTV limits
- Repay flexibly and unlock collateral
- Build credit history on-chain for future access
Lenders benefit from:
- Transparent risk scoring via AI assessment
- Verifiable collateral through tokenized assets
- Secure lending with automated liquidation
- Attractive returns through competitive interest rates
- Global opportunities without geographic barriers
πΌοΈ Asset Tokenization
- Upload photos of real-world assets
- AI analyzes condition, authenticity, and value
- Mint ERC-721 NFT representing asset ownership
- Collateral locked on-chain during loan period
π° Flexible Borrowing
- Request loans up to asset's Loan-to-Value (LTV) limit
- Choose loan duration and interest rate
- Multi-stablecoin support (USDT, USDC, MNT)
- Transparent fee structure (no hidden costs)
π Dashboard & Tracking
- View all active and past loans
- Track repayment progress
- Monitor collateral status
- Build on-chain credit history
π Collateral Management
- Repay anytime to unlock assets
- Automatic collateral release on full repayment
- Grace period before liquidation
- Notifications for payment dues
π Browse Investment Opportunities
- Explore available loan requests
- Filter by asset type, LTV, interest rate
- View detailed AI valuation reports
- Assess borrower risk scores
π‘οΈ Secure Lending
- Collateral locked in smart contracts
- Automated interest accrual
- Liquidation rights after default + grace period
- Multi-stablecoin investment options
π Portfolio Management
- Track all funded loans
- Monitor repayment status
- View earnings and interest accrued
- Diversify across asset types
π€ AI-Powered Risk Assessment
- GPT-4 Vision analyzes asset images
- Condition scoring (mint to poor)
- Damage detection and red flags
- Market price estimation
Blockchain Layer
- Network: Mantle (Layer 2, low fees, high throughput)
- Smart Contracts: Solidity 0.8.20
- Standards: ERC-721 (Asset NFTs), ERC-20 (Stablecoins)
- Security: OpenZeppelin, ReentrancyGuard, SafeERC20
AI & Backend
- AI Engine: OpenAI GPT-4 Vision API
- Backend: Node.js, Express.js
- Database: MongoDB (user profiles, KYC, valuations)
- Authentication: JWT + Web3 wallet signatures
- Storage: IPFS (asset images, metadata)
Frontend
- Framework: Next.js 15 (React 19, TypeScript)
- Styling: Tailwind CSS v3
- Web3: wagmi v3, RainbowKit, viem, ethers v6
- State Management: Zustand
- UI: Custom component library with glass morphism design
1. ASSET UPLOAD & VALUATION
Borrower uploads asset photos
β
Backend stores on IPFS
β
GPT-4 Vision analyzes images
β
Returns: condition, value, LTV
β
Smart contract mints Asset NFT
2. LOAN REQUEST
Borrower creates loan request
β
Specifies: principal, rate, duration
β
Smart contract validates against LTV
β
Loan posted to marketplace
3. LOAN FUNDING
Lender browses requests
β
Reviews AI valuation & terms
β
Funds loan with stablecoins
β
Asset NFT locked as collateral
β
Funds transferred to borrower
4. REPAYMENT
Borrower makes payments
β
Interest calculated on-chain
β
Smart contract tracks balance
β
On full repayment: Asset NFT unlocked
5. DEFAULT & LIQUIDATION
Payment overdue + grace period passed
β
Lender initiates liquidation
β
Asset NFT transferred to lender
β
Lender can claim physical asset
Tokenizes real-world assets as NFT collateral.
Key Functions:
mintAsset()- Create NFT with AI valuation metadatalockAsset()- Lock collateral when loan fundedunlockAsset()- Release collateral on repaymentgetMaxLoanAmount()- Calculate max borrowable based on LTV
Asset Metadata:
struct Asset {
string assetType; // "phone", "laptop", "car", etc.
uint256 aiValuation; // AI-estimated value (USD, scaled)
uint256 maxLTV; // Max loan-to-value ratio (basis points)
uint256 createdAt; // Timestamp
address borrower; // Asset owner
bool isLocked; // Collateral status
uint256 loanId; // Associated loan ID (if locked)
}Manages full loan lifecycle from creation to settlement.
Key Functions:
createLoan()- Borrower initiates loan requestfundLoan()- Lender provides capitalmakeRepayment()- Borrower pays principal + interestliquidateLoan()- Seize collateral on default
Loan Structure:
struct Loan {
uint256 loanId;
address borrower;
address lender;
uint256 assetTokenId; // Collateral NFT
uint256 principal; // Loan amount
uint256 interestRate; // Annual rate (basis points, e.g., 1000 = 10%)
uint256 duration; // Loan term (seconds)
uint256 startTime; // Funding timestamp
uint256 totalRepayment; // Principal + interest
uint256 amountRepaid; // Cumulative payments
LoanStatus status; // Active, Repaid, Liquidated
address stablecoin; // USDT/USDC/MNT address
}Interest Calculation:
- Simple interest:
(principal Γ rate Γ duration) / (10000 Γ 365 days) - Pro-rated for custom durations
- No compounding
Security Features:
- ReentrancyGuard on all financial functions
- Ownable for admin controls
- SafeERC20 for token transfers
- Transfer prevention on locked NFTs
- 7-day grace period before liquidation
-
Image Analysis
- Borrower uploads 1-5 photos of asset
- Images stored on IPFS
- GPT-4 Vision processes images
-
Assessment Criteria
- Authenticity: Matches user-provided model/brand?
- Condition: Physical state (scratches, damage, wear)
- Functionality: Working condition (if visible)
- Red Flags: Stock photos, mismatched descriptions
-
Condition Scoring
1.0= Mint/New (perfect, no wear)0.9-0.95= Excellent (minimal wear, like new)0.8-0.89= Good (light wear, fully functional)0.6-0.79= Fair (moderate wear, cosmetic damage)0.4-0.59= Poor (heavy wear, visible damage)<0.4= Very Poor (severe damage, questionable functionality)
-
Value Estimation
- Cross-reference market price APIs
- Apply depreciation based on age
- Adjust for condition score
- Conservative valuation approach
-
LTV Calculation
- Asset value Γ condition score Γ safety margin
- Typical LTV: 50-70% depending on asset type
- Lower LTV for higher-risk categories
{
"matches": true,
"detectedModel": "iPhone 14 Pro 128GB",
"detectedBrand": "Apple",
"physicalCondition": "excellent",
"conditionScore": 0.92,
"damageNotes": ["minor scratch on bottom edge"],
"confidence": 0.94,
"redFlags": [],
"isStockPhoto": false,
"estimatedValue": 850.00,
"maxLoanAmount": 595.00,
"recommendedLTV": 70
}USDT (Tether) - 6 decimals
- Most liquid stablecoin globally
- Preferred by international lenders
USDC (USD Coin) - 6 decimals
- Regulated, fully backed
- Popular in institutional finance
MNT (Mantle Token) - 18 decimals
- Native Mantle network token
- Lowest gas fees
- Borrowers specify preferred stablecoin
- Lenders can fund in any supported currency
- Exchange rate handled off-chain if needed
- All contracts store values in smallest unit (wei)
- Partner with local exchanges for NGN conversion
- Enable cash withdrawals in emerging markets
- Maintain stablecoin backing on-chain
Glass Morphism Aesthetic
- Translucent cards with backdrop blur
- Gradient accents (indigo to purple)
- Dark theme optimized for readability
- Modern, professional appearance
Responsive & Accessible
- Mobile-first design
- Touch-friendly interface
- WCAG accessibility standards
- Fast loading times
Component Library
- Input, Select, Textarea (form controls)
- Button (5 variants, 3 sizes)
- Modal (dialog system)
- Toast (notifications)
- Badge (status indicators)
- Card (container layouts)
- Spinner (loading states)
Borrower Journey
- Connect wallet
- Click "Borrow" in navbar
- Upload asset photos
- View AI valuation
- Set loan terms
- Submit request
- Wait for funding
- Receive stablecoins
- Make repayments
- Reclaim collateral
Lender Journey
- Connect wallet
- Click "Lend" in navbar
- Browse loan marketplace
- Review asset details
- Check AI assessment
- Fund selected loan
- Track repayments
- Earn interest
- (If default) Claim collateral
Borrower Dashboard
- Active loans overview
- Total borrowed & repaid
- Payment schedules
- Collateral status
- Quick action buttons
Lender Dashboard
- Available opportunities
- Funded loan portfolio
- Total invested & earned
- Interest tracking
- Performance metrics
- Audited Patterns: OpenZeppelin battle-tested libraries
- Reentrancy Protection: NonReentrant modifier on all state-changing functions
- Access Control: Role-based permissions (Ownable)
- Safe Math: Built-in overflow protection (Solidity 0.8+)
- Token Safety: SafeERC20 for all transfers
For Lenders:
- Collateral exceeds loan value (LTV < 100%)
- AI-verified asset authentication
- Automatic liquidation mechanism
- Grace period for borrower emergencies
- On-chain transparency
For Borrowers:
- No credit check required
- Fair AI-based valuation
- Flexible repayment terms
- Collateral returned on completion
- Privacy-preserving design
- Optional KYC for larger loans
- Document verification
- AML screening
- Regulatory compliance framework
- User data encryption
Small & Medium Enterprises (SMEs)
- Retail shop owners
- Manufacturers
- Service providers
- Freelancers
- Gig economy workers
Geographic Focus
- Nigeria (primary)
- Sub-Saharan Africa
- Southeast Asia
- Latin America
- Emerging markets globally
Example 1: Phone Shop Owner (Nigeria)
- Owns 20 smartphones worth $10,000
- Needs $6,000 for inventory restocking
- Uploads phones β AI values at $10,500
- Gets loan of $6,000 (60% LTV) at 15% APR for 60 days
- Repays $6,150 after selling inventory
- Unlocks phones, expands business
Example 2: Tailor (Kenya)
- Owns industrial sewing machine worth $2,000
- Needs $1,200 for fabric purchase
- Uploads machine β AI values at $1,950
- Gets loan of $1,200 (62% LTV) at 12% APR for 45 days
- Repays $1,218 after completing orders
- Unlocks machine, continues operations
Example 3: Delivery Driver (Philippines)
- Owns motorcycle worth $3,500
- Needs $2,000 for vehicle maintenance
- Uploads motorcycle β AI values at $3,400
- Gets loan of $2,000 (59% LTV) at 18% APR for 30 days
- Repays $2,030 after working
- Unlocks motorcycle, back to earning
-
Visit TokenLend Platform
https://tokenlend.app -
Connect Wallet
- Click "Connect Wallet"
- Approve MetaMask/WalletConnect
- Mantle network auto-configured
-
Upload Asset
- Click "Borrow" β "Upload Asset"
- Take 3-5 clear photos
- Fill asset details
- Submit for AI analysis
-
Create Loan Request
- Review AI valuation
- Set loan amount (up to max LTV)
- Choose interest rate & duration
- Submit request to marketplace
-
Receive Funding
- Wait for lender to fund
- Stablecoins sent to your wallet
- Collateral NFT locked
-
Repay Loan
- View repayment schedule
- Make payments anytime
- Track progress on dashboard
- Unlock collateral on completion
-
Connect Wallet
- Same as borrowers
-
Browse Marketplace
- Click "Lend" β See available loans
- Filter by asset type, rate, LTV
- Sort by risk/return
-
Review Loan Details
- Click loan to see full details
- Check AI assessment
- Verify collateral value
- Assess borrower (optional KYC)
-
Fund Loan
- Click "Fund Loan"
- Approve stablecoin transfer
- Confirm transaction
- Loan activated
-
Track Investment
- Monitor on "My Investments" tab
- View repayment progress
- Track interest earned
- (If default) Initiate liquidation
Loan Origination Fee: 1-3% (deducted from principal at funding)
- Small loans (<$500): 3%
- Medium loans ($500-$2,000): 2%
- Large loans (>$2,000): 1%
Repayment Fee: 0% (no penalty for early repayment)
Liquidation Fee: 5% (deducted from collateral value)
- 70%: Platform treasury (development, operations)
- 20%: Insurance fund (cover defaults beyond collateral value)
- 10%: Community rewards (future governance token holders)
Set by Market Dynamics
- Borrowers propose rate
- Lenders decide if acceptable
- Competitive marketplace ensures fair rates
Typical Ranges
- Low-risk assets (phones, laptops): 10-15% APR
- Medium-risk (vehicles, machinery): 15-20% APR
- High-risk (inventory, perishables): 20-30% APR
Node.js >= 18
npm or yarn
Git
MetaMask wallet
Mantle testnet MNT (from faucet)# Clone repository
git clone https://github.com/your-org/tokenlend.git
cd tokenlend
# Install dependencies
npm install --legacy-peer-deps
# Setup environment
cp .env.example .env.local
# Edit .env.local with your API keys
# Run development server
npm run devtokenlend/
βββ contracts/ # Solidity smart contracts
β βββ AssetToken.sol
β βββ LoanManager.sol
β βββ MockStablecoin.sol
βββ backend/ # Express.js API
β βββ src/
β βββ controllers/
β βββ services/
β βββ models/
β βββ routes/
βββ frontend/ # Next.js application
β βββ app/ # Pages (Next.js App Router)
β βββ components/ # React components
β βββ lib/ # Utilities, hooks, services
β βββ public/ # Static assets
βββ test/ # Smart contract tests
βββ scripts/ # Deployment scripts
# Smart contract tests
npx hardhat test
# Frontend tests
npm run test
# E2E tests
npm run test:e2e# Deploy to Mantle testnet
npx hardhat run scripts/deploy.js --network mantleTestnet
# Verify contracts
npx hardhat verify --network mantleTestnet <CONTRACT_ADDRESS>- Smart contracts (AssetToken + LoanManager)
- AI valuation engine (GPT-4 Vision)
- Frontend UI (all pages)
- Smart contract integration
- Mantle testnet deployment
- Demo deployment
- IPFS integration for images
- KYC verification flow
- Email/SMS notifications
- Transaction history
- User profiles
- Security audit
- Deploy to Mantle mainnet
- Real stablecoin support
- Fiat on/off-ramps
- Mobile apps (iOS/Android)
- Multi-language support
- Community governance
- Expand to more asset types
- Institutional lender partnerships
- Credit scoring system
- Secondary loan marketplace
- Insurance products
- DAO governance
We welcome contributions from the community!
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Follow existing code style
- Write tests for new features
- Update documentation
- Keep commits atomic and descriptive
Use GitHub Issues with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
This project is licensed under the MIT License. See LICENSE file for details.
- Mantle Network for blockchain infrastructure
- OpenAI for GPT-4 Vision API
- OpenZeppelin for secure smart contract libraries
- RainbowKit for wallet connection UX
- Vercel for frontend hosting
- Website: https://tokenlend.app
- Email: [email protected]
- Twitter: @TokenLend
- Discord: Join Community
- GitHub: tokenlend
Built for Mantle Hackathon 2026
Tracks:
- π¦ RWA/RealFi - Tokenizing real-world assets
- π DeFi & Composability - Lending protocol on Mantle
- π€ AI & Oracles - GPT-4 Vision for asset valuation
- π¨ UX/Demo - Polished user experience
Empowering SMEs. Securing Lenders. Building Trust.
Made with β€οΈ for the next billion DeFi users