Documentation

Getting Started with Toplex

Integrate Toplex into your Solana application in minutes. Drop-in compatible with existing @solana/web3.js code.

Quick Start

Install the Toplex SDK and start routing transactions through our optimized execution layer.

# Install the SDK npm install @toplex/sdk # Or with yarn yarn add @toplex/sdk
import { Toplex } from '@toplex/sdk'; // Initialize client with your API key const client = new Toplex(process.env.TOPLEX_API_KEY); // Send an optimized transaction const signature = await client.sendOptimizedTransaction({ transaction: signedTx, strategy: 'aggressive-landing', maxRetries: 5, priorityFee: 'auto' }); console.log('Transaction landed:', signature);

Drop-in RPC Replacement

You can use Toplex as a direct RPC endpoint without changing any existing code. Simply replace your RPC URL:

import { Connection } from '@solana/web3.js'; // Before (standard RPC) // const connection = new Connection('https://api.mainnet-beta.solana.com'); // After (Toplex optimized) const connection = new Connection( 'https://rpc.toplex.io/v1/YOUR_API_KEY' ); // All existing code works unchanged const balance = await connection.getBalance(publicKey); const tx = await connection.sendTransaction(signedTx);

API Reference

Core methods available in the Toplex SDK.

sendOptimizedTransaction()

Send a transaction with automatic priority fee optimization, MEV protection, and retry logic.

getTransactionStatus()

Check the real-time status of a submitted transaction including slot confirmation and retry count.

estimatePriorityFee()

Get the ML-predicted optimal priority fee for current network conditions.

simulateTransaction()

Simulate a transaction against the latest state with detailed error traces if it would fail.

subscribeToSlot()

WebSocket subscription for real-time slot updates with leader schedule awareness.

getNetworkHealth()

Returns current TPS, slot time, and congestion metrics across all Toplex edge nodes.

Configuration Options

const client = new Toplex(apiKey, { // Network: 'mainnet-beta' | 'devnet' | 'testnet' network: 'mainnet-beta', // Landing strategy // 'standard' - default retry logic // 'aggressive-landing' - max retries with fee bumping // 'cost-optimized' - minimize priority fees strategy: 'aggressive-landing', // MEV protection via Jito bundles mevProtection: true, // Auto priority fee estimation priorityFee: 'auto', // Max compute units (default: 200,000) maxComputeUnits: 200_000, // Webhook URL for transaction status updates webhookUrl: 'https://your-app.com/api/tx-status' });

Rate Limits

PlanRequests/monthRequests/sec
Developer5,000,000100
Scale50,000,0005,000
EnterpriseUnlimitedCustom

Support

Need help? Reach out to us on Twitter / X or email us at support@toplex.io.