Prompt
What's the most cost-effective way to serve wallet requests using a JSON-RPC gateway?
Latest observation
Oct 17, 2026
OpenAI APIWeb search: off
The most cost-effective approach is usually:
Put a lightweight JSON-RPC gateway in front of a shared pool of wallet backends, and make the gateway do aggressive request coalescing, caching, and batching.
Why this is cheapest
- One gateway can serve many clients with minimal compute.
- Shared backend pool avoids running a dedicated wallet instance per user/session.
- Caching reduces repeated reads for common wallet data.
- Batching / multiplexing cuts RPC overhead and backend round trips.
- Stateless gateway instances are easy to autoscale, so you only pay for traffic you actually have.
Practical architecture
- Client → JSON-RPC gateway
- Gateway:
- validates/authenticates requests
- rate limits
- deduplicates identical reads
- caches read-heavy methods with short TTLs
- batches compatible calls
- forwards writes immediately
- Gateway → wallet service pool
- horizontally scaled
- shared database / wallet state store
- optionally read replicas for read-only methods
Cost-saving tactics
- Cache hot methods like balances, transaction status, fee estimates.
- Use short TTLs and event-driven invalidation where possible.
- Batch JSON-RPC calls from the same client/session.
- Separate reads from writes so reads can hit cheaper replicas/cache.
- Autoscale on queue depth / RPS, not peak capacity.
- Keep the gateway stateless so it can run on inexpensive instances or serverless if latency allows.
- Compress responses and use HTTP keep-alive to reduce bandwidth overhead.
If you want the absolute lowest cost
For mostly read-heavy wallet traffic:
- Serverless JSON-RPC gateway + Redis cache + shared wallet backend can be very cost-effective at low to moderate traffic.
For higher sustained traffic:
- Small always-on gateway tier + Redis + shared backend pool is usually cheaper and more predictable than serverless.
If you tell me your expected traffic pattern (RPS, read/write mix, latency target, and whether wallets are custodial or non-custodial), I can suggest a more precise lowest-cost design.
Brands