Documentation Index
Fetch the complete documentation index at: https://docs.lasso.sh/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Lasso RPC uses intelligent routing strategies to distribute requests across multiple blockchain providers. Each strategy optimizes for different goals: latency, availability, or load distribution.Available Strategies
Load Balanced
Strategy:load_balanced (alias: round_robin)
Endpoint: POST /rpc/load-balanced/:chain
Randomly distributes requests across available providers with health-aware tiering.
How It Works
- Randomly shuffles healthy providers
- Applies tiered reordering based on circuit breaker state and rate limits:
- Tier 1: Closed circuit, not rate-limited (preferred)
- Tier 2: Closed circuit, rate-limited
- Tier 3: Half-open circuit, not rate-limited
- Tier 4: Half-open circuit, rate-limited
- Attempts providers in order until success
Use Cases
- High-volume applications requiring even distribution
- Multi-provider redundancy without latency optimization
- Default strategy for most workloads
Fastest
Strategy:fastest
Endpoint: POST /rpc/fastest/:chain
Routes all requests to the single fastest provider based on measured latency.
How It Works
- Ranks providers by measured latency (ascending) for the specific RPC method
- Uses method-specific, transport-specific latency metrics
- Filters providers requiring minimum quality thresholds:
- Minimum 3 calls for stable metrics
- Minimum 90% success rate
- Falls back to other providers on circuit breaker or rate limit
Staleness Handling
Metrics older than 10 minutes are considered stale and treated as cold start, preventing routing decisions based on outdated performance data.Configuration
Use Cases
- Low-volume, latency-sensitive applications
- Real-time trading or gaming applications
- Scenarios where response time is critical
Latency Weighted
Strategy:latency_weighted
Endpoint: POST /rpc/latency-weighted/:chain
Probabilistically routes requests with bias toward lower-latency providers.
How It Works
-
Calculates weight for each provider based on:
- Latency: Lower latency increases weight
- Success rate: Higher success rate increases weight
- Confidence: More data points increase weight
- Exploration: Minimum weight ensures all providers receive some traffic
-
Weight Formula:
- Selects providers probabilistically based on weights
Configuration
Staleness Handling
Metrics older than 10 minutes receive only theexplore_floor weight, maintaining exploration while preventing decisions based on outdated data.
Use Cases
- Balanced latency optimization with load distribution
- Medium to high-volume applications
- Scenarios requiring both speed and redundancy
Provider Override
Bypass strategy selection and route directly to a specific provider.URL Path Override
Header Override
Query Parameter Override
Use Cases
- Testing specific provider implementations
- Debugging provider-specific issues
- Compliance requirements for specific providers
- Bypass smart routing for known-good providers
Strategy Comparison
| Strategy | Latency Optimization | Load Distribution | Complexity | Best For |
|---|---|---|---|---|
load_balanced | ❌ None | ✅ Even | Low | High-volume, redundancy |
fastest | ✅✅✅ Maximum | ❌ Concentrated | Medium | Low-volume, latency-critical |
latency_weighted | ✅✅ Balanced | ✅ Weighted | High | Medium to high-volume |
| Provider Override | ❌ N/A | ❌ N/A | None | Testing, debugging |
Strategy Selection Priority
When multiple strategy specifications are present, Lasso uses this priority order:- URL path:
/rpc/fastest/:chain - Query parameter:
?strategy=fastest - Header (via
conn.assigns) - Default:
load_balanced
Health-Aware Tiering
All strategies apply health-aware tiering after initial ranking:- Closed circuit, not rate-limited (preferred)
- Closed circuit, rate-limited
- Half-open circuit, not rate-limited
- Half-open circuit, rate-limited
- Open circuit (excluded)
fastest strategy, a provider with circuit breaker issues will be deprioritized below healthy providers.
Failover Behavior
All strategies support automatic failover:- Try selected provider
- If failure is retriable:
- Circuit breaker errors
- Rate limit errors
- Timeout errors
- Network errors
- Move to next provider in ranked list
- Repeat until success or all providers exhausted
Observability
Track which strategy and provider handled your request:Headers Mode
X-Lasso-Request-ID: Request tracking IDX-Lasso-Meta: Base64url-encoded routing metadata
Body Mode
Profile-Scoped Strategies
All strategies are available under profile namespaces:- Provider configurations
- Latency metrics
- Circuit breaker states
- Rate limit tracking