Skip the congested 20% lane. Moon Land relays your transactions through staked validator connections, giving you access to Solana's 80% SWQoS priority capacity.
Solana's leader nodes reserve 80% of transaction capacity for validators with stake-weighted connections. Without running your own validator, your transactions compete for the remaining 20% — alongside everyone else.
During high congestion, unstaked transactions face severe packet loss and dramatically lower landing rates. Your bot is fast, but the network bottleneck isn't your code — it's your connection.
Moon Land acts as a QUIC-to-QUIC relay that sits between your application and Solana's leader nodes. You connect to us via QUIC, and we forward your transactions through our staked validator connections.
The result: your transactions enter the 80% SWQoS lane without you needing to run a single validator. It's the fastest path from your bot to the block.
Integration is straightforward. Connect, authenticate, and send — your transactions land in the priority lane.
Establish a native QUIC connection to Moon Land's relay endpoint. No HTTP wrappers, no WebSockets — pure QUIC.
Pass your API key on connection. One-time auth grants access to staked forwarding with configurable rate limits.
Fire your serialized transactions. Moon Land forwards them to the current leader via staked QUIC — into the 80% lane.
Every component is engineered for low-latency, high-throughput transaction forwarding.
Add Moon Land to your bot in minutes. Pure QUIC — no HTTP, no WebSocket, no SDK dependency.
quinn = "0.11"
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
tokio = { version = "1", features = ["full"] }
arc-swap = "1"
anyhow = "1"
hex = "0.4"
use anyhow::{Context as _, Result};
use arc_swap::ArcSwap;
use quinn::{
crypto::rustls::QuicClientConfig, ClientConfig, Connection, Endpoint,
IdleTimeout, TransportConfig,
};
use std::net::SocketAddr;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::Mutex;
const ALPN_MOONLAND: &[u8] = b"moonland";
const SERVER_NAME: &str = "moonland";
const KEEP_ALIVE: Duration = Duration::from_secs(5);
const MAX_IDLE: Duration = Duration::from_secs(30);
pub struct MoonLandClient {
endpoint: Endpoint,
client_config: ClientConfig,
addr: SocketAddr,
api_key: [u8; 16],
connection: ArcSwap<Connection>,
reconnect: Mutex<()>,
}
impl MoonLandClient {
/// Contact @MoonLandSol on Telegram for endpoint and API key
pub async fn connect(server_addr: &str, api_key_hex: &str) -> Result<Self> {
let addr: SocketAddr = server_addr.parse()?;
let api_key_vec = hex::decode(api_key_hex)?;
let api_key: [u8; 16] = api_key_vec.try_into()
.map_err(|_| anyhow::anyhow!("API key must be 32 hex chars"))?;
let mut crypto = rustls::ClientConfig::builder()
.dangerous()
.with_custom_certificate_verifier(Arc::new(SkipServerVerification))
.with_no_client_auth();
crypto.alpn_protocols = vec![ALPN_MOONLAND.to_vec()];
let client_crypto = QuicClientConfig::try_from(crypto)?;
let mut client_config = ClientConfig::new(Arc::new(client_crypto));
let mut transport = TransportConfig::default();
transport.keep_alive_interval(Some(KEEP_ALIVE));
transport.max_idle_timeout(Some(IdleTimeout::try_from(MAX_IDLE)?));
client_config.transport_config(Arc::new(transport));
let mut endpoint = Endpoint::client("0.0.0.0:0".parse()?)?;
endpoint.set_default_client_config(client_config.clone());
let connection = endpoint.connect(addr, SERVER_NAME)?.await?;
Ok(Self {
endpoint, client_config, addr, api_key,
connection: ArcSwap::from_pointee(connection),
reconnect: Mutex::new(()),
})
}
pub async fn send_transaction(&self, serialized_tx: &[u8]) -> Result<()> {
let connection = self.connection.load_full();
if Self::try_send(&connection, &self.api_key, serialized_tx).await.is_ok() {
return Ok(());
}
self.reconnect().await?;
let connection = self.connection.load_full();
Self::try_send(&connection, &self.api_key, serialized_tx).await
}
async fn try_send(conn: &Connection, key: &[u8; 16], payload: &[u8]) -> Result<()> {
let mut stream = conn.open_uni().await?;
stream.write_all(key).await?;
stream.write_all(payload).await?;
stream.finish()?;
Ok(())
}
async fn reconnect(&self) -> Result<()> {
let _guard = self.reconnect.lock().await;
let current = self.connection.load_full();
if current.close_reason().is_none() { return Ok(()); }
let connection = self.endpoint
.connect_with(self.client_config.clone(), self.addr, SERVER_NAME)?
.await?;
self.connection.store(Arc::new(connection));
Ok(())
}
}
// TLS: skip server cert verification (self-signed)
#[derive(Debug)]
struct SkipServerVerification;
impl rustls::client::danger::ServerCertVerifier for SkipServerVerification {
fn verify_server_cert(&self, _: &rustls::pki_types::CertificateDer,
_: &[rustls::pki_types::CertificateDer], _: &rustls::pki_types::ServerName,
_: &[u8], _: rustls::pki_types::UnixTime,
) -> Result<rustls::client::danger::ServerCertVerified, rustls::Error> {
Ok(rustls::client::danger::ServerCertVerified::assertion())
}
fn verify_tls12_signature(&self, _: &[u8],
_: &rustls::pki_types::CertificateDer, _: &rustls::DigitallySignedStruct,
) -> Result<rustls::client::danger::HandshakeSignatureValid, rustls::Error> {
Ok(rustls::client::danger::HandshakeSignatureValid::assertion())
}
fn verify_tls13_signature(&self, _: &[u8],
_: &rustls::pki_types::CertificateDer, _: &rustls::DigitallySignedStruct,
) -> Result<rustls::client::danger::HandshakeSignatureValid, rustls::Error> {
Ok(rustls::client::danger::HandshakeSignatureValid::assertion())
}
fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
rustls::crypto::ring::default_provider()
.signature_verification_algorithms.supported_schemes()
}
}
// At bot startup — connect once
let client = MoonLandClient::connect(
"<moonland_endpoint>", // Provided by Moon Land team
"<moonland_api_key>", // Provided by Moon Land team
).await?;
// Per transaction — fire and forget
let serialized_tx = bincode::serialize(&my_transaction)?;
client.send_transaction(&serialized_tx).await?;
Your transactions take the shortest route from your application to the leader's TPU port — through a single trusted relay hop.
Get in touch to set up your Moon Land relay access. API keys are provisioned within minutes.