Skip to main content

System Architecture

A deep dive into Pelago's technical architecture and component interactions.

High-Level Architecture​

Component Overview​

API Gateway Layer​

The entry point for all Pelago interactions:

ComponentTechnologyPurpose
Load Balancernginx/CloudflareTraffic distribution, DDoS protection
API ServerGo/Node.jsRequest handling, validation
Rate LimiterRedisRequest throttling
Auth ServiceJWT/API KeysAuthentication & authorization

Core Services​

Payment Service​

Manages the complete payment lifecycle:

  • Payment creation and validation
  • Amount conversion (fiat ↔ crypto)
  • Network selection and routing
  • Status tracking and updates

Settlement Service​

Handles fund distribution:

  • Batch aggregation
  • Fee calculation
  • Liquidity pool interaction
  • Merchant wallet transfers

Identity Service​

Manages PID (Payment ID) system:

  • W3C DID resolution
  • Verifiable credential validation
  • KYC/KYA verification
  • Credit score queries

Blockchain Layer​

Smart Contract Functions​

ContractFunctionDescription
PaymentcreatePayment()Initialize payment request
PaymentexecutePayment()Process customer payment
PaymentrefundPayment()Handle refund requests
LiquidityaddLiquidity()LP deposits funds
LiquiditysettleBatch()Aggregate settlements
IdentityregisterPID()Create new Payment ID
IdentityverifyCredential()Validate verifiable credentials

Data Flow​

Payment Creation Flow​

Payment Execution Flow​

Security Architecture​

Scalability​

Horizontal Scaling​

  • API servers: Auto-scaling pods (Kubernetes)
  • Database: Read replicas + connection pooling
  • Cache: Redis cluster with sharding
  • Queue: Distributed message processing

Performance Targets​

MetricTargetDescription
API Latency< 100ms95th percentile
Throughput10,000 TPSPeak capacity
Availability99.99%Uptime SLA
Recovery< 1 minFailover time

Next Steps​