Understanding and Minimizing Solana RPC Latency
A comprehensive technical breakdown of latency sources in Solana RPCs, from network hops to serialization overhead, and how to set up your bot so less time is lost between you and the leader.
"Latency" is often treated as a buzzword, but in the world of Solana high-frequency trading (HFT), it is a physics problem. A Solana slot is short, so a delay that would go unnoticed anywhere else can decide whether your transaction makes the block you aimed for. If you are late, you aren't just slow—you are irrelevant.
This article breaks down the four distinct phases of RPC latency and provides actionable engineering strategies to eliminate them.
The Latency Stack
When you call sendTransaction, time is lost in four distinct phases. Understanding this stack is key to optimization.
1. Network Latency (The Speed of Light)
This is the time it takes for your packet to travel from your server to the RPC node. It is purely a function of distance and fiber optics.
- Across an ocean: the largest share of the round trip, and nothing in software removes it.
- Across a continent: smaller, but still set by the length of the fibre.
- Same datacenter: close to nothing.
The Fix: Co-Location. If the RPC is in Frankfurt, your bot must be in Frankfurt. There is no software optimization that can beat the speed of light. Hosting your bot in the same rack as the RPC node reduces this latency to near zero.
2. Processing Latency (Serialization & Validation)
Once the RPC node receives your request, it must:
- Deserialize the JSON-RPC payload.
- Base58 decode the transaction.
- Verify the Ed25519 signature.
- Check the blockhash against the blockhash cache.
- Public RPCs: slow down under load, because every caller competes for the same CPU.
- Private RPCs: fewer callers per node, so the time spent here stays steadier.
The Fix: Use a private RPC that only your allowlisted IPs can reach, and keep heavy calls like unbounded getProgramAccounts off your hot path.
3. Propagation Latency (Gossip)
Once the RPC has validated your transaction, it must forward it to the current leader.
- Standard Gossip: The transaction passes from node to node, and every extra step adds delay.
- Direct Forwarding: The RPC connects directly to the leader's TPU port via QUIC.
The Fix: Send the transaction through a relay built for it rather than through sendTransaction on a general RPC. AllenHark Relay carries a signed transaction over private connections straight to the current leader, over QUIC, WebSocket or HTTPS. (AllenHark RPC's own sendTransaction is a plain pass-through to its upstream node.)
4. Slot Lag (Distance to Leader)
Solana rotates leaders based on a schedule. If the current leader is in Tokyo and your RPC is in New York, you have a physical distance penalty for that specific slot.
The Fix: Geodistributed RPCs. You need an infrastructure provider that intelligently routes your request to an egress node physically closest to the current leader.
Measuring True Latency
Do not rely on ping to measure RPC performance. Ping only measures ICMP response time, which is handled by the network card, not the RPC software.
To measure RPC latency, time a lightweight call like getSlot or getVersion.
# This measures the full round-trip time including SSL handshake and JSON processing
time curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1, "method":"getSlot"}' \
https://your-rpc.comThe AllenHark Advantage
At AllenHark, we optimize every layer of the stack:
- Location: RPC and gRPC endpoints in Frankfurt and Amsterdam, and servers you can rent next to them — see co-location for the sites and specs.
- Access: Endpoints reachable only from your allowlisted IPs, so you are not sharing a public queue.
- Sending: AllenHark Relay for transactions that must reach the current leader over a private connection.
Stop fighting physics. Move your infrastructure to where the action is.
