System Overview
Karpous is a blockchain-powered real-world asset (RWA) investment platform that enables users to invest in tokenized assets, earn yields, and manage their portfolios. The platform combines smart contract security with a robust backend infrastructure.
Core Components
1. Client Applications
| Platform | Technology | Purpose |
|---|
| Mobile App | React Native | iOS/Android investment app |
| Web App | Next.js | Browser-based platform |
| Telegram Mini App | React | Telegram-integrated experience |
2. Backend API
- Framework: Encore.dev (TypeScript)
- Database: PostgreSQL via Supabase
- Cache: Redis
- Event System: Encore Pub/Sub
3. Smart Contracts
- Blockchain: Base (Ethereum L2)
- Language: Solidity 0.8.26
- Pattern: BoringVault-inspired minimal design
4. Cold Storage
- Hardware: Ledger hardware wallet
- Security: Physical confirmation required
- Funds: All user deposits stored here
Product Architecture
Investment Products
| Product | Description | Lock Period | Yield |
|---|
| Earn | Time-locked staking with boost multipliers | 1-12 months | Variable APY |
| fToken | Fractional ownership of real assets | None | Asset appreciation |
| Direct Purchase | Whole unit asset purchases | None | Asset-based |
Data Flow
Deposit Flow
Withdrawal Flow
Technical Stack
Backend
| Component | Technology | Purpose |
|---|
| Framework | Encore.dev | API & infrastructure |
| Language | TypeScript 5.x | Type-safe development |
| Database | PostgreSQL | Primary data store |
| ORM | Drizzle ORM | Database operations |
| Cache | Redis | Session & data caching |
| Auth | JWT + MFA | User authentication |
Blockchain
| Component | Technology | Purpose |
|---|
| Network | Base (Ethereum L2) | Smart contract deployment |
| Language | Solidity 0.8.26 | Contract development |
| Libraries | Solmate, OpenZeppelin | Security primitives |
| Testing | Foundry | Contract testing |
Infrastructure
| Component | Technology | Purpose |
|---|
| Hosting | Cloud (AWS/GCP) | Backend deployment |
| CDN | Cloudflare | DDoS protection, caching |
| Monitoring | Encore Dashboard | Observability |
| Secrets | AWS KMS / Vault | Secret management |
Integration Points
External Services
| Service | Purpose |
|---|
| Zoho SMTP | Transactional emails |
| Firebase Admin | Google OAuth |
| Telegram API | Bot & Mini App |
| Supabase | Managed PostgreSQL |
| RPC Providers | Blockchain connectivity |
Scalability Design
Horizontal Scaling
- Stateless API: Multiple instances behind load balancer
- Database Pooling: Connection pooling with 20 max connections
- Event-Driven: Async processing via pub/sub
- Caching: Redis for frequently accessed data
| Metric | Target |
|---|
| API Response Time | Under 200ms |
| Database Query | Under 100ms |
| Concurrent Users | 10,000+ |
| Transaction Throughput | 1,000 TPS |
Documentation Index