How Chainfolio's RPC Load Balancer Works
Scoring Algorithm
Each RPC endpoint receives a dynamic score calculated after every request:
score = (successRate * 100) - (latencyMs * 0.1)
- Success Rate – Percentage of successful requests (0‑100)
- Latency – Average response time in milliseconds
- Weighted Calculation – Faster endpoints get higher scores
- Dynamic Updates – Scores adjust in real‑time based on performance
Selection Logic
Chainfolio uses the highest‑scoring endpoint for each request category:
- Primary Selection – Highest score endpoint handles most requests
- Health Checks – Every 5 minutes, all endpoints are tested
- Automatic Failover – If primary fails, next highest score takes over
- Gradual Recovery – Failed endpoints retry with exponential backoff
Step 1: Add Multiple RPC Endpoints
Recommended Endpoint Mix
For optimal redundancy, add at least 3 endpoints per chain from different providers:
Solana Endpoint Strategy
Primary
Helius (paid tier for highest rate limits)
Secondary
QuickNode or Alchemy (geographically close)
Fallback
Ankr or public RPC (free, slower but reliable)
Ethereum Endpoint Strategy
Primary
Alchemy (paid tier with WebSocket)
Secondary
Infura or QuickNode
Fallback
Public RPC or self‑hosted node
Adding Endpoints in Chainfolio
- Open Settings → RPC Configuration
- Click Add New Endpoint for your desired chain (Ethereum or Solana)
- Paste the RPC URL and give it a descriptive name (include provider and location)
- Click Save & Test – Chainfolio validates and scores the endpoint
- Repeat for additional endpoints (minimum 2, recommended 3‑5 per chain)
- Chainfolio automatically begins load balancing across all active endpoints
Step 2: Configure Load Balancing Rules
Request‑Type Routing
Chainfolio can route different types of requests to different endpoints based on requirements:
Balance Queries
- Priority: Lowest latency endpoint
- Frequency: Every 60 seconds per wallet
- Recommended: Endpoint with WebSocket support
Transaction History
- Priority: Endpoint with archive data
- Frequency: Once per wallet (cached locally)
- Recommended: Alchemy/Helius with full history
Contract Interactions
- Priority: Highest reliability endpoint
- Frequency: As needed for DeFi position queries
- Recommended: Paid tier with high success rate
Configuring Failover Thresholds
Chainfolio automatically fails over when endpoints meet certain failure conditions:
| Failure Condition | Action | Retry Policy |
|---|---|---|
| HTTP 429 (Rate Limit) | Immediate failover | Retry after 60 seconds |
| HTTP 5xx (Server Error) | Failover after 3 consecutive failures | Exponential backoff (5s, 25s, 125s) |
| Timeout (> 10 seconds) | Failover after 2 timeouts | Retry immediately with next endpoint |
| Success Rate < 80% | Demote to secondary | Health check every 5 minutes |
Step 3: Monitor Performance & Optimize
Real‑Time Monitoring Dashboard
Chainfolio provides detailed metrics for each endpoint:
- Current Score – Dynamic calculation based on recent performance
- Success Rate – Last 100 requests success percentage
- Average Latency – Response time in milliseconds
- Total Requests – Count of requests made to this endpoint
- Error Breakdown – Types and counts of failures
Accessing the Dashboard
- Navigate to Settings → RPC Configuration
- Click any endpoint to view detailed metrics
- Use the Performance Timeline to see score changes over time
- Check Error Logs for specific failure reasons
- Compare multiple endpoints side‑by‑side
Performance Optimization Tips
Geographic Distribution
- Add endpoints in different regions (US‑East, EU, Asia)
- Chainfolio automatically uses the lowest‑latency option
- Critical during regional outages or congestion
Provider Diversity
- Mix paid and free tiers for cost optimization
- Different providers have different rate‑limit policies
- Avoid single‑point‑of‑failure architecture
Advanced Configuration
Weighted Routing
Advanced feature: Manually adjust endpoint weights. Higher weight = more requests routed to that endpoint.
Access via Settings → RPC Configuration → Advanced → Weighted Routing.
Time‑Based Routing
Advanced feature: Schedule specific endpoints for certain times of day. Example: Use cheaper endpoints during off‑peak hours, premium endpoints during trading hours.
Request‑Type Prioritization
Advanced feature: Designate specific endpoints for specific request types. Example: Use WebSocket‑enabled endpoints for balance queries, archive nodes for historical data.
Troubleshooting Load Balancing Issues
All Endpoints Failing
Solution: Check internet connection. If all endpoints fail simultaneously, Chainfolio enters "degraded mode" and uses cached data while periodically retrying endpoints.
Constant Endpoint Switching
Solution: Increase failover thresholds in settings. If endpoints have similar scores, Chainfolio may switch frequently—adjust scoring weights or add more distinct endpoints.
Slow Initial Sync
Solution: Chainfolio needs to test all endpoints initially. After first sync, performance improves as optimal endpoints are identified.
Technical Implementation Details
- Local‑Only Operation – All load‑balancing logic runs in your browser, no server coordination
- No External Dependencies – Scoring and selection use only local performance data
- Privacy‑Preserving – Endpoint performance data never leaves your device
- Deterministic Scoring – Same performance metrics produce same scores across devices
- Graceful Degradation – If all endpoints fail, Chainfolio uses cached data with clear warnings