Architecture
System Overview
KiloLend's lending architecture is designed for scalability, security, and seamless user experience. The protocol consists of three interconnected layers that work together to deliver a comprehensive DeFi lending platform with AI assistance and social features.
Core Components
Frontend Layer
The user-facing interface that provides access to all protocol features through both LINE and web browsers.
LINE Mini Dapp (Mobile)
Native LIFF SDK integration for mobile-first experience
Social login via LINE account
QR Code Functionality: Scan-to-send tokens using mobile camera
Social Features: Invite system with reward multipliers
Web App (Desktop)
Full-featured desktop interface
External wallet support (Kaia, OKX, Google)
Same account system as mobile version
Blockchain Layer - Smart Contracts
Battle-tested lending protocol built on Compound V2 with custom enhancements for stablecoin optimization.
Core Contracts:
Comptroller: Central risk management and market coordination
cToken Markets: Individual lending pools for each supported asset
Interest Rate Models: Dynamic rate calculation based on utilization
Oracle System: Multi-source price feeds with failover mechanisms
Security Features:
Proven Compound V2 codebase with minimal modifications
Real-time liquidation monitoring and execution
Multi-oracle price validation
Emergency pause functionality
Backend Layer - AWS Infrastructure
Scalable cloud infrastructure managing off-chain operations, AI services, and user points.
Infrastructure Components:
AWS App Runner: Containerized services for KILO points, oracle bots, and AI engine
Lambda Functions: Serverless APIs for Mini Dapp integration
DynamoDB: NoSQL database for KILO points
CloudWatch: Monitoring and alerting for system health
Smart Contract Architecture
Comptroller - The Central Hub
The Comptroller acts as the protocol's brain, managing all cross-market operations and risk parameters.
Core Responsibilities:
Market listing and configuration management
Collateral factor enforcement
Liquidation threshold monitoring
User account liquidity calculations
Risk model parameter updates
Key Functions:
cToken Markets - Individual Asset Pools
Each supported asset has its own cToken contract handling deposits, withdrawals, and interest calculations.
Market Types:
Stablecoin Markets (cUSDT)
Low base rate with gradual slope
Optimized for stable yield farming
High collateral factor (85%)
Volatile Asset Markets (cBORA, cSIX, cMBX, cKAIA, sStKAIA)
Steeper rate curves reflecting higher risk
Dynamic utilization-based pricing
Moderate collateral factors (70-75%)
Interest Rate Models
Three specialized rate models optimize borrowing costs across different asset classes:
Stablecoin Jump Rate Model
Volatile Asset Rate Model
Oracle System
Multi-layered price feed system ensuring accurate and reliable asset pricing.
Oracle Sources:
Pyth Network: Real-time price feeds with staleness checks
Orakl Network: Decentralized oracle solution for KAIA ecosystem
Internal Oracle Bot: Manual price updates from CoinMarketCap API
Failover Mechanism:
Primary: Pyth Network (sub-second updates)
Secondary: Orakl Network (backup validation)
Tertiary: Internal bot (manual intervention)
Backend Infrastructure
Bot Operations (AWS App Runner)
Containerized services running 24/7 to maintain protocol health and user experience.
Oracle Bot
Function: Updates on-chain prices for all supported assets
Frequency: Every 2 hours or on significant price deviations
Sources: CoinMarketCap API with multiple data points
Failover: Automatic retry logic with exponential backoff
Liquidation Bot
Function: Monitors and executes underwater position liquidations
Monitoring: Real-time scanning every 10 minutes
Trigger: Health factor < 1.20 (liquidation threshold)
Execution: Automated liquidation with optimal collateral seizure
KILO Points Bot
Function: Tracks user activities and calculates daily point distributions
Events Monitored: Mint, Redeem, Borrow, RepayBorrow
Formula:
(Base TVL × 50%) + (Net Contribution × 50%) × Invite MultiplierDistribution: Daily point allocation based on activity metrics
This architecture enables KiloLend to deliver a secure, scalable, and user-friendly DeFi lending experience while maintaining the reliability and battle-tested security of the Compound V2 protocol foundation.
Last updated
