Skip to main content
Best Practices for Launchpad Trade API
Follow these recommendations to get the fastest execution times from the Launchpad Trade API.

Understanding Response Time

Every transaction response includes two latency metrics:
MetricWhat it measuresWho controls it
networkLatencyTime to build, sign, and broadcast your transaction to SolanaLaunchpad Trade — our infrastructure
confirmLatencyTotal time from request to Solana confirmationSolana network — same for all providers
Your HTTP client will show total response time close to confirmLatency because we wait for Solana confirmation before returning final fields (status, amountSol, tokensReceived).

Why it matters

Solana confirmation time is identical for all providers — no one can make Solana faster. The competition is in how quickly your transaction reaches Solana. When multiple traders target the same opportunity, the first transaction to reach validators gets included earlier in the next block — that’s where execution price is determined. networkLatency is the differentiator. A 40ms difference can mean executing at your target price or missing it entirely. Example: networkLatency: 45, confirmLatency: 520 → we submitted in 45ms, Solana confirmed in 475ms.
To compare providers, look at networkLatency — not confirmLatency, which Solana controls.

Run from Optimal Regions

Network latency between your server and our API directly impacts your trade execution speed. Running your scripts from a server physically close to our infrastructure reduces round-trip time and gives you faster confirmations. Deploy your trading scripts on servers located in one of our supported regions.
CityCodeStatus
Amsterdamams⭐ Recommended
Frankfurtfra✅ Available
Use a VPS or cloud server (AWS, DigitalOcean, Hetzner) in Amsterdam for optimal performance.

Keep Connections Alive

Maintain persistent SSL/TLS connections between requests. Opening a new connection for each request adds significant latency due to the TLS handshake.
Creating a new HTTPS connection for every request can add 100-300ms of latency each time.
Add this setup code once at the beginning of your script. All subsequent requests will automatically reuse the same connection:
import axios from 'axios';
import https from 'https';

// Add this once at the start of your script
const client = axios.create({
  baseURL: 'https://api.launchpad.trade',
  headers: { 'X-API-Key': process.env.API_KEY },
  httpsAgent: new https.Agent({ 
    keepAlive: true,
    keepAliveMsecs: 60000
  })
});

// Then use 'client' for all your requests - connection stays alive automatically
// client.post('/buy', payload)...
Once configured, every request through this client automatically benefits from persistent connections. No extra code needed.

Initialize Your Wallets

Recommended before the first API trade. If a wallet is not initialized, the first swap handles it automatically — but with extra latency. Initialize in advance for optimal speed.
Call the /wallets/init endpoint for each wallet you plan to use for trading (buy, sell, bundle, etc.) via the Launchpad Trade API.

Why Initialize?

When you initialize a wallet, Launchpad Trade pre-allocates resources on the Solana network to speed up your transactions. Without initialization, this allocation happens during your first trade, adding significant latency.

Requirements

  • Minimum 0.01 SOL in the wallet — used for on-chain resource allocation

How to Initialize

curl -X POST https://api.launchpad.trade/wallets/init \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "privateKeys": ["WALLET_PRIVATE_KEY_1", "WALLET_PRIVATE_KEY_2"]
  }'
Expected response:
{
  "success": true,
  "data": {
    "initialized": [
      { "wallet": "7xKX...", "status": "initialized", "costSol": 0.01 }
    ],
    "totalCostSol": 0.01,
    "region": "ams"
  }
}
Once initialized, all subsequent trades from that wallet execute at optimal speed.
See the full Initialize Wallets API reference for all response fields, status values, and error codes.

Region-Specific Initialization

Wallet initialization is region-specific. If you change regions, you must re-initialize your wallets.
Our load balancer automatically routes your requests to the closest, most optimal server. When you initialize a wallet, it’s prepared for that specific region. If you change your server location or IP address:
  1. The load balancer may assign you to a different region
  2. Your wallets won’t be initialized for this new region
  3. Your first transaction will have added latency
To avoid this:
  • Re-initialize your wallets after changing your server location
  • Check your current region with GET /health
If you always run from the same server, you only need to initialize once. Re-initialization is only needed when switching locations.

What’s Next?

Start Trading

Execute your first buy or sell

Error Handling

Handle errors gracefully