Skip to main content

Platform Architecture

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​

PlatformTechnologyPurpose
Mobile AppReact NativeiOS/Android investment app
Web AppNext.jsBrowser-based platform
Telegram Mini AppReactTelegram-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​

ProductDescriptionLock PeriodYield
EarnTime-locked staking with boost multipliers1-12 monthsVariable APY
fTokenFractional ownership of real assetsNoneAsset appreciation
Direct PurchaseWhole unit asset purchasesNoneAsset-based

Data Flow​

Deposit Flow​

Withdrawal Flow​


Technical Stack​

Backend​

ComponentTechnologyPurpose
FrameworkEncore.devAPI & infrastructure
LanguageTypeScript 5.xType-safe development
DatabasePostgreSQLPrimary data store
ORMDrizzle ORMDatabase operations
CacheRedisSession & data caching
AuthJWT + MFAUser authentication

Blockchain​

ComponentTechnologyPurpose
NetworkBase (Ethereum L2)Smart contract deployment
LanguageSolidity 0.8.26Contract development
LibrariesSolmate, OpenZeppelinSecurity primitives
TestingFoundryContract testing

Infrastructure​

ComponentTechnologyPurpose
HostingCloud (AWS/GCP)Backend deployment
CDNCloudflareDDoS protection, caching
MonitoringEncore DashboardObservability
SecretsAWS KMS / VaultSecret management

Integration Points​

External Services​

ServicePurpose
Zoho SMTPTransactional emails
Firebase AdminGoogle OAuth
Telegram APIBot & Mini App
SupabaseManaged PostgreSQL
RPC ProvidersBlockchain 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

Performance Targets​

MetricTarget
API Response TimeUnder 200ms
Database QueryUnder 100ms
Concurrent Users10,000+
Transaction Throughput1,000 TPS

Documentation Index​

DocumentDescription
Smart ContractsContract architecture & interactions
Backend APIAPI structure & services
Technical StackComplete technology overview