@venumdev/tpu-client
v0.1.0
Published
Minimal Solana TPU QUIC client for direct transaction sends
Downloads
20
Maintainers
Readme
@venumdev/tpu-client
Minimal TypeScript TPU client for sending serialized Solana transactions directly to upcoming leaders over QUIC.
This package is intentionally simple:
- resolves upcoming leader TPU QUIC sockets from a
Connection - sends the same serialized transaction to a small leader fanout
- retries failed sends
- keeps lightweight per-address latency telemetry for ranking
This is not a full reproduction of a production MEV submission stack. It does not include native transport, sidecars, geo lookup, Jito, or RPC rebroadcast logic.
Venum Hosted Submission
If you want a hosted transaction-sending endpoint instead of managing TPU sends yourself, Venum provides POST /v1/send for any signed Solana transaction.
- accepts either base64 JSON or raw signed transaction bytes
- requires an API key
- routes submission through Venum's landing fan-out instead of a single RPC
sendTransactionpath - returns
status: "submitted"immediately, which means submission started, not that the transaction is confirmed on-chain
Venum: www.venum.dev
Docs:
Install
pnpm add @venumdev/tpu-client @solana/web3.jsUsage
import { Connection, VersionedTransaction } from '@solana/web3.js';
import { TpuClient } from '@venumdev/tpu-client';
const connection = new Connection(process.env.RPC_URL!);
const tpu = new TpuClient(connection, {
fanoutSlots: 8,
maxAddressesPerSend: 2,
sendTimeoutMs: 1200,
retryCount: 1,
});
const tx = VersionedTransaction.deserialize(serializedBytes);
const result = await tpu.sendRawTransaction(tx.serialize());
console.log(result);API
new TpuClient(connection, options?, transport?)
connection must provide getSlot, getSlotLeaders, and getClusterNodes in the same shape as @solana/web3.js Connection.
await tpu.sendRawTransaction(serialized, slot?)
Returns:
{
signature: string;
slot: number;
leaders: string[];
addresses: string[];
missingLeaders: string[];
attempted: number;
succeeded: number;
failed: number;
}Notes
- TPU sends are fire-and-forget ingress attempts, not confirmation.
- Some validators do not expose
tpuQuic, somissingLeaderscan be non-empty. - In practice you usually combine TPU sends with at least one fallback path.
