Skip to main content

What is routing optimization?

Routing optimization intelligently selects the best blockchain data provider for each request based on real-time analysis of cost, reliability, and performance. Instead of using a fixed provider, Uniblock dynamically routes to the optimal provider for current conditions. Use routing optimization when you need:
  • Lowest possible costs without sacrificing reliability
  • Automatic adaptation to provider performance changes
  • Optimal provider selection for different endpoint types
  • Data-driven routing decisions
Routing optimization is available on Growth plans and above. View pricing β†’

How it works

Uniblock continuously monitors provider performance and makes routing decisions based on:
  1. Cost analysis - Current pricing for each provider
  2. Reliability tracking - Success rates, uptime, error rates
  3. Performance metrics - Response times, throughput
  4. Historical data - Provider performance over time
  5. Endpoint-specific optimization - Different providers excel at different endpoints
Request β†’ Analyze providers
       β†’ Provider A: $0.001/call, 99.9% uptime
       β†’ Provider B: $0.002/call, 99.95% uptime
       β†’ Provider C: $0.0015/call, 99.5% uptime
       β†’ Route to Provider A (best cost/reliability ratio)

Optimization factors

Cost efficiency

Uniblock tracks real-time provider pricing:
ProviderCost per callMonthly cost (1M calls)
Covalent$0.0008$800
Moralis$0.0012$1,200
Alchemy$0.0015$1,500
QuickNode$0.0020$2,000
Routing decision: Route to Covalent for maximum cost savings.

Reliability

Success rates and uptime are continuously monitored:
ProviderUptimeSuccess rateError rate
Alchemy99.95%99.8%0.2%
Infura99.90%99.5%0.5%
QuickNode99.85%99.3%0.7%
Moralis99.80%99.0%1.0%
Routing decision: Balance cost with reliability based on your preferences.

Performance

Response times and throughput are tracked:
ProviderAvg response timeP95 response timeThroughput
QuickNode120ms250ms1000 req/s
Alchemy150ms300ms800 req/s
Infura180ms350ms600 req/s
Moralis200ms400ms500 req/s
Routing decision: Route to QuickNode for latency-sensitive operations.

Endpoint-specific optimization

Different providers excel at different endpoint types:
Endpoint typeBest providerReason
Token balancesCovalentLowest cost, high reliability
NFT metadataAlchemyBest NFT data quality
Transaction historyMoralisComprehensive historical data
Real-time eventsQuickNodeLowest latency
Token pricesCoinGeckoMost accurate pricing

Real-world examples

Example 1: Cost optimization for token balances

Scenario: Your app makes 1 million token balance requests per month. Without optimization:
All requests β†’ Alchemy ($0.0015/call)
Monthly cost: $1,500
With optimization:
Requests β†’ Covalent ($0.0008/call, 99.9% uptime)
Monthly cost: $800
Savings: $700/month (47% reduction)
Request:
curl --location \
'https://api.uniblock.dev/uni/v1/token/balances?chainId=1&address=0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb' \
--header 'x-api-key: YOUR_API_KEY'
Outcome: Automatic routing to Covalent saves $700/month without code changes.

Example 2: Reliability optimization for critical operations

Scenario: Your trading platform requires maximum reliability for price data. Optimization preference: Reliability > Cost Routing decision:
Provider A: $0.001/call, 99.5% uptime ❌
Provider B: $0.002/call, 99.95% uptime βœ… (selected)
Provider C: $0.0015/call, 99.8% uptime ❌
Request:
curl --location \
'https://api.uniblock.dev/uni/v1/token/price?chainId=1&tokenAddress=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' \
--header 'x-api-key: YOUR_API_KEY'
Outcome: Routes to most reliable provider despite higher cost.

Example 3: Performance optimization for real-time data

Scenario: Your app displays real-time NFT sales and needs low latency. Optimization preference: Performance > Cost Routing decision:
Provider A: 200ms avg, $0.001/call ❌
Provider B: 120ms avg, $0.002/call βœ… (selected)
Provider C: 180ms avg, $0.0015/call ❌
Request:
curl --location \
'https://api.uniblock.dev/uni/v1/nft/transfers?chainId=1&collectionAddress=0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D' \
--header 'x-api-key: YOUR_API_KEY'
Outcome: Routes to fastest provider for best user experience.

Example 4: Dynamic adaptation to provider issues

Scenario: Your primary provider experiences performance degradation. Initial state:
Provider A: $0.001/call, 99.9% uptime βœ… (primary)
Provider B: $0.002/call, 99.95% uptime
After degradation:
Provider A: $0.001/call, 95% uptime ❌ (degraded)
Provider B: $0.002/call, 99.95% uptime βœ… (now primary)
Outcome: Automatically switches to Provider B until Provider A recovers.

Configuration

Configure routing optimization in the Uniblock dashboard:

Optimization strategy

Choose what to optimize for:
StrategyDescriptionUse case
Balanced (default)Optimize cost and reliability equallyMost applications
Cost-optimizedPrioritize lowest costBudget-conscious apps
Reliability-optimizedPrioritize highest uptimeCritical operations
Performance-optimizedPrioritize lowest latencyReal-time applications

Minimum reliability threshold

Set minimum acceptable reliability:
ThresholdDescriptionUse case
95%Allow less reliable providersNon-critical data
99% (default)Standard reliabilityMost applications
99.9%High reliabilityFinancial applications
99.95%Maximum reliabilityCritical operations

Cost ceiling

Set maximum acceptable cost per call:
CeilingDescriptionUse case
$0.001Very low costHigh-volume, low-margin
$0.002 (default)Moderate costStandard applications
$0.005Higher cost acceptablePremium features
UnlimitedCost not a factorEnterprise applications

Endpoint-specific rules

Configure different optimization for different endpoints:
Example configuration
{
  "token/balances": {
    "strategy": "cost-optimized",
    "minReliability": 99.0
  },
  "token/price": {
    "strategy": "reliability-optimized",
    "minReliability": 99.9
  },
  "nft/transfers": {
    "strategy": "performance-optimized",
    "maxLatency": 200
  }
}

Monitoring and analytics

Track routing optimization in the Uniblock dashboard:

Cost savings

  • Total cost - Current month spending
  • Projected savings - Compared to fixed provider
  • Cost per endpoint - Breakdown by endpoint type
  • Provider cost distribution - Which providers are used most

Provider distribution

  • Request distribution - Percentage of requests per provider
  • Cost distribution - Percentage of costs per provider
  • Reliability by provider - Success rates for each provider
  • Performance by provider - Average latency for each provider

Optimization effectiveness

  • Routing decisions - Why each provider was selected
  • Optimization score - How well routing is optimized
  • Missed opportunities - Times when better routing was possible
  • Adaptation speed - How quickly routing adapts to changes

Key benefits

Cost efficiency

Save 30-50% on provider costs through intelligent routing.

Automatic adaptation

Routing adjusts automatically to provider performance changes.

Reliability assurance

Never sacrifice reliability for cost savings.

Performance optimization

Route to fastest providers for time-sensitive operations.

Best practices

Set appropriate thresholds - Balance cost savings with reliability requirements. Don’t set thresholds too aggressive.
Monitor provider distribution - Ensure routing is actually optimizing. High concentration on one provider may indicate issues.
Use endpoint-specific rules - Different endpoints have different requirements. Optimize each category separately.
Review optimization regularly - Provider pricing and performance change. Review settings quarterly.

Comparison: Fixed vs. optimized routing

AspectFixed routingOptimized routing
Provider selectionManualAutomatic
CostFixedOptimized (30-50% savings)
AdaptationManual updatesReal-time adaptation
ReliabilitySingle provider riskMulti-provider resilience
PerformanceFixedOptimized per endpoint
MaintenanceHighLow

Next steps


Common pitfalls

Too aggressive cost optimization - Setting cost thresholds too low may exclude reliable providers. Balance cost with reliability.
Ignoring endpoint-specific needs - Not all endpoints have the same requirements. Configure rules per endpoint type.
Not monitoring provider distribution - Routing concentrated on one provider indicates optimization isn’t working. Investigate and adjust.
Forgetting to review settings - Provider landscape changes. Review optimization settings quarterly to ensure optimal routing.